- Timestamp:
- Mar 5, 2016, 5:57:11 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r924 r928 1504 1504 end 1505 1505 end 1506 1506 ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName); 1507 1507 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled 1508 1508 if strcmp(ActionExt,'.sh') -
trunk/src/series/extract_rdvision.m
r924 r928 64 64 ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 65 65 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) 67 67 ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 68 68 ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) … … 184 184 checkpreserve=0;% if =1, will npreserve the original images, else it erases them at the end 185 185 for iview=1:size(Param.InputTable,1) 186 for iview_xml=1:size(Param.InputTable,1)% loo jk for the xml files in the different data directories187 filexml=[fullfile(RootPath,Param.InputTable{iview_xml,2},Param.InputTable{iview,3}) '.xml'];%new convention: xml at the level of the image folder188 if exist(filexml,'file')189 break190 end191 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 192 192 if ~exist(filexml,'file') 193 193 disp_uvmat('ERROR',[filexml ' missing'],checkrun) … … 195 195 end 196 196 [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']; 199 200 200 201 [success,errormsg] = copyfile(filexml,newxml); %copy the xml file in the upper folder … … 306 307 end 307 308 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 309 end 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 319 318 delete(fullfile(RootPath,'Running.xml'))%delete the xml file to indicate that processing is finished 320 319 … … 352 351 BitDepth=8*SeqData.bytesperpixel;%needed to write images (8 or 16 bits) 353 352 binrepertoire=fullfile(PathDir,SeqData.binrepertoire); 354 OutputDir=fullfile(PathDir,SeqData.sequencename); 353 FileDir=SeqData.sequencename; 354 FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180' 355 OutputDir=fullfile(PathDir,FileDir); 355 356 if ~exist(OutputDir,'dir') 356 357 % errormsg=[OutputDir ' already exist, delete it first']; … … 371 372 end 372 373 i1=floor((ii-1)/nbfield2)+1; 373 OutputFile=fullfile_uvmat(PathDir, SeqData.sequencename,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode374 OutputFile=fullfile_uvmat(PathDir,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode 374 375 fname=fullfile(binrepertoire,sprintf('%s%.5d.bin',SeqData.binfile,SqbData(ii).file_idx)); 375 376 if exist(OutputFile,'file') -
trunk/src/transform_field/ima_edge_detection.m
r924 r928 4 4 %%%% Use the general syntax for transform fields with a single input and parameters %%%% 5 5 % OUTPUT: 6 % Data Out: output field structure6 % Data: output field structure 7 7 % 8 8 %INPUT: … … 29 29 %======================================================================= 30 30 31 function Data Out=ima_edge_detection(DataIn,Param)31 function Data=ima_edge_detection(Data,Param,Data_1) 32 32 33 33 %% request input parameters 34 if isfield(Data In,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)34 if isfield(Data,'Action') && isfield(Data.Action,'RUN') && isequal(Data.Action.RUN,0) 35 35 prompt = {'npx';'npy';'threshold'}; 36 36 dlg_title = 'get the filter size in x and y'; … … 42 42 end 43 43 answer = inputdlg(prompt,dlg_title,num_lines,def); 44 Data Out.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window45 Data Out.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window46 Data Out.TransformInput.LumThreshold=str2num(answer{3}); %size of the filtering window44 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 47 47 return 48 48 end 49 49 50 DataOut=DataIn; %default51 %DataOut.A=255*edge(DataIn.A);52 50 53 51 %definition of the cos shape matrix filter … … 62 60 Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter 63 61 62 Afilt=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; 64 66 65 67 66 Afilt=filter2(Mfiltre,DataIn.A(100:end-100,100:end-100));% smooth the image, excluding the edges (spurious reflexions) 68 69 70 % 67 71 Amax=max(max(Afilt)); 68 72 Amin=min(min(Afilt)); 73 % Data.A( Data_1.A(100:end-100,100:end-100)==100)=(Amin+Amax)/2; 74 75 76 69 77 Athreshold=(Amin+Amax)*Param.TransformInput.LumThreshold; 70 78 % 71 % Data Out.A=zeros(size(DataIn.A,1),size(DataIn.A,2),3);72 Data Out.A=(DataIn.A>Athreshold);%transform to the initial image format73 % Data Out.A(:,:,1)=DataIn.A;%transform to the initial image format, red74 STATS = regionprops(Data Out.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 82 STATS = regionprops(Data.A, 'FilledArea','MinorAxisLength','MajorAxisLength','PixelIdxList'); 75 83 Area=zeros(size(STATS)); 76 84 for iobj=1:numel(STATS) 77 85 Area(iobj)=STATS(iobj).FilledArea; 78 86 end 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; 82 90 for iobj=1:numel(STATS) 83 91 if iobj~=main_obj 84 Data Out.A(STATS(iobj).PixelIdxList)=0;92 Data.A(STATS(iobj).PixelIdxList)=0; 85 93 end 86 94 end 87 95 88 Data Out.A=Amax*DataOut.A;96 Data.A=Amax*Data.A; 89 97 -
trunk/src/transform_field/ima_patch_detection.m
r924 r928 87 87 DataOut=DataIn; %default 88 88 %Amask=imread('/fsnet/project/coriolis/2015/15MINI_MEDDY/0_REF_FILES/mask_patch.png'); 89 plot_mask(DataIn.A,Param.TransformInput.LumThreshold) 89 hfig=findobj(allchild(0),'Tag','set_threshold'); 90 hThreshold=findobj(hfig,'Tag','Threshold'); 91 Threshold=str2num(get(hThreshold,'String')); 92 plot_mask(DataIn.A,Threshold) 90 93 % Athreshold=Param.TransformInput.LumThreshold; 91 94 % %
Note: See TracChangeset
for help on using the changeset viewer.