Changeset 207 for trunk/src/imadoc2struct.m
- Timestamp:
- Feb 27, 2011, 10:41:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/imadoc2struct.m
r197 r207 117 117 if length(uid_subtree)==1 118 118 subt=branch(t,uid_subtree);%subtree under GeometryCalib 119 [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1]) 119 [s.TranslationMotor,errormsg]=read_subtree(subt,{'Nbslice','ZStart','ZEnd'},[1 1 1],[1 1 1]); 120 120 end 121 121 end … … 207 207 tsai.SliceCoord=ones(NbSlice,1)*tsai.SliceCoord+DZ*(0:NbSlice-1)'*[0 0 1]; 208 208 end 209 end 210 uid_VolumeScan=find(subt,'/GeometryCalib/VolumeScan'); 211 if ~isempty(uid_VolumeScan) 212 tsai.VolumeScan=get(subt,children(subt,uid_VolumeScan),'value'); 213 end 214 tsai.InterfaceCoord=get_value(subt,'/GeometryCalib/InterfaceCoord',[0 0 0]) 215 tsai.RefractionIndex=get_value(subt,'/GeometryCalib/RefractionIndex',1) 209 end 210 tsai.SliceAngle=get_value(subt,'/GeometryCalib/SliceAngle',[0 0 0]); 211 tsai.VolumeScan=get_value(subt,'/GeometryCalib/VolumeScan','n'); 212 tsai.InterfaceCoord=get_value(subt,'/GeometryCalib/InterfaceCoord',[0 0 0]); 213 tsai.RefractionIndex=get_value(subt,'/GeometryCalib/RefractionIndex',1); 216 214 217 215 if strcmp(option,'GeometryCalib') … … 236 234 s=[];%default 237 235 errormsg=''; 238 head_element=get(subt,1,'name') 236 head_element=get(subt,1,'name'); 239 237 cont=get(subt,1,'contents'); 240 238 if ~isempty(cont) 241 239 for ilist=1:length(Data) 242 uid_key=find(subt,[head_element '/' Data{ilist}]) 240 uid_key=find(subt,[head_element '/' Data{ilist}]); 243 241 if ~isequal(length(uid_key),NbOccur(ilist)) 244 errormsg=['wrong number of occurence for ' Data{ilist}] 242 errormsg=['wrong number of occurence for ' Data{ilist}]; 245 243 return 246 244 end 247 245 for ival=1:length(uid_key) 248 val=get(subt,children(subt,uid_key(ival)),'value') 246 val=get(subt,children(subt,uid_key(ival)),'value'); 249 247 if ~NumTest(ilist) 250 248 eval(['s.' Data{ilist} '=val;']); … … 279 277 if ~isempty(val_read) 280 278 val=val_read; 279 else 280 val=get(t,uid_child,'value');%char string data 281 281 end 282 282 end
Note: See TracChangeset
for help on using the changeset viewer.