source: trunk/src/nomtype2pair.m @ 1109

Last change on this file since 1109 was 1107, checked in by g7moreau, 3 years ago

Update Copyright to 2022

File size: 1.8 KB
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
[809]13%=======================================================================
[1107]14% Copyright 2008-2022, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
[809]15%   http://www.legi.grenoble-inp.fr
16%   Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
17%
18%     This file is part of the toolbox UVMAT.
19%
20%     UVMAT is free software; you can redistribute it and/or modify
21%     it under the terms of the GNU General Public License as published
22%     by the Free Software Foundation; either version 2 of the license,
23%     or (at your option) any later version.
24%
25%     UVMAT is distributed in the hope that it will be useful,
26%     but WITHOUT ANY WARRANTY; without even the implied warranty of
27%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28%     GNU General Public License (see LICENSE.txt) for more details.
29%=======================================================================
30
[595]31function NomTypeOut=nomtype2pair(NomTypeIn)
[8]32
[595]33if ~isempty(regexp(NomTypeIn,'a$'))
34    NomTypeOut=[NomTypeIn 'b'];
35elseif ~isempty(regexp(NomTypeIn,'A$'))
36    NomTypeOut=[NomTypeIn 'B'];
37else
38    r=regexp(NomTypeIn,'(?<num1>\d+)_(?<num2>\d+)$','names');
39    % case of a single input index (no j)
40    if isempty(r)
41        NomTypeOut='_1-2';
42    else  % case of two indices i,j, separated by '_'
43        NomTypeOut='_1-2_1-2';
[107]44    end
[8]45end
Note: See TracBrowser for help on using the repository browser.