Changeset 223


Ignore:
Timestamp:
Mar 17, 2011, 8:21:26 PM (14 years ago)
Author:
sommeria
Message:

bug corrected: update the xml file

File:
1 edited

Legend:

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

    r216 r223  
     1
    12% relabel_i_j: relabel an image series with two indices, and correct errors from the RDvision transfer program
    23%----------------------------------------------------------------------
     
    1415%% PARAMETERS (for RDvision system)
    1516display('RDvision system')
    16 first_label=0 %image numbers start from 0
     17first_label=0; %image numbers start from 0
    1718%errorfactor=1 %correct a factor of 2 in NbDk+1
    1819
     
    2526end
    2627basename=fullfile(RootPath{1},RootFile{1});
    27 [XmlData,warntext]=imadoc2struct([basename '.xml'])% read the xml file appended to the present function (containing bug corrections)
     28[XmlData,warntext]=imadoc2struct([basename '.xml']);% read the xml file appended to the present function (containing bug corrections)
    2829if ~isempty(warntext)
    2930    msgbox_uvmat('ERROR',warntext)%error message for xml file reading
     
    4748    return
    4849end
    49 
    50 answer=msgbox_uvmat('CONFIRMATION',[num2str(nbfield1) ' bursts containing ' num2str(nbfield2) ' images each'])%error message for directory creation
    51 
    52 %% apply the image rescaling function 'level' (avoid bright particles)
    53 % answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m');
    54 % test_level=isequal(answer,'Yes');
     50answer=msgbox_uvmat('CONFIRMATION',[num2str(nbfield1) ' bursts containing ' num2str(nbfield2) ' images each']);%error message for directory creation
    5551
    5652%% copy and adapt the xml file
     
    7369    ImageName=name_generator(basename,1,1,'.png','_i_j');
    7470    [pth,ImageName]=fileparts(ImageName);
    75     ImageName=[ImageName '.png']
     71    ImageName=[ImageName '.png'];
    7672    if isempty(uid_ImageName)
    7773       [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName');
     
    8682    %%%% correction RDvision %%%%
    8783    uid_NbDtj=find(t,'ImaDoc/Camera/BurstTiming/NbDtj');
    88     t=set(t,uid_NbDtj,'value',num2str(XmlData.NbDtj));
     84    uid_value=children(t,uid_NbDtj);
     85    if ~isempty(uid_value)
     86        t=set(t,uid_value(1),'value',num2str(XmlData.NbDtj));
     87    end
    8988    uid_NbDtk=find(t,'ImaDoc/Camera/BurstTiming/NbDtk');
    90     t=set(t,uid_NbDtk,'value',num2str(XmlData.NbDtk));
     89    uid_value=children(t,uid_NbDtk);
     90    if ~isempty(uid_value)
     91        t=set(t,uid_value(1),'value',num2str(XmlData.NbDtk));
     92    end
    9193    %%%
    9294   
     
    185187
    186188function [s,errormsg]=imadoc2struct(ImaDoc,option)
     189
    187190%% default input and output
    188191if ~exist('option','var')
     
    273276                NbDtk=get_value(subt,'/BurstTiming/NbDtk',1);
    274277                %%%% correction RDvision %%%%
    275                 NbDtk=-1+(NbDtk+1)/(NbDti+1)
     278                if ~isequal(NbDtk,1)
     279                    NbDtk=-1+(NbDtk+1)/(NbDti+1);
     280                end
    276281                s.NbDtk=NbDtk;
    277282                %%%%%
Note: See TracChangeset for help on using the changeset viewer.