source: trunk/src/nomtype2pair.m @ 751

Last change on this file since 751 was 646, checked in by sommeria, 12 years ago

various update, bugs to be expected

File size: 991 bytes
Line 
1%'nomtype2pair': creates nomenclature for index pairs knowing the image nomenclature, used by series fct
2%---------------------------------------------------------------------
3% NomTypeOut=nomtype2pair(NomTypeIn)
4%---------------------------------------------------------------------           
5% OUTPUT:
6% NomTypeOut: file index nomenclature for pairs
7%---------------------------------------------------------------------
8% INPUT:
9% NomTypeIn: file index nomenclature for images
10%
11% for definitions of file index nomenclature, see fct fullfile_uvmat
12
13function NomTypeOut=nomtype2pair(NomTypeIn)
14
15if ~isempty(regexp(NomTypeIn,'a$'))
16    NomTypeOut=[NomTypeIn 'b'];
17elseif ~isempty(regexp(NomTypeIn,'A$'))
18    NomTypeOut=[NomTypeIn 'B'];
19else
20    r=regexp(NomTypeIn,'(?<num1>\d+)_(?<num2>\d+)$','names');
21    % case of a single input index (no j)
22    if isempty(r)
23        NomTypeOut='_1-2';
24    else  % case of two indices i,j, separated by '_'
25        NomTypeOut='_1-2_1-2';
26    end
27end
Note: See TracBrowser for help on using the repository browser.