Ignore:
Timestamp:
Apr 6, 2016, 10:35:30 PM (8 years ago)
Author:
sommeria
Message:

extract corrected and merge_proj_polar added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/extract_multitif.m

    r931 r939  
    6565    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6666    ParamOut.WholeIndexRange='on';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    67     ParamOut.NbSlice='on'; % edit box nbre of slices made active
     67    ParamOut.NbSlice=1; % impose calculation in a single process (no parallel processing to avoid 'holes'))
    6868    ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6969    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    8787    if ~exist(FirstFileName,'file')
    8888        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
    89     else
    90         [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,PairString);
    91         LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
    92         Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
    93         if ~exist(FirstFileName,'file')
    94              msgbox_uvmat('WARNING',['the last input file ' LastFileName ' does not exist'])
    95         end
    9689    end
    9790
    9891    %% check the validity of  input file types
    99     ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
    10092    FileInfo=get_file_info(FirstFileName);
    101     FileType=FileInfo.FileType;
    102     CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images
    103     if ~CheckImage
    104         msgbox_uvmat('ERROR',['invalid file type input: ' FileType ' not an image'])
     93    if ~strcmp(FileInfo.FileType,'multimage')
     94        msgbox_uvmat('ERROR',['invalid file type input: ' FileInfo.FileType ' not an image'])
    10595        return
    10696    end
     97    xmlinput=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml');
     98    [tild,ParamOut.ActionInput.XmlFile]=fileparts(xmlinput);
     99    ParamOut.ActionInput.XmlFile
    107100   
    108101    return
     
    131124ListFile=ListCells(1,find(~check_dir & ~check_bad));
    132125
    133 % %% create the netcdf file with name flname in format NETCDF4
     126%% check file names
     127RootName=regexprep(ListFile{1},'.tif$','')
     128for ilist=2:numel(ListFile)
     129    rank=regexprep(ListFile{ilist},'.tif$','');
     130    rank=regexprep(rank,['^' RootName '@'],'');
     131    if ~isequal(str2num(rank),ilist-1)
     132        disp('error in the list of input files')
     133        return
     134    end
     135end
     136
     137%% output directory
    134138 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]);
    135139 
    136 % cmode = netcdf.getConstant('NETCDF4');
    137 % cmode = bitor(cmode, netcdf.getConstant('CLASSIC_MODEL'));
    138 % cmode = bitor(cmode, netcdf.getConstant('CLOBBER'));
    139 % nc = netcdf.create(fullfile(OutputDir,'images.nc'), cmode);
     140%% Timing
     141XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml'])
     142XmlInput=imadoc2struct(XmlInputFile,'Camera');
    140143
    141144%% Main loop
    142 ImagesPerLevel=100;%100;
     145
     146ImagesPerLevel=size(XmlInput.Time,2)-1;%100;
    143147count=0;
    144148%count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
     
    158162
    159163        if isequal(ImagesPerLevel,1)% mode series
    160            
     164            i_index=count+1;
    161165            OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
    162         else % mode multilevel or volume (indices i and j)
     166        else % indices i and j
    163167            i_index=fix(count/ImagesPerLevel)+1;
    164168            j_index=mod(count,ImagesPerLevel)+1;
     
    170174end
    171175
     176%% create the xml file of PCO camera
     177XmlInput.Camera.CameraName='PCO';
     178t=struct2xml(XmlInput.Camera);
     179t=set(t,1,'name','ImaDoc');
     180save(fullfile(Param.InputTable{1,1},'PCO.xml'),t)
    172181
     182%% remove initial files if transfer OK
     183    if i_index== (size(XmlInput.Time,1)-1)
     184
     185        [SUCCESS,MESSAGE]=rmdir(DirImages,'s')
     186       
     187    end
Note: See TracChangeset for help on using the changeset viewer.