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