Changeset 1152 for trunk/src/uvmat.m
- Timestamp:
- Jul 4, 2024, 4:23:43 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r1143 r1152 1399 1399 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the current input file 1400 1400 [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 file1401 XmlFile=find_imadoc(RootPath,SubDir);%find name of the relevant xml file 1402 1402 if isempty(XmlFile) 1403 1403 msgbox_uvmat('ERROR','an xml file with calibration parameters must be first created, use Tools/geometric calibration'); … … 1474 1474 end 1475 1475 for iexp=1:NbExp 1476 XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);1477 if exist(XmlName,'file')1478 check_update=1;1479 else1480 check_update=0;1481 end1482 errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the calibration data in the xml file1476 % 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 1483 1483 if ~strcmp(errormsg,'') 1484 1484 msgbox_uvmat('ERROR',errormsg); 1485 1485 else 1486 1486 if check_update 1487 disp lay([XmlName ' updated with slice positions'])1487 disp([xmlfile ' updated with slice positions']) 1488 1488 else 1489 disp lay([XmlName ' created with slice positions'])1489 disp([xmlfile ' created with slice positions']) 1490 1490 end 1491 1491 end … … 1496 1496 1497 1497 %% store the result in the xml file used for calibration 1498 errormsg=update_imadoc(Slice,XmlFile,'Slice');% introduce the calibration data in the xml file1498 [~,xmlfile,errormsg]=update_imadoc(RootPath,SubDir,'Slice',Slice);% introduce the calibration data in the xml file 1499 1499 if strcmp(errormsg,'') 1500 msgbox_uvmat('CONFIRMATION',['slice positions saved in ' XmlFile]);1500 msgbox_uvmat('CONFIRMATION',['slice positions saved in ' xmlfile]); 1501 1501 else 1502 1502 msgbox_uvmat('ERROR',errormsg); … … 1779 1779 answer = questdlg('Where','record the LIF parameters','Current series', 'Replicate', 'Cancel', 'Cancel'); 1780 1780 if 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 file1781 %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 1783 1783 % display the concentration in uvmat 1784 1784 InputFileREFRESH_Callback(hObject, eventdata, handles);% refresh the current xml file to apply 'ima2concentration' … … 1827 1827 end 1828 1828 for iexp=1:NbExp 1829 XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']);1830 if exist(XmlName,'file')1831 check_update=1;1832 else1833 check_update=0;1834 end1835 errormsg=update_imadoc(XmlData.LIFCalib,XmlName,'LIFCalib');% introduce the calibration data in the xml file1829 % 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 1836 1836 if ~strcmp(errormsg,'') 1837 1837 msgbox_uvmat('ERROR',errormsg); 1838 1838 else 1839 1839 if check_update 1840 display([ XmlName ' updated with calibration parameters'])1840 display([xmlfile ' updated with calibration parameters']) 1841 1841 else 1842 display([ XmlName ' created with calibration parameters'])1842 display([xmlfile ' created with calibration parameters']) 1843 1843 end 1844 1844 end … … 1846 1846 msgbox_uvmat('CONFIMATION',['LIF calibration replicated for ' num2str(NbExp) ' experiments']); 1847 1847 end 1848 1849 1850 1851 %1852 %1853 % t=xmltree(XmlFileName); %read the file1854 % title_str=get(t,1,'name');1855 % if ~strcmp(title_str,'ImaDoc')1856 % msgbox_uvmat('ERROR','wrong xml file');1857 % return1858 % end1859 % % backup the output file if it already exist, and read it1860 % backupfile=XmlFileName;1861 % testexist=2;1862 % while testexist==21863 % backupfile=[backupfile '~'];1864 % testexist=exist(backupfile,'file');1865 % end1866 % [success,message]=copyfile(XmlFileName,backupfile);%make backup1867 % if success~=11868 % errormsg=['errror in xml file backup: ' message];1869 % return1870 % end1871 % uid_illumination=find(t,'ImaDoc/LIFCalib');1872 % if isempty(uid_illumination) %if GeometryCalib does not already exists, create it1873 % [t,uid_illumination]=add(t,1,'element','LIFCalib');1874 % end1875 % uid_origin=find(t,'ImaDoc/LIFCalib/LightOrigin');1876 % if ~isempty(uid_origin) %if LightOrigin already exists, delete it1877 % t=delete(t,uid_origin);1878 % end1879 % uid_line=find(t,'ImaDoc/LIFCalib/Ray1Coord');1880 % if ~isempty(uid_line) %if Ray1Coord already exists, delete it1881 % t=delete(t,uid_line);1882 % end1883 % uid_line=find(t,'ImaDoc/LIFCalib/Ray2Coord');1884 % if ~isempty(uid_line) %if Ray2Coord already exists, delete it1885 % t=delete(t,uid_line);1886 % end1887 % uid_line=find(t,'ImaDoc/LIFCalib/RefLineCoord');1888 % if ~isempty(uid_line) %if RefLineCoord already exists, delete it1889 % t=delete(t,uid_line);1890 % end1891 % uid_mask=find(t,'ImaDoc/LIFCalib/MaskPolygonCoord');1892 % if ~isempty(uid_mask) %if MaskPolygonCoord already exists, delete it1893 % t=delete(t,uid_mask);1894 % end1895 % uid_BlackOffset=find(t,'ImaDoc/LIFCalib/BlackOffset');1896 % if ~isempty(uid_BlackOffset) %if BlackOffset already exists, delete it1897 % t=delete(t,uid_BlackOffset);1898 % end1899 % uid_RefLineWidth=find(t,'ImaDoc/LIFCalib/RefLineWidth');1900 % if ~isempty(uid_RefLineWidth) %if RefLineWidth already exists, delete it1901 % t=delete(t,uid_RefLineWidth);1902 % end1903 % uid_DecayRate=find(t,'ImaDoc/LIFCalib/DecayRate');1904 % if ~isempty(uid_DecayRate) %if DecayRate already exists, delete it1905 % t=delete(t,uid_DecayRate);1906 % end1907 % uid_RefLineRadius=find(t,'ImaDoc/LIFCalib/RefLineRadius');1908 % if ~isempty(uid_RefLineRadius) %if RefLineLum already exists, delete it1909 % t=delete(t,uid_RefLineRadius);1910 % end1911 % uid_RefLineLum=find(t,'ImaDoc/LIFCalib/RefLineLum');1912 % if ~isempty(uid_RefLineLum) %if RefLineLum already exists, delete it1913 % t=delete(t,uid_RefLineLum);1914 % end1915 % uid_RefLineAzimuth=find(t,'ImaDoc/LIFCalib/RefLineAzimuth');1916 % if ~isempty(uid_RefLineAzimuth) %if RefLineLum already exists, delete it1917 % t=delete(t,uid_RefLineAzimuth);1918 % end1919 %1920 % % save the LIF calibration data1921 % t=struct2xml(XmlData.LIFCalib,t,uid_illumination);1922 % save(t,XmlFileName);1923 1924 1925 1848 1926 1849 … … 2504 2427 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes_1(handles); 2505 2428 end 2506 XmlFileName=find_imadoc(RootPath,SubDir ,RootFile,FileExt);2429 XmlFileName=find_imadoc(RootPath,SubDir); 2507 2430 [tild,tild,DocExt]=fileparts(XmlFileName); 2508 2431 warntext='';%default warning message
Note: See TracChangeset
for help on using the changeset viewer.