source: trunk/src/nomtype2pair.m @ 622

Last change on this file since 622 was 595, checked in by sommeria, 8 years ago

steps further to use series with cluster. Some bsolete functions removed

File size: 991 bytes
RevLine 
[595]1%'nomtype2pair': creates nomencalture 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.