Changeset 469 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jun 22, 2012, 3:45:06 PM (12 years ago)
Author:
sommeria
Message:

several bugs corrected
introductyion of functions find_imadoc and read_multimadoc which simplifiy the functions under series

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r460 r469  
    906906
    907907%% read parameters (time, geometric calibration..) from a documentation file (.xml advised)
    908 SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
    909 filexml=fullfile(RootPath,[SubDirBase '.xml']);% new convention: xml above the image dir
    910 DocExt='.xml';
    911 if ~exist(filexml,'file')
    912     filexml=fullfile(RootPath,SubDir,[RootFile '.xml']);%old convention: xml within the image directroy
    913     if ~exist(filexml,'file')
    914         filexml=fullfile(RootPath,SubDir,[RootFile '.civ']); % very old convention: .civ file
    915         if exist(filexml,'file')
    916             DocExt='.civ';
    917         else
    918             filexml='';
    919         end
    920     end
    921 end
     908XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt);
     909[tild,tild,DocExt]=fileparts(XmlFileName);
    922910warntext='';%default warning message
    923911NbSlice=1;%default
    924912set(handles.RootPath,'BackgroundColor',[1 1 1])
    925 if ~isempty(filexml)
     913if ~isempty(XmlFileName)
    926914    set(handles.view_xml,'Visible','on')
    927915    set(handles.view_xml,'BackgroundColor',[1 1 0])
    928916    set(handles.view_xml,'String','view .xml')
    929917    drawnow
    930     [XmlDataRead,warntext]=imadoc2struct(filexml);
     918    [XmlDataRead,warntext]=imadoc2struct(XmlFileName);
    931919    if ~isempty(warntext)
    932920        msgbox_uvmat('WARNING',warntext)
     
    951939            if ~isempty(hgeometry_calib)
    952940                GUserData=get(hgeometry_calib,'UserData');
    953                 if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,filexml))
     941                if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName))
    954942                    answer=msgbox_uvmat('INPUT_Y-N','replace the display of geometry_calib with the new input data?');
    955943                    if strcmp(answer,'Yes')
    956                         geometry_calib(filexml);%diplay the new calibration points and parameters in geometry_calib
     944                        geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib
    957945                    end
    958946                end
Note: See TracChangeset for help on using the changeset viewer.