Changeset 1152 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jul 4, 2024, 4:23:43 PM (3 months ago)
Author:
sommeria
Message:

update_xml simlified, bug on civ_series corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1143 r1152  
    13991399FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the current input file
    14001400[RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(FileName);
    1401 XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file
     1401XmlFile=find_imadoc(RootPath,SubDir);%find name of the relevant xml file
    14021402if isempty(XmlFile)
    14031403    msgbox_uvmat('ERROR','an xml file with calibration parameters must be first created, use Tools/geometric calibration');
     
    14741474        end
    14751475        for iexp=1:NbExp
    1476             XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);
    1477             if exist(XmlName,'file')
    1478                 check_update=1;
    1479             else
    1480                 check_update=0;
    1481             end
    1482             errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the calibration data in the xml file
     1476            % XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);
     1477            % if exist(XmlName,'file')
     1478            %     check_update=1;
     1479            % else
     1480            %     check_update=0;
     1481            % end
     1482            [check_update,xmlfile,errormsg]=update_imadoc(ListPath{iexp},ListSubdir{iexp},'Slice',Slice);% introduce the calibration data in the xml file
    14831483            if ~strcmp(errormsg,'')
    14841484                msgbox_uvmat('ERROR',errormsg);
    14851485            else
    14861486                if check_update
    1487                     display([XmlName ' updated with slice positions'])
     1487                    disp([xmlfile ' updated with slice positions'])
    14881488                else
    1489                     display([XmlName ' created with slice positions'])
     1489                    disp([xmlfile ' created with slice positions'])
    14901490                end
    14911491            end
     
    14961496   
    14971497    %% store the result in the xml file used for calibration
    1498     errormsg=update_imadoc(Slice,XmlFile,'Slice');% introduce the calibration data in the xml file
     1498    [~,xmlfile,errormsg]=update_imadoc(RootPath,SubDir,'Slice',Slice);% introduce the calibration data in the xml file
    14991499    if strcmp(errormsg,'')
    1500         msgbox_uvmat('CONFIRMATION',['slice positions saved in ' XmlFile]);
     1500        msgbox_uvmat('CONFIRMATION',['slice positions saved in ' xmlfile]);
    15011501    else
    15021502        msgbox_uvmat('ERROR',errormsg);
     
    17791779answer = questdlg('Where','record the LIF parameters','Current series', 'Replicate', 'Cancel', 'Cancel');
    17801780if strcmp(answer,'Current series')
    1781     XmlFileName=find_imadoc(get(handles.RootPath,'String'),get(handles.SubDir,'String'),get(handles.RootFile,'String'),get(handles.FileExt,'String'));
    1782     update_imadoc(XmlData.LIFCalib,XmlFileName,'LIFCalib');% introduce the calibration data in the xml file
     1781    %XmlFileName=find_imadoc(get(handles.RootPath,'String'),get(handles.SubDir,'String'),get(handles.RootFile,'String'),get(handles.FileExt,'String'));
     1782    update_imadoc(get(handles.RootPath,'String'),get(handles.SubDir,'String'),'LIFCalib',XmlData.LIFCalib);% introduce the calibration data in the xml file
    17831783    % display the concentration in uvmat
    17841784    InputFileREFRESH_Callback(hObject, eventdata, handles);% refresh the current xml file to apply 'ima2concentration'
     
    18271827    end
    18281828    for iexp=1:NbExp
    1829         XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);
    1830         if exist(XmlName,'file')
    1831             check_update=1;
    1832         else
    1833             check_update=0;
    1834         end
    1835         errormsg=update_imadoc(XmlData.LIFCalib,XmlName,'LIFCalib');% introduce the calibration data in the xml file
     1829        % XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);
     1830        % if exist(XmlName,'file')
     1831        %     check_update=1;
     1832        % else
     1833        %     check_update=0;
     1834        % end
     1835        [check_update,xmlfile,errormsg]=update_imadoc(ListPath{iexp},ListSubdir{iexp},'LIFCalib',XmlData.LIFCalib);% introduce the calibration data in the xml file
    18361836        if ~strcmp(errormsg,'')
    18371837            msgbox_uvmat('ERROR',errormsg);
    18381838        else
    18391839            if check_update
    1840                 display([XmlName ' updated with calibration parameters'])
     1840                display([xmlfile ' updated with calibration parameters'])
    18411841            else
    1842                 display([XmlName ' created with calibration parameters'])
     1842                display([xmlfile ' created with calibration parameters'])
    18431843            end
    18441844        end
     
    18461846    msgbox_uvmat('CONFIMATION',['LIF calibration replicated for ' num2str(NbExp) ' experiments']);
    18471847end
    1848 
    1849 
    1850 
    1851 %     
    1852 %     
    1853 %     t=xmltree(XmlFileName); %read the file
    1854 %     title_str=get(t,1,'name');
    1855 %     if ~strcmp(title_str,'ImaDoc')
    1856 %         msgbox_uvmat('ERROR','wrong xml file');
    1857 %         return
    1858 %     end
    1859 %     % backup the output file if it already exist, and read it
    1860 %     backupfile=XmlFileName;
    1861 %     testexist=2;
    1862 %     while testexist==2
    1863 %         backupfile=[backupfile '~'];
    1864 %         testexist=exist(backupfile,'file');
    1865 %     end
    1866 %     [success,message]=copyfile(XmlFileName,backupfile);%make backup
    1867 %     if success~=1
    1868 %         errormsg=['errror in xml file backup: ' message];
    1869 %         return
    1870 %     end
    1871 %     uid_illumination=find(t,'ImaDoc/LIFCalib');
    1872 %     if isempty(uid_illumination)  %if GeometryCalib does not already exists, create it
    1873 %         [t,uid_illumination]=add(t,1,'element','LIFCalib');
    1874 %     end
    1875 %     uid_origin=find(t,'ImaDoc/LIFCalib/LightOrigin');
    1876 %     if ~isempty(uid_origin)  %if LightOrigin already exists, delete it
    1877 %         t=delete(t,uid_origin);
    1878 %     end
    1879 %     uid_line=find(t,'ImaDoc/LIFCalib/Ray1Coord');
    1880 %     if ~isempty(uid_line)  %if Ray1Coord already exists, delete it
    1881 %         t=delete(t,uid_line);
    1882 %     end
    1883 %     uid_line=find(t,'ImaDoc/LIFCalib/Ray2Coord');
    1884 %     if ~isempty(uid_line)  %if Ray2Coord already exists, delete it
    1885 %         t=delete(t,uid_line);
    1886 %     end
    1887 %     uid_line=find(t,'ImaDoc/LIFCalib/RefLineCoord');
    1888 %     if ~isempty(uid_line)  %if RefLineCoord already exists, delete it
    1889 %         t=delete(t,uid_line);
    1890 %     end
    1891 %     uid_mask=find(t,'ImaDoc/LIFCalib/MaskPolygonCoord');
    1892 %     if ~isempty(uid_mask) %if MaskPolygonCoord already exists, delete it
    1893 %         t=delete(t,uid_mask);
    1894 %     end
    1895 %     uid_BlackOffset=find(t,'ImaDoc/LIFCalib/BlackOffset');
    1896 %     if ~isempty(uid_BlackOffset)  %if BlackOffset already exists, delete it
    1897 %         t=delete(t,uid_BlackOffset);
    1898 %     end
    1899 %     uid_RefLineWidth=find(t,'ImaDoc/LIFCalib/RefLineWidth');
    1900 %     if ~isempty(uid_RefLineWidth)  %if RefLineWidth already exists, delete it
    1901 %         t=delete(t,uid_RefLineWidth);
    1902 %     end
    1903 %     uid_DecayRate=find(t,'ImaDoc/LIFCalib/DecayRate');
    1904 %     if ~isempty(uid_DecayRate)  %if DecayRate already exists, delete it
    1905 %         t=delete(t,uid_DecayRate);
    1906 %     end
    1907 %     uid_RefLineRadius=find(t,'ImaDoc/LIFCalib/RefLineRadius');
    1908 %     if ~isempty(uid_RefLineRadius)  %if RefLineLum already exists, delete it
    1909 %         t=delete(t,uid_RefLineRadius);
    1910 %     end
    1911 %     uid_RefLineLum=find(t,'ImaDoc/LIFCalib/RefLineLum');
    1912 %     if ~isempty(uid_RefLineLum)  %if RefLineLum already exists, delete it
    1913 %         t=delete(t,uid_RefLineLum);
    1914 %     end
    1915 %     uid_RefLineAzimuth=find(t,'ImaDoc/LIFCalib/RefLineAzimuth');
    1916 %     if ~isempty(uid_RefLineAzimuth)  %if RefLineLum already exists, delete it
    1917 %         t=delete(t,uid_RefLineAzimuth);
    1918 %     end
    1919 %     
    1920 %     % save the LIF calibration data
    1921 %     t=struct2xml(XmlData.LIFCalib,t,uid_illumination);
    1922 %     save(t,XmlFileName);
    1923    
    1924 
    19251848
    19261849
     
    25042427    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles);
    25052428end
    2506 XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt);
     2429XmlFileName=find_imadoc(RootPath,SubDir);
    25072430[tild,tild,DocExt]=fileparts(XmlFileName);
    25082431warntext='';%default warning message
Note: See TracChangeset for help on using the changeset viewer.