Changeset 993 for trunk/src/series/extract_multitif_parallel.m
- Timestamp:
- Feb 6, 2017, 11:29:01 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/extract_multitif_parallel.m
r991 r993 95 95 return 96 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 100 97 ParamOut.ActionInput.XmlFile=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml'); 101 98 return 102 99 end … … 140 137 141 138 %% Timing 142 XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml']) 143 XmlInput=imadoc2struct(XmlInputFile,'Camera'); 144 145 %% create the xml file of PCO camera 139 XmlInputFile=Param.ActionInput.XmlFile; 140 [XmlInput,errormsg]=imadoc2struct(XmlInputFile,'Camera'); 141 if ~isempty(errormsg) 142 disp(['bad xml input file: ' errormsg]) 143 return 144 end 145 ImagesPerLevel=size(XmlInput.Time,2)-1;%100;%use the xmlinformation to get the nbre of j indices 146 147 %% create the xml file of PCO camera if it does not exist 148 Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']); 149 if ~exist(Newxml,'file') 146 150 XmlInput.Camera.CameraName='PCO'; 147 t=struct2xml(XmlInput.Camera); 151 XmlInput=rmfield(XmlInput,'Time'); 152 XmlInput=rmfield(XmlInput,'TimeUnit'); 153 t=struct2xml(XmlInput); 148 154 t=set(t,1,'name','ImaDoc'); 149 save(t,fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml'])) 155 save(t,Newxml); 156 end 150 157 151 158 %% Main loop 152 159 153 ImagesPerLevel=size(XmlInput.Time,2)-1;%100; 160 154 161 % count=0; 155 162 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 156 163 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images 157 164 %% loop on the files 158 %for ifile=1:numel(ListFile) 159 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 160 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 161 % disp('program stopped by user') 162 % break 163 % end 164 % ImageName=fullfile(DirImages,ListFile{ifile}); 165 % NbFrames=numel(imfinfo(ImageName)); 166 % loop on the frames within the tiff file 165 % include the first tiff file with no index in the first iteration 167 166 if Param.IndexRange.first_i==1% first slice of processing 168 167 firstindex=0; 169 168 count=0; 170 % count=3;171 169 else 172 170 firstindex=Param.IndexRange.first_i; … … 174 172 NbFrames=numel(imfinfo(ImageName)); 175 173 count=Param.IndexRange.first_i*NbFrames; 176 % count=Param.IndexRange.first_i*NbFrames+3;177 174 end 178 175 for ifile=firstindex:Param.IndexRange.last_i 179 176 if firstindex==0 && ifile==0% first slice of processing 180 177 ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif') 181 178 else 182 179 ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},['im@' num2str(ifile,'%04d') '.tif']) … … 202 199 end 203 200 end 204 %end 205 206 % for ifile=1:numel(ListFile) 207 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 208 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 209 % disp('program stopped by user') 210 % break 211 % end 212 % ImageName=fullfile(DirImages,ListFile{ifile}); 213 % NbFrames=numel(imfinfo(ImageName)); 214 % % loop on the frames within the tiff file 215 % for iframe=1:NbFrames 216 % A=imread(ImageName,iframe); 217 % 218 % if isequal(ImagesPerLevel,1)% mode series 219 % i_index=count+1; 220 % OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 221 % else % indices i and j 222 % i_index=fix(count/ImagesPerLevel)+1; 223 % j_index=mod(count,ImagesPerLevel)+1; 224 % OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 225 % end 226 % imwrite(A,OutputFile,'BitDepth',16) 227 % count=count+1; 228 % end 229 % end 230 231 %% create the xml file of PCO camera 232 % XmlInput.Camera.CameraName='PCO'; 233 % t=struct2xml(XmlInput.Camera); 234 % t=set(t,1,'name','ImaDoc'); 235 % save(t,fullfile(Param.InputTable{1,1},'PCO.xml')) 236 237 %% remove initial files if transfer OK 238 % if i_index== (size(XmlInput.Time,1)-1) 239 % 240 % [SUCCESS,MESSAGE]=rmdir(DirImages,'s') 241 % 242 % end 201 202 203
Note: See TracChangeset
for help on using the changeset viewer.