'nomtype2pair': creates nomencalture for index pairs. --------------------------------------------------------------------- [nom_type_nc]=nomtype2pair(nom_type); --------------------------------------------------------------------- This function detects the existence the constructed file name and it can find indices according to file existence if they are not specified %rmq: this function is related to the reverse functions display2name and name2diplay --------------------------------------------------------------------- OUTPUT: nom_type_nc
0001 %'nomtype2pair': creates nomencalture for index pairs. 0002 %--------------------------------------------------------------------- 0003 % [nom_type_nc]=nomtype2pair(nom_type); 0004 %--------------------------------------------------------------------- 0005 % This function detects the existence the constructed file name and it can 0006 % find indices according to file existence if they are not specified 0007 %%rmq: this function is related to the reverse functions display2name and name2diplay 0008 %--------------------------------------------------------------------- 0009 % OUTPUT: 0010 %nom_type_nc 0011 0012 %--------------------------------------------------------------------- 0013 % INPUT: 0014 % 'nom_type': string defining the kind of nomenclature used: 0015 %nom_type='': constant name [filebase ext] (default output if 'nom_type' is undefined) 0016 %nom_type='*': the same file [filebase ext] contains successive fields (ex avi movies) 0017 %nom_type='_i': series of files with a single index i preceded by '_'(e.g. 'aa_45.png'). 0018 %nom_type='#' series of indexed images wich is not series_i [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif' 0019 %nom_type='_i_j' matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png') 0020 %nom_type='_i1-i2' from pairs from a single index (e.g. 'aa_45-47.nc') 0021 %nom_type='_i_j1-j2'pairs of j indices (e.g. 'aa_45_2-3.nc') 0022 %nom_type='_i1-i2_j' pairs of i indices (e.g. 'aa_45-46_2.nc') 0023 %nom_type='#a','#A', with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j') 0024 %nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif' 0025 %nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif' 0026 %nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE 0027 %nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D') 0028 %nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D') 0029 % Dti: ~=0 if i index pairs are used 0030 % Dtj: ~=0 if i index pairs are used 0031 0032 function [nom_type_pair]=nomtype2pair(nom_type,Dti,Dtj); 0033 0034 %determine nom_type_nc: 0035 nom_type_nc=[];%default 0036 switch nom_type 0037 case {'_i_j'} 0038 if Dtj>0 || Dtj<0 0039 nom_type_pair='_i_j1-j2'; 0040 if Dti>0 || Dti<0 0041 nom_type_pair='_i1-i2_j1-j2'; 0042 end 0043 elseif Dti>0 || Dti<0 0044 nom_type_pair='_i1-i21_j'; 0045 else 0046 nom_type_pair='_i_j'; 0047 end 0048 case {'_i1-i2_j'} 0049 if Dtj>0 || Dtj<0 0050 nom_type_pair='_i1-i2_j1-j2'; 0051 else 0052 nom_type_pair='_i1-i2_j'; 0053 end 0054 case {'i_j1-j2'} 0055 if Dti>0 || Dti<0 0056 nom_type_pair='_i1-i2_j1-j2'; 0057 else 0058 nom_type_pair='_i1-i2_j'; 0059 end 0060 case {'i1-i2_j1-j2'} 0061 nom_type_pair='_i1-i2_j1-j2'; 0062 case '#a' 0063 if Dtj>0 || Dtj<0 0064 nom_type_pair='#_ab'; 0065 end 0066 otherwise 0067 if Dti>0 || Dti<0 0068 nom_type_pair='_i1-i2'; 0069 end 0070 end