Changeset 972 for trunk/src/series/extract_multitif.m
- Timestamp:
- Nov 15, 2016, 5:22:14 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/extract_multitif.m
r971 r972 59 59 %======================================================================= 60 60 61 function ParamOut= ima2netcdf(Param)61 function ParamOut=extract_multitif(Param) 62 62 63 63 %%%%%%%%%%%%%%%%% INPUT PREPARATION MODE (no RUN) %%%%%%%%%%%%%%%%% … … 73 73 ParamOut.OutputDirExt='.png';%set the output dir extension 74 74 ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice 75 75 ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 76 76 %% root input file(s) and type 77 77 % check the existence of the first file in the series … … 148 148 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 149 149 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images 150 %% loop on the files 150 %% loop on the files 151 151 for ifile=1:numel(ListFile) 152 152 update_waitbar(WaitbarHandle,ifile/numel(ListFile)) … … 158 158 NbFrames=numel(imfinfo(ImageName)); 159 159 % loop on the frames within the tiff file 160 for iframe=1:NbFrames 161 A=imread(ImageName,iframe); 162 163 if isequal(ImagesPerLevel,1)% mode series 160 for iframe=1:NbFrames 161 if isequal(ImagesPerLevel,1)% mode series 164 162 i_index=count+1; 165 163 OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 166 else % indices i and j 164 else % indices i and j 167 165 i_index=fix(count/ImagesPerLevel)+1; 168 166 j_index=mod(count,ImagesPerLevel)+1; 169 167 OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 170 168 end 171 imwrite(A,OutputFile,'BitDepth',16) 169 if Param.CheckOverwrite ||~exist(OutputFile,'file') 170 A=imread(ImageName,iframe); 171 imwrite(A,OutputFile,'BitDepth',16); 172 disp([OutputFile ' written']) 173 else 174 disp([OutputFile ' already exists']) 175 end 172 176 count=count+1; 173 177 end 174 178 end 179 180 % for ifile=1:numel(ListFile) 181 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 182 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 183 % disp('program stopped by user') 184 % break 185 % end 186 % ImageName=fullfile(DirImages,ListFile{ifile}); 187 % NbFrames=numel(imfinfo(ImageName)); 188 % % loop on the frames within the tiff file 189 % for iframe=1:NbFrames 190 % A=imread(ImageName,iframe); 191 % 192 % if isequal(ImagesPerLevel,1)% mode series 193 % i_index=count+1; 194 % OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 195 % else % indices i and j 196 % i_index=fix(count/ImagesPerLevel)+1; 197 % j_index=mod(count,ImagesPerLevel)+1; 198 % OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 199 % end 200 % imwrite(A,OutputFile,'BitDepth',16) 201 % count=count+1; 202 % end 203 % end 175 204 176 205 %% create the xml file of PCO camera … … 181 210 182 211 %% remove initial files if transfer OK 183 if i_index== (size(XmlInput.Time,1)-1)184 185 [SUCCESS,MESSAGE]=rmdir(DirImages,'s')186 187 end212 % if i_index== (size(XmlInput.Time,1)-1) 213 % 214 % [SUCCESS,MESSAGE]=rmdir(DirImages,'s') 215 % 216 % end
Note: See TracChangeset
for help on using the changeset viewer.