Changeset 339 for trunk/src/fileparts_uvmat.m
- Timestamp:
- Dec 19, 2011, 10:12:56 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fileparts_uvmat.m
r334 r339 38 38 NomType=''; 39 39 40 41 42 40 %% display help and test function in the absence of input arument 43 41 if ~exist('FileInput','var') … … 47 45 end 48 46 47 %% default root name output 49 48 [RootPath,FileName,FileExt]=fileparts(FileInput); 50 RootFile=FileName;%default 51 % switch FileExt 52 % case '.avi' 53 % NomType='*'; 54 % return 55 % case {'.tif','.tiff'} 56 % if exist(FileInput,'file') 57 % info=iminfo(FileInput); 58 % if length(info)>1 59 % NomType='*'; 60 % return 61 % end 62 % end 63 % end 64 65 % \D not a digit 66 % \d digit 67 68 69 %% recursive test on FileName starting from the end 70 % case of pure number 49 RootFile=FileName; 50 51 %% case of input file name which is a pure number 71 52 if ~isnan(str2double(FileName)) 72 53 RootFile=''; … … 74 55 return 75 56 end 57 58 %% recursive test on FileName starting from the end 76 59 % test whether FileName ends with a number or not 77 60 r=regexp(FileName,'.*\D(?<num1>\d+)$','names');% \D = not a digit, \d =digit … … 141 124 i1=str2double(r.num1); 142 125 NomType=[get_type(r.num1) NomType]; 143 r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names');144 if ~isempty(r)145 SubDir=r.subdir;146 RootPath=r.newrootpath;147 end148 126 end 149 127 end … … 153 131 RootFile(end)=[]; 154 132 NomType=['_' NomType]; 133 end 134 135 %% extract subdirectory for pairs i1-i2 or j1-j2 (or ab, AB) 136 if ~isempty(i2) || ~isempty(j2) 137 r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names'); 138 if ~isempty(r) 139 SubDir=r.subdir; 140 RootPath=r.newrootpath; 141 end 155 142 end 156 143 … … 162 149 % end 163 150 % end 164 165 166 151 167 152
Note: See TracChangeset
for help on using the changeset viewer.