Changeset 249
- Timestamp:
- May 9, 2011, 12:33:08 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/relabel_i_j.m
r245 r249 25 25 end 26 26 basename=fullfile(RootPath{1},RootFile{1}); 27 [XmlData,warntext]=imadoc2struct([basename '.xml']) % read the xml file appended to the present function (containing bug corrections)27 [XmlData,warntext]=imadoc2struct([basename '.xml']);% read the xml file appended to the present function (containing bug corrections) 28 28 if ~isempty(warntext) 29 29 msgbox_uvmat('ERROR',warntext)%error message for xml file reading … … 63 63 if exist([basename '.xml'],'file') 64 64 try 65 copyfile([basename '.xml'],[basename '.xml~']);% backup the xml file65 copyfile([basename '.xml'],[basename '.xml~']);% backup the xml file 66 66 catch ME 67 68 67 msgbox_uvmat('ERROR',ME.message); 68 return 69 69 end 70 70 t=xmltree([basename '.xml']); … … 74 74 if isempty(uid_Heading) 75 75 [t,uid_Heading]=add(t,1,'element','Heading'); 76 end 76 end 77 77 uid_ImageName=find(t,'ImaDoc/Heading/ImageName'); 78 78 ImageName=name_generator(basename,1,1,'.png','_i_j'); … … 80 80 ImageName=[ImageName '.png']; 81 81 if isempty(uid_ImageName) 82 [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName');82 [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName'); 83 83 end 84 84 uid_value=children(t,uid_ImageName); … … 91 91 %%%% correction RDvision %%%% 92 92 if isfield(XmlData,'NbDtj') 93 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj');94 uid_value=children(t,uid_NbDtj);95 if ~isempty(uid_value)96 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtj));97 end93 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 94 uid_value=children(t,uid_NbDtj); 95 if ~isempty(uid_value) 96 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtj)); 97 end 98 98 end 99 99 if isfield(XmlData,'NbDtk') 100 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk');101 uid_value=children(t,uid_NbDtk);102 if ~isempty(uid_value)103 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtk));104 end100 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); 101 uid_value=children(t,uid_NbDtk); 102 if ~isempty(uid_value) 103 t=set(t,uid_value(1),'value',num2str(XmlData.NbDtk)); 104 end 105 105 end 106 106 if strcmp(nomtype,'_i') && isfield(XmlData,'NbDti') 107 uid_Dti=find(t,'ImaDoc/Camera/BurstTiming/Dti'); 108 t=add(t,uid_Dti,'chardata',num2str(XmlData.Dti)); 107 109 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti'); 108 uid_value=children(t,uid_NbDti); 109 if ~isempty(uid_value) 110 t=set(t,uid_value(1),'value',num2str(XmlData.NbDti)); 111 end 110 t=add(t,uid_NbDti,'chardata',num2str(XmlData.NbDti)); 111 % uid_value=children(t,uid_NbDti); 112 % if ~isempty(uid_value) 113 % t=set(t,uid_value(1),'value',num2str(XmlData.NbDti)); 114 % end 112 115 uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj'); 113 116 uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk'); … … 117 120 uid_Dtk=find(t,'ImaDoc/Camera/BurstTiming/Dtk'); 118 121 t=delete(t,uid_Dtj); 119 t=delete(t,uid_Dtk); 122 t=delete(t,uid_Dtk); 120 123 end 121 124 %%% … … 139 142 return 140 143 end 141 catch 142 errormsg=lasterr 143 msgbox_uvmat('ERROR',errormsg); 144 catch ME 145 msgbox_uvmat('ERROR',ME.message); 144 146 return 145 147 end … … 236 238 % s.NbDtj=NbDtj; 237 239 % %%%% 238 Dti=get_value(subt,'/BurstTiming/Dti',[]) 239 NbDti=get_value(subt,'/BurstTiming/NbDti',1) 240 Dti=get_value(subt,'/BurstTiming/Dti',[]); 241 NbDti=get_value(subt,'/BurstTiming/NbDti',1); 240 242 %%%% correction RDvision %%%% 241 243 if isempty(Dti)% series 242 Dti=Dtj 243 NbDti=NbDtj 244 Dti=Dtj; 245 NbDti=NbDtj; 244 246 Dtj=[]; 245 247 s.Dti=Dti; 246 'TESTrxml'247 s.NbDti=NbDti248 248 else 249 249 NbDtj=NbDtj/numel(Dtj);%bursts
Note: See TracChangeset
for help on using the changeset viewer.