Changeset 939 for trunk/src/series/extract_multitif.m
- Timestamp:
- Apr 6, 2016, 10:35:30 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/extract_multitif.m
r931 r939 65 65 ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 66 66 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 active67 ParamOut.NbSlice=1; % impose calculation in a single process (no parallel processing to avoid 'holes')) 68 68 ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 69 69 ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) … … 87 87 if ~exist(FirstFileName,'file') 88 88 msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist']) 89 else90 [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 end96 89 end 97 90 98 91 %% check the validity of input file types 99 ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)100 92 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']) 105 95 return 106 96 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 107 100 108 101 return … … 131 124 ListFile=ListCells(1,find(~check_dir & ~check_bad)); 132 125 133 % %% create the netcdf file with name flname in format NETCDF4 126 %% check file names 127 RootName=regexprep(ListFile{1},'.tif$','') 128 for 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 135 end 136 137 %% output directory 134 138 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]); 135 139 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 141 XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml']) 142 XmlInput=imadoc2struct(XmlInputFile,'Camera'); 140 143 141 144 %% Main loop 142 ImagesPerLevel=100;%100; 145 146 ImagesPerLevel=size(XmlInput.Time,2)-1;%100; 143 147 count=0; 144 148 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 … … 158 162 159 163 if isequal(ImagesPerLevel,1)% mode series 160 164 i_index=count+1; 161 165 OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 162 else % mode multilevel or volume (indices i and j)166 else % indices i and j 163 167 i_index=fix(count/ImagesPerLevel)+1; 164 168 j_index=mod(count,ImagesPerLevel)+1; … … 170 174 end 171 175 176 %% create the xml file of PCO camera 177 XmlInput.Camera.CameraName='PCO'; 178 t=struct2xml(XmlInput.Camera); 179 t=set(t,1,'name','ImaDoc'); 180 save(fullfile(Param.InputTable{1,1},'PCO.xml'),t) 172 181 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.