Changeset 249 for trunk/src/series


Ignore:
Timestamp:
May 9, 2011, 12:33:08 AM (13 years ago)
Author:
sommeria
Message:

bug repaired in relabel_i_j (xml file no more corrupted)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/relabel_i_j.m

    r245 r249  
    2525end
    2626basename=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)
    2828if ~isempty(warntext)
    2929    msgbox_uvmat('ERROR',warntext)%error message for xml file reading
     
    6363if exist([basename '.xml'],'file')
    6464    try
    65     copyfile([basename '.xml'],[basename '.xml~']);% backup the xml file
     65        copyfile([basename '.xml'],[basename '.xml~']);% backup the xml file
    6666    catch ME
    67             msgbox_uvmat('ERROR',ME.message);
    68             return
     67        msgbox_uvmat('ERROR',ME.message);
     68        return
    6969    end
    7070    t=xmltree([basename '.xml']);
     
    7474    if isempty(uid_Heading)
    7575        [t,uid_Heading]=add(t,1,'element','Heading');
    76     end   
     76    end
    7777    uid_ImageName=find(t,'ImaDoc/Heading/ImageName');
    7878    ImageName=name_generator(basename,1,1,'.png','_i_j');
     
    8080    ImageName=[ImageName '.png'];
    8181    if isempty(uid_ImageName)
    82        [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName');
     82        [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName');
    8383    end
    8484    uid_value=children(t,uid_ImageName);
     
    9191    %%%% correction RDvision %%%%
    9292    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     end
     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        end
    9898    end
    9999    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     end
     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        end
    105105    end
    106106    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));
    107109        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
    112115        uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj');
    113116        uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk');
     
    117120        uid_Dtk=find(t,'ImaDoc/Camera/BurstTiming/Dtk');
    118121        t=delete(t,uid_Dtj);
    119         t=delete(t,uid_Dtk);   
     122        t=delete(t,uid_Dtk);
    120123    end
    121124    %%%
     
    139142            return
    140143        end
    141     catch
    142         errormsg=lasterr
    143         msgbox_uvmat('ERROR',errormsg);
     144    catch ME
     145        msgbox_uvmat('ERROR',ME.message);
    144146        return
    145147    end
     
    236238%                 s.NbDtj=NbDtj;
    237239%                 %%%%
    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);
    240242                 %%%% correction RDvision %%%%
    241243                if isempty(Dti)% series
    242                      Dti=Dtj
    243                       NbDti=NbDtj
     244                     Dti=Dtj;
     245                      NbDti=NbDtj;
    244246                     Dtj=[];
    245247                     s.Dti=Dti;
    246                      'TESTrxml'
    247                      s.NbDti=NbDti
    248248                else
    249249                     NbDtj=NbDtj/numel(Dtj);%bursts
Note: See TracChangeset for help on using the changeset viewer.