source: trunk/src/nomtype2pair.m @ 662

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

various update, bugs to be expected

File size: 991 bytes
RevLine 
[646]1%'nomtype2pair': creates nomenclature for index pairs knowing the image nomenclature, used by series fct
[8]2%---------------------------------------------------------------------
[595]3% NomTypeOut=nomtype2pair(NomTypeIn)
[8]4%---------------------------------------------------------------------           
5% OUTPUT:
[595]6% NomTypeOut: file index nomenclature for pairs
[8]7%---------------------------------------------------------------------
8% INPUT:
[595]9% NomTypeIn: file index nomenclature for images
10%
11% for definitions of file index nomenclature, see fct fullfile_uvmat
[8]12
[595]13function NomTypeOut=nomtype2pair(NomTypeIn)
[8]14
[595]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';
[107]26    end
[8]27end
Note: See TracBrowser for help on using the repository browser.