Ignore:
Timestamp:
Dec 19, 2011, 10:12:56 AM (12 years ago)
Author:
sommeria
Message:

name2display replaced by fileparts_uvmat and find_file_series in series.
name2display partially replaced in civ.m (to be continued)
series.fig reorganized with panels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fileparts_uvmat.m

    r334 r339  
    3838NomType='';
    3939
    40 
    41 
    4240%% display help and test function in the absence of input arument
    4341if ~exist('FileInput','var')
     
    4745end
    4846
     47%% default root name output
    4948[RootPath,FileName,FileExt]=fileparts(FileInput);
    50 RootFile=FileName;%default
    51 % switch FileExt
    52 %     case '.avi'
    53 %         NomType='*';
    54 %         return
    55 %     case {'.tif','.tiff'}
    56 %         if exist(FileInput,'file')
    57 %             info=iminfo(FileInput);
    58 %             if length(info)>1
    59 %                 NomType='*';
    60 %                 return
    61 %             end
    62 %         end
    63 % end
    64 
    65 % \D not a digit
    66 % \d digit
    67 
    68 
    69 %% recursive test on FileName starting from the end
    70 % case of pure number
     49RootFile=FileName;
     50
     51%% case of input file name which is a pure number
    7152if ~isnan(str2double(FileName))
    7253    RootFile='';
     
    7455    return
    7556end
     57
     58%% recursive test on FileName starting from the end
    7659% test whether FileName ends with a number or not
    7760r=regexp(FileName,'.*\D(?<num1>\d+)$','names');% \D = not a digit, \d =digit
     
    141124        i1=str2double(r.num1);
    142125        NomType=[get_type(r.num1) NomType];
    143         r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names');
    144         if ~isempty(r)
    145             SubDir=r.subdir;
    146             RootPath=r.newrootpath;
    147         end
    148126    end
    149127end
     
    153131    RootFile(end)=[];
    154132    NomType=['_' NomType];
     133end
     134
     135%% extract subdirectory for pairs i1-i2 or j1-j2 (or ab, AB)
     136if ~isempty(i2) || ~isempty(j2)
     137    r=regexp(RootPath,'\<(?<newrootpath>.+)(\\|/)(?<subdir>[^\\^/]+)(\\|/)*\>','names');
     138    if ~isempty(r)
     139        SubDir=r.subdir;
     140        RootPath=r.newrootpath;
     141    end
    155142end
    156143
     
    162149%     end
    163150% end
    164 
    165 
    166151
    167152
Note: See TracChangeset for help on using the changeset viewer.