Changeset 928 for trunk/src


Ignore:
Timestamp:
Mar 5, 2016, 5:57:11 PM (5 years ago)
Author:
sommeria
Message:

corrections

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r924 r928  
    15041504    end
    15051505end
    1506 
     1506ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
    15071507%% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled
    15081508if strcmp(ActionExt,'.sh')
  • trunk/src/series/extract_rdvision.m

    r924 r928  
    6464    ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6565    ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    66     ParamOut.NbSlice='one'; ...%nbre of slices, 'one' prevents splitting in several processes, ('off' by default)
     66    ParamOut.NbSlice=1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)
    6767    ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6868    ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    184184checkpreserve=0;% if =1, will npreserve the original images, else it erases them at the end
    185185for iview=1:size(Param.InputTable,1)
    186     for iview_xml=1:size(Param.InputTable,1)% loojk for the xml files in the different data directories
    187     filexml=[fullfile(RootPath,Param.InputTable{iview_xml,2},Param.InputTable{iview,3}) '.xml'];%new convention: xml at the level of the image folder
    188     if exist(filexml,'file')
    189         break
    190     end
    191     end 
     186    for iview_xml=1:size(Param.InputTable,1)% look for the xml files in the different data directories
     187        filexml=[fullfile(RootPath,Param.InputTable{iview_xml,2},Param.InputTable{iview,3}) '.xml'];%new convention: xml at the level of the image folder
     188        if exist(filexml,'file')
     189            break
     190        end
     191    end
    192192    if ~exist(filexml,'file')
    193193        disp_uvmat('ERROR',[filexml ' missing'],checkrun)
     
    195195    end
    196196    [XmlData,errormsg]=imadoc2struct(filexml);
    197    
    198     newxml=[fullfile(RootPath,Param.InputTable{iview,3}) '.xml']
     197    newxml=fullfile(RootPath,Param.InputTable{iview,3});
     198    newxml=regexprep(newxml,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180'
     199    newxml=[newxml '.xml'];
    199200   
    200201    [success,errormsg] = copyfile(filexml,newxml); %copy the xml file in the upper folder
     
    306307        end
    307308    end
    308    
    309     % check images
    310    
    311 %     delete(fullfile(RootPath,'Running.xml'))%delete the  xml file to indicate that processing is finished
    312 %     if ~checkpreserve
    313 %         for ibin=1:numel(BinList)
    314 %             delete(BinList{ibin})
    315 %         end
    316 %         rmdir(fullfile(RootPath,Param.InputTable{iview,2}))
    317 %     end
    318 end
     309end
     310
     311%% remove binary files if transfer OK
     312    if ~checkpreserve
     313        for ibin=1:numel(BinList)
     314            delete(BinList{ibin})
     315        end
     316        rmdir(fullfile(RootPath,Param.InputTable{iview,2}))
     317    end
    319318delete(fullfile(RootPath,'Running.xml'))%delete the  xml file to indicate that processing is finished
    320319
     
    352351BitDepth=8*SeqData.bytesperpixel;%needed to write images (8 or 16 bits)
    353352binrepertoire=fullfile(PathDir,SeqData.binrepertoire);
    354 OutputDir=fullfile(PathDir,SeqData.sequencename);
     353FileDir=SeqData.sequencename;
     354FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180'
     355OutputDir=fullfile(PathDir,FileDir);
    355356if ~exist(OutputDir,'dir')
    356357    %     errormsg=[OutputDir ' already exist, delete it first'];
     
    371372    end
    372373    i1=floor((ii-1)/nbfield2)+1;
    373     OutputFile=fullfile_uvmat(PathDir,SeqData.sequencename,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
     374    OutputFile=fullfile_uvmat(PathDir,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
    374375    fname=fullfile(binrepertoire,sprintf('%s%.5d.bin',SeqData.binfile,SqbData(ii).file_idx));
    375376    if exist(OutputFile,'file')
  • trunk/src/transform_field/ima_edge_detection.m

    r924 r928  
    44%%%%  Use the general syntax for transform fields with a single input and parameters %%%%
    55% OUTPUT:
    6 % DataOut:   output field structure
     6% Data:   output field structure
    77%
    88%INPUT:
     
    2929%=======================================================================
    3030
    31 function DataOut=ima_edge_detection(DataIn,Param)
     31function Data=ima_edge_detection(Data,Param,Data_1)
    3232
    3333%% request input parameters
    34 if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
     34if isfield(Data,'Action') && isfield(Data.Action,'RUN') && isequal(Data.Action.RUN,0)
    3535    prompt = {'npx';'npy';'threshold'};
    3636    dlg_title = 'get the filter size in x and y';
     
    4242    end
    4343    answer = inputdlg(prompt,dlg_title,num_lines,def);
    44     DataOut.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window
    45     DataOut.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window
    46     DataOut.TransformInput.LumThreshold=str2num(answer{3}); %size of the filtering window
     44    Data.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window
     45    Data.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window
     46    Data.TransformInput.LumThreshold=str2num(answer{3}); %size of the filtering window
    4747    return
    4848end
    4949
    50 DataOut=DataIn; %default
    51 %DataOut.A=255*edge(DataIn.A);
    5250
    5351%definition of the cos shape matrix filter
     
    6260Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
    6361
     62Afilt=filter2(Mfiltre,Data.A);% smooth the image, excluding the edges (spurious reflexions)
     63
     64    %Afilt=filter2(Mfiltre,Data.A(100:end-100,100:end-100));% smooth the image, excluding the edges (spurious reflexions)
     65  %Data.A= double(Data.A)-Afilt;
    6466
    6567
    66     Afilt=filter2(Mfiltre,DataIn.A(100:end-100,100:end-100));% smooth the image, excluding the edges (spurious reflexions)
     68   
     69   
     70%     
    6771    Amax=max(max(Afilt));
    6872    Amin=min(min(Afilt));
     73%     Data.A( Data_1.A(100:end-100,100:end-100)==100)=(Amin+Amax)/2;
     74
     75 
     76 
    6977    Athreshold=(Amin+Amax)*Param.TransformInput.LumThreshold;
    7078%     
    71 %     DataOut.A=zeros(size(DataIn.A,1),size(DataIn.A,2),3);
    72     DataOut.A=(DataIn.A>Athreshold);%transform to the initial image format
    73 %     DataOut.A(:,:,1)=DataIn.A;%transform to the initial image format, red
    74 STATS = regionprops(DataOut.A, 'FilledArea','MinorAxisLength','MajorAxisLength','PixelIdxList');
     79%     Data.A=zeros(size(Data.A,1),size(Data.A,2),3);
     80    Data.A=(Data.A>Athreshold);%transform to the initial image format
     81%     Data.A(:,:,1)=Data.A;%transform to the initial image format, red
     82STATS = regionprops(Data.A, 'FilledArea','MinorAxisLength','MajorAxisLength','PixelIdxList');
    7583Area=zeros(size(STATS));
    7684for iobj=1:numel(STATS)
    7785    Area(iobj)=STATS(iobj).FilledArea;
    7886end
    79 [Area, main_obj]=max(Area);
    80     MajorAxisLength=STATS(main_obj).MajorAxisLength
    81     MinorAxisLength=STATS(main_obj).MinorAxisLength
     87[Area, main_obj]=max(Area)
     88    MajorAxisLength=STATS(main_obj).MajorAxisLength;
     89    MinorAxisLength=STATS(main_obj).MinorAxisLength;
    8290for iobj=1:numel(STATS)
    8391    if iobj~=main_obj
    84     DataOut.A(STATS(iobj).PixelIdxList)=0;
     92    Data.A(STATS(iobj).PixelIdxList)=0;
    8593    end
    8694end
    8795
    88 DataOut.A=Amax*DataOut.A;
     96Data.A=Amax*Data.A;
    8997 
  • trunk/src/transform_field/ima_patch_detection.m

    r924 r928  
    8787DataOut=DataIn; %default
    8888%Amask=imread('/fsnet/project/coriolis/2015/15MINI_MEDDY/0_REF_FILES/mask_patch.png');
    89 plot_mask(DataIn.A,Param.TransformInput.LumThreshold)
     89hfig=findobj(allchild(0),'Tag','set_threshold');
     90hThreshold=findobj(hfig,'Tag','Threshold');
     91Threshold=str2num(get(hThreshold,'String'));
     92plot_mask(DataIn.A,Threshold)
    9093% Athreshold=Param.TransformInput.LumThreshold;
    9194% %
Note: See TracChangeset for help on using the changeset viewer.