Changeset 483 for trunk/src/find_file_series.m
- Timestamp:
- Jun 26, 2012, 11:50:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_file_series.m
r472 r483 54 54 return % don't go further if the dir path does not exist 55 55 end 56 % NbFrame=1;57 % switch FileType58 % case 'multimage'59 % NbFrame=FileInfo.NumberOfFrames;60 % case {'video','mmreader'}61 % NomType='*';62 % NbFrame=FileInfo.NumberOfFrames;63 % end64 65 % RootFile_i='';66 56 NomTypePref=''; 67 if strcmp(NomType,'')||strcmp(NomType,'*')57 if isempty(NomType) 68 58 if exist(fullfileinput,'file') 69 59 [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing), get the filename without its extension … … 71 61 RootFile=''; 72 62 end 73 % i1_input=1;% the index now refer to the frame in the movie, choose 1 at opening74 % i2_input=[];75 % j1_input=[];76 % j2_input=[];77 63 else 78 64 %% possibly include the first index in the root name, if there exists a corresponding xml file … … 224 210 ref_ij=ref_i_list*max_j+ref_j_list; % ordered by index i, then by j for a given i. 225 211 end 226 %[tild,ifile_min]=min(ref_ij(ref_ij>0));227 212 ind_select=find(ref_ij>0); 228 213 if isempty(ind_select) 229 % RootPath='';230 214 RootFile=''; 231 215 NomType=''; … … 252 236 i1_series=(1:FileInfo.NumberOfFrames)'; 253 237 i1_input=1; 254 else 255 j1_series=(1:FileInfo.NumberOfFrames)'; 256 j1_input=1; 238 NomType='*'; 239 else 240 j1_series=(1:FileInfo.NumberOfFrames)'; 241 % include the first index in the root name 242 r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType 243 if ~isempty(r) 244 fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput 245 if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not detected 246 rr=regexp(fileinput_end,'^(?<i1>\d+)','names'); 247 else% if a separator '_' is detected 248 rr=regexp(fileinput_end,'^(?<i1>_\d+)','names'); 249 end 250 if ~isempty(rr) 251 RootFile=[RootFile rr.i1];% new root file 252 NomTypePref=r.tiretnum; 253 NomType=regexprep(NomType,['^' NomTypePref],''); 254 i1_input=j1_input; 255 i2_input=j2_input; 256 j1_input=1; 257 j2_input=[]; 258 end 259 end 257 260 end 258 261 end
Note: See TracChangeset
for help on using the changeset viewer.