Changeset 356 for trunk/src/civ.m


Ignore:
Timestamp:
Jan 3, 2012, 12:58:52 AM (12 years ago)
Author:
sommeria
Message:

civ updated with new functions for opening files, consistently with uvmat
Bugs to be expected (use previous version then)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r355 r356  
    46464646    end
    46474647end
     4648%'nomtype2pair': creates nomencalture for index pairs knowing the image nomenclature
     4649%---------------------------------------------------------------------
     4650% [nom_type_pair]=nomtype2pair(nom_type,Dti,Dtj);
     4651%---------------------------------------------------------------------           
     4652
     4653% OUTPUT:
     4654%nom_type_nc
     4655
     4656%---------------------------------------------------------------------
     4657% INPUT:
     4658% 'nom_type': string defining the kind of nomenclature used:
     4659     %nom_type='': constant name [filebase ext] (default output if 'nom_type' is undefined)
     4660     %nom_type='*': the same  file [filebase ext] contains successive fields (ex avi movies)
     4661     %nom_type='_i': series of files with a single index i preceded by '_'(e.g. 'aa_45.png').
     4662     %nom_type='#' series of indexed images wich is not series_i [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif'
     4663     %nom_type='_i_j' matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png')
     4664     %nom_type='_i1-i2' from pairs from a single index (e.g. 'aa_45-47.nc')
     4665     %nom_type='_i_j1-j2'pairs of j indices (e.g. 'aa_45_2-3.nc')
     4666     %nom_type='_i1-i2_j' pairs of i indices (e.g. 'aa_45-46_2.nc')
     4667     %nom_type='#a','#A', with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j')
     4668     %nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif'
     4669     %nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif'
     4670     %nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE
     4671     %nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
     4672     %nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
     4673% Dti: ~=0 if i index pairs are used
     4674% Dtj: ~=0 if i index pairs are used
     4675
     4676function [nom_type_pair]=nomtype2pair(nom_type,Dti,Dtj)
     4677
     4678%determine nom_type_nc:
     4679nom_type_pair=[];%default
     4680if ischar(nom_type)
     4681    switch nom_type
     4682        case {'_i_j'}
     4683            if Dtj>0 || Dtj<0
     4684                nom_type_pair='_i_j1-j2';
     4685                if Dti>0 || Dti<0
     4686                    nom_type_pair='_i1-i2_j1-j2';
     4687                end
     4688                elseif Dti>0 || Dti<0
     4689                nom_type_pair='_i1-i21_j';   
     4690            else
     4691                 nom_type_pair='_i_j';
     4692            end
     4693        case {'_i1-i2_j'}
     4694            if Dtj>0 || Dtj<0
     4695               nom_type_pair='_i1-i2_j1-j2';
     4696            else
     4697                nom_type_pair='_i1-i2_j';
     4698            end
     4699        case {'i_j1-j2'}
     4700            if Dti>0 || Dti<0
     4701               nom_type_pair='_i1-i2_j1-j2';
     4702            else
     4703                nom_type_pair='_i1-i2_j';
     4704            end
     4705        case {'i1-i2_j1-j2'}
     4706             nom_type_pair='_i1-i2_j1-j2';
     4707        case '#a'
     4708            if Dtj>0 || Dtj<0
     4709                nom_type_pair='#_ab';
     4710            end
     4711        otherwise
     4712            if Dti>0 || Dti<0
     4713               nom_type_pair='_i1-i2';
     4714            end
     4715    end
     4716end
     4717
Note: See TracChangeset for help on using the changeset viewer.