[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 | %======================================================================= |
---|
[924] | 14 | % Copyright 2008-2016, 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] | 31 | function NomTypeOut=nomtype2pair(NomTypeIn) |
---|
[8] | 32 | |
---|
[595] | 33 | if ~isempty(regexp(NomTypeIn,'a$')) |
---|
| 34 | NomTypeOut=[NomTypeIn 'b']; |
---|
| 35 | elseif ~isempty(regexp(NomTypeIn,'A$')) |
---|
| 36 | NomTypeOut=[NomTypeIn 'B']; |
---|
| 37 | else |
---|
| 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] | 45 | end |
---|