Ignore:
Timestamp:
Feb 27, 2011, 10:41:07 PM (13 years ago)
Author:
sommeria
Message:

bug fixes to deal with volumes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/imadoc2struct.m

    r197 r207  
    117117    if length(uid_subtree)==1
    118118        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]);
    120120    end
    121121end
     
    207207                    tsai.SliceCoord=ones(NbSlice,1)*tsai.SliceCoord+DZ*(0:NbSlice-1)'*[0 0 1];
    208208                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);
    216214           
    217215            if strcmp(option,'GeometryCalib')
     
    236234s=[];%default
    237235errormsg='';
    238 head_element=get(subt,1,'name')
     236head_element=get(subt,1,'name');
    239237    cont=get(subt,1,'contents');
    240238    if ~isempty(cont)
    241239        for ilist=1:length(Data)
    242             uid_key=find(subt,[head_element '/' Data{ilist}])
     240            uid_key=find(subt,[head_element '/' Data{ilist}]);
    243241            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}];
    245243                return
    246244            end
    247245            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');
    249247                if ~NumTest(ilist)
    250248                    eval(['s.' Data{ilist} '=val;']);
     
    279277           if ~isempty(val_read)
    280278               val=val_read;
     279           else
     280              val=get(t,uid_child,'value');%char string data
    281281           end
    282282       end
Note: See TracChangeset for help on using the changeset viewer.