Changeset 795 for trunk/src/series
- Timestamp:
- Jul 7, 2014, 1:51:17 PM (10 years ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r784 r795 1485 1485 end 1486 1486 if testmask 1487 if strcmp(parent_tag,'Civ1')1487 % if strcmp(parent_tag,'Civ1') 1488 1488 set(handles.Mask,'Visible','on') 1489 1489 set(handles.Mask,'String',filemask) 1490 1490 set(handles.CheckMask,'Value',1) 1491 end1491 % end 1492 1492 else 1493 1493 set(hObject,'Value',0); -
trunk/src/series/extract_rdvision.m
r792 r795 76 76 RootFile=Param.InputTable(:,3); 77 77 SubDir=Param.InputTable(:,2); 78 NomType=Param.InputTable(:,4);79 78 FileExt=Param.InputTable(:,5); 80 79 … … 82 81 % input file or frame indices i1_series,i2_series,j1_series,j2_series 83 82 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 83 filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},'*',1); 84 OutputDir=[Param.OutputSubDir Param.OutputDirExt]; 84 85 85 86 % numbers of slices and file indices 86 87 87 nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 88 88 nbfield_i=size(i1_series{1},2); %nb of fields for the i index … … 94 94 % return 95 95 % end 96 FileInfo {1}=get_file_info(filecell{1,1});97 if ~strcmp(FileInfo {1}.FileType,'rdvision')96 FileInfo=get_file_info(filecell{1,1}); 97 if ~strcmp(FileInfo.FileType,'rdvision') 98 98 msgbox_uvmat('ERROR','the input is not from rdvision: a .seq or .sqb file must be opened') 99 99 return … … 124 124 end 125 125 126 126 127 %% check coincidence in time for several input file series 127 128 % not relevant … … 143 144 first_label=0; %image numbers start from 0 144 145 145 %% copy and adapt the xml file 146 NomTypeNew='_1_1'; 147 if ~isempty(XmlData) 148 t=xmltree(filexml); 149 150 %update information on the first image name in the series 151 uid_Heading=find(t,'ImaDoc/Heading'); 152 if isempty(uid_Heading) 153 [t,uid_Heading]=add(t,1,'element','Heading'); 154 end 155 uid_ImageName=find(t,'ImaDoc/Heading/ImageName'); 156 j1=[]; 157 if ~isempty(j1_series{1}) 158 j1=j1_series{1}; 159 end 160 ImageName=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},'_1_1',i1_series{1}(1),[],j1); 161 [pth,ImageName]=fileparts(ImageName); 162 ImageName=[ImageName '.png']; 163 if isempty(uid_ImageName) 164 [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName'); 165 end 166 uid_value=children(t,uid_ImageName); 167 if isempty(uid_value) 168 t=add(t,uid_ImageName,'chardata',ImageName);%indicate name of the first image, with ;png extension 169 else 170 t=set(t,uid_value(1),'value',ImageName);%indicate name of the first image, with ;png extension 171 end 172 173 %%%% correction RDvision %%%% 174 if isfield(XmlData,'NbDtj') 175 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 176 uid_value=children(t,uid_NbDtj); 177 if ~isempty(uid_value) 178 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtj)); 179 end 180 end 181 if isfield(XmlData,'NbDtk') 182 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); 183 uid_value=children(t,uid_NbDtk); 184 if ~isempty(uid_value) 185 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtk)); 186 end 187 end 188 if isempty(j1_series{1}) && isfield(XmlData,'NbDti') 189 uid_Dti=find(t,'ImaDoc/Camera/BurstTiming/Dti'); 190 t=add(t,uid_Dti,'chardata',num2str(XmlData.Dti)); 191 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti'); 192 t=add(t,uid_NbDti,'chardata',num2str(XmlData.NbDti)); 193 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 194 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); 195 t=delete(t,uid_NbDtj); 196 t=delete(t,uid_NbDtk); 197 uid_Dtj=find(t,'ImaDoc/Camera/BurstTiming/Dtj'); 198 uid_Dtk=find(t,'ImaDoc/Camera/BurstTiming/Dtk'); 199 t=delete(t,uid_Dtj); 200 t=delete(t,uid_Dtk); 201 NomTypeNew='_1'; 202 end 203 SubDirBase=regexprep(SubDir{1},'\..*','');%take the root part of SubDir, before the first dot '.' 204 % filexml_new=[fullfile(RootPath{1},SubDirBase) '.xml']; 205 save(t,filexml) 206 end 146 %% correction to RDvision xml file 147 t=xmltree(filexml); 148 149 % correct Dtj and Dtk 150 NomTypeNew='_1_1';% new file nomencalture by default 151 ImageName='img_1_1.png';% first image name 152 if isfield(XmlData,'NbDtj') 153 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 154 uid_value=children(t,uid_NbDtj); 155 if ~isempty(uid_value) 156 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtj)); 157 end 158 end 159 if isfield(XmlData,'NbDtk') 160 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); 161 uid_value=children(t,uid_NbDtk); 162 if ~isempty(uid_value) 163 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtk)); 164 end 165 end 166 if isempty(j1_series{1}) && isfield(XmlData,'NbDti') 167 uid_Dti=find(t,'ImaDoc/Camera/BurstTiming/Dti'); 168 t=add(t,uid_Dti,'chardata',num2str(XmlData.Dti)); 169 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti'); 170 t=add(t,uid_NbDti,'chardata',num2str(XmlData.NbDti)); 171 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 172 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); 173 t=delete(t,uid_NbDtj); 174 t=delete(t,uid_NbDtk); 175 uid_Dtj=find(t,'ImaDoc/Camera/BurstTiming/Dtj'); 176 uid_Dtk=find(t,'ImaDoc/Camera/BurstTiming/Dtk'); 177 t=delete(t,uid_Dtj); 178 t=delete(t,uid_Dtk); 179 NomTypeNew='_1'; 180 ImageName='img_1.png'; 181 end 182 183 %update information of 'Heading' 184 uid_Heading=find(t,'ImaDoc/Heading'); 185 if isempty(uid_Heading) 186 [t,uid_Heading]=add(t,1,'element','Heading'); 187 end 188 uid_SubCampaign=find(t,'ImaDoc/Heading/SubCampaign'); 189 if ~isempty(uid_SubCampaign), t=delete(t,uid_SubCampaign); end 190 uid_Experiment=find(t,'ImaDoc/Heading/Experiment'); 191 if ~isempty(uid_Experiment), t=delete(t,uid_Experiment); end 192 uid_Device=find(t,'ImaDoc/Heading/Device'); 193 if ~isempty(uid_Device), t=delete(t,uid_Device); end 194 uid_Record=find(t,'ImaDoc/Heading/Record'); 195 if ~isempty(uid_Record), t=delete(t,uid_Record); end 196 uid_DateExp=find(t,'ImaDoc/Heading/DateExp'); 197 if ~isempty(uid_DateExp), t=delete(t,uid_DateExp); end 198 199 %indicate the name of the first image (as a check that the xml file is not moved) 200 uid_ImageName=find(t,'ImaDoc/Heading/ImageName'); 201 if isempty(uid_ImageName) 202 [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName'); 203 end 204 uid_value=children(t,uid_ImageName); 205 if isempty(uid_value) 206 t=add(t,uid_ImageName,'chardata',ImageName);%indicate name of the first image, with ;png extension 207 else 208 t=set(t,uid_value(1),'value',ImageName);%indicate name of the first image, with ;png extension 209 end 210 211 %indicate the date and time of the image acquisition start 212 if isfield(FileInfo,'binrepertoire') && isfield(FileInfo,'starttime') 213 sep_pos=regexp(FileInfo.binrepertoire,'T'); 214 DateTime=FileInfo.starttime; 215 if ~isempty(sep_pos) 216 DateTime=[FileInfo.binrepertoire(1:sep_pos-1) ' ' DateTime]; 217 end 218 uid_DateTime=find(t,'ImaDoc/Heading/DateTime'); 219 if isempty(uid_DateTime) 220 [t,uid_DateTime]=add(t,uid_Heading,'element','DateTime'); 221 end 222 uid_value=children(t,uid_DateTime); 223 if isempty(uid_value) 224 t=add(t,uid_DateTime,'chardata',DateTime);%indicate name of the first image, with ;png extension 225 else 226 t=set(t,uid_value(1),'value',DateTime);%indicate name of the first image, with ;png extension 227 end 228 end 229 230 %% backup the previous xml file and save the corrected one 231 [success,message]=copyfile(filexml,[filexml '~']);%make backup 232 if success~=1 233 dips(['errror in xml file backup: ' message]); 234 return 235 end 236 save(t,filexml) 207 237 208 238 %% main loop on images 209 %j1=[];%default210 239 nbfield2=1; 211 240 if isfield(XmlData,'Time') 212 241 nbfield2=size(XmlData.Time,2); 213 242 end 214 filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},'*',1);215 OutputDir=[Param.OutputSubDir Param.OutputDirExt];216 243 for ifile=1:nbfield 217 244 update_waitbar(WaitbarHandle,ifile/nbfield)
Note: See TracChangeset
for help on using the changeset viewer.