[8] | 1 | %'nomtype2pair': creates nomencalture for index pairs. |
---|
| 2 | %--------------------------------------------------------------------- |
---|
| 3 | % [nom_type_nc]=nomtype2pair(nom_type); |
---|
| 4 | %--------------------------------------------------------------------- |
---|
| 5 | % This function detects the existence the constructed file name and it can |
---|
| 6 | % find indices according to file existence if they are not specified |
---|
| 7 | %%rmq: this function is related to the reverse functions display2name and name2diplay |
---|
| 8 | %--------------------------------------------------------------------- |
---|
| 9 | % OUTPUT: |
---|
| 10 | %nom_type_nc |
---|
| 11 | |
---|
| 12 | %--------------------------------------------------------------------- |
---|
| 13 | % INPUT: |
---|
| 14 | % 'nom_type': string defining the kind of nomenclature used: |
---|
| 15 | %nom_type='': constant name [filebase ext] (default output if 'nom_type' is undefined) |
---|
| 16 | %nom_type='*': the same file [filebase ext] contains successive fields (ex avi movies) |
---|
| 17 | %nom_type='_i': series of files with a single index i preceded by '_'(e.g. 'aa_45.png'). |
---|
| 18 | %nom_type='#' series of indexed images wich is not series_i [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif' |
---|
| 19 | %nom_type='_i_j' matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png') |
---|
| 20 | %nom_type='_i1-i2' from pairs from a single index (e.g. 'aa_45-47.nc') |
---|
| 21 | %nom_type='_i_j1-j2'pairs of j indices (e.g. 'aa_45_2-3.nc') |
---|
| 22 | %nom_type='_i1-i2_j' pairs of i indices (e.g. 'aa_45-46_2.nc') |
---|
| 23 | %nom_type='#a','#A', with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j') |
---|
| 24 | %nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif' |
---|
| 25 | %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' |
---|
| 26 | %nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE |
---|
| 27 | %nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D') |
---|
| 28 | %nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D') |
---|
| 29 | % Dti: ~=0 if i index pairs are used |
---|
| 30 | % Dtj: ~=0 if i index pairs are used |
---|
| 31 | |
---|
[29] | 32 | function [nom_type_pair]=nomtype2pair(nom_type,Dti,Dtj) |
---|
[8] | 33 | |
---|
| 34 | %determine nom_type_nc: |
---|
[29] | 35 | nom_type_pair=[];%default |
---|
[8] | 36 | switch nom_type |
---|
| 37 | case {'_i_j'} |
---|
| 38 | if Dtj>0 || Dtj<0 |
---|
| 39 | nom_type_pair='_i_j1-j2'; |
---|
| 40 | if Dti>0 || Dti<0 |
---|
| 41 | nom_type_pair='_i1-i2_j1-j2'; |
---|
| 42 | end |
---|
| 43 | elseif Dti>0 || Dti<0 |
---|
| 44 | nom_type_pair='_i1-i21_j'; |
---|
| 45 | else |
---|
| 46 | nom_type_pair='_i_j'; |
---|
| 47 | end |
---|
| 48 | case {'_i1-i2_j'} |
---|
| 49 | if Dtj>0 || Dtj<0 |
---|
| 50 | nom_type_pair='_i1-i2_j1-j2'; |
---|
| 51 | else |
---|
| 52 | nom_type_pair='_i1-i2_j'; |
---|
| 53 | end |
---|
| 54 | case {'i_j1-j2'} |
---|
| 55 | if Dti>0 || Dti<0 |
---|
| 56 | nom_type_pair='_i1-i2_j1-j2'; |
---|
| 57 | else |
---|
| 58 | nom_type_pair='_i1-i2_j'; |
---|
| 59 | end |
---|
| 60 | case {'i1-i2_j1-j2'} |
---|
| 61 | nom_type_pair='_i1-i2_j1-j2'; |
---|
| 62 | case '#a' |
---|
| 63 | if Dtj>0 || Dtj<0 |
---|
| 64 | nom_type_pair='#_ab'; |
---|
| 65 | end |
---|
| 66 | otherwise |
---|
| 67 | if Dti>0 || Dti<0 |
---|
| 68 | nom_type_pair='_i1-i2'; |
---|
| 69 | end |
---|
| 70 | end |
---|