- Timestamp:
- Jul 4, 2024, 4:23:43 PM (6 months ago)
- Location:
- trunk/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/filter_tps.m
r1143 r1152 106 106 ind_ind_sel=1:numel(ind_sel);%default 107 107 if exist('Threshold','var')&&~isempty(Threshold) 108 FF(ind_sel)= 2*(NormDiff>Threshold);%put FF value to 2to identify the criterium of elimmination108 FF(ind_sel)=4*(NormDiff>Threshold);%put FF value to 4 to identify the criterium of elimmination 109 109 ind_ind_sel=find(FF(ind_sel)==0); % select the indices of remaining vectors in the subset of ind_sel vectors 110 110 end … … 166 166 U_smooth=U_smooth./nb_select;% take the average at the intersection of several subdomains 167 167 V_smooth=V_smooth./nb_select; 168 U_smooth(FF== 2)=U(FF==2);% set to the initial values the eliminated vectors (flagged as false)169 V_smooth(FF== 2)=V(FF==2);168 U_smooth(FF==4)=U(FF==4);% set to the initial values the eliminated vectors (flagged as false) 169 V_smooth(FF==4)=V(FF==4); 170 170 fill=zeros(NbCoord+1,NbCoord,size(SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage) 171 171 Coord_tps=cat(1,Coord_tps,fill); -
trunk/src/find_imadoc.m
r1127 r1152 2 2 % take into account the old conventions 3 3 %----------------------------------------------------------------------- 4 % function XmlFileName=find_imadoc(RootPath,SubDir ,RootFile,FileExt)4 % function XmlFileName=find_imadoc(RootPath,SubDir) 5 5 % 6 6 % OUTPUT: … … 8 8 % 9 9 % INPUT: 10 % RootPath,SubDir,RootFile,FileExt, as given from the input file name by fileparts_uvmat 10 % RootPath: path to the folder containing the image series, 11 % SubDir: name of the folder containing the image series 11 12 12 13 %======================================================================= … … 28 29 %======================================================================= 29 30 30 function XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt) 31 SubDirBase=SubDir; 32 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 33 if ~exist (XmlFileName,'file') 34 dotchar=regexp(SubDir,'\.'); 31 function XmlFileName=find_imadoc(RootPath,SubDir) 32 33 dotchar=regexp(SubDir,'\.');%detect the dots in the folder name 34 if isempty(dotchar) 35 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 36 else %go upward to the root name, stop if an xml file already exists 35 37 for idot=1:numel(dotchar) 36 XmlFileName=fullfile(RootPath,[SubDir(1:dotchar(end-idot+1)-1) '.xml']); 38 SubDir=SubDir(1:dotchar(end-idot+1)-1); 39 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 37 40 if exist(XmlFileName,'file') 38 SubDirBase=fullfile(RootPath,SubDir(1:dotchar(end-idot+1)-1));39 41 break 40 end41 end42 end43 if ~exist(XmlFileName,'file')44 XmlFileName=[fullfile(RootPath,SubDirBase,RootFile) '.xml']; % old convention: xml inside the image folder, case of images or new civ files45 if ~exist(XmlFileName,'file')46 XmlFileName=[fullfile(RootPath,SubDirBase,RootFile) '.civ']; % very old convention: .civ file47 if ~exist(XmlFileName,'file') && strcmp(FileExt,'.nc')48 XmlFileName=[fullfile(RootPath,RootFile) '.xml'] ; % old convention: xml inside the image folder, old civ file opened49 if ~exist(XmlFileName,'file')50 XmlFileName=[fullfile(RootPath,RootFile) '.civ']; % very old convention: .civ file51 end52 42 end 53 43 end 54 44 end 55 if ~exist(XmlFileName,'file')% convention Pierre Augier for 3D images 56 check3D=find(~isempty(regexp(SubDirBase,'^level'))); 57 if check3D 58 [RootRootPath,RootDir]=fileparts(RootPath); 59 XmlFileName=fullfile(RootRootPath,[RootDir '.xml']); 60 dotchar=regexp(RootDir,'\.'); 61 for idot=1:numel(dotchar) 62 XmlFileName=fullfile(RootRootPath,[RootDir(1:dotchar(end-idot+1)-1) '.xml']); 63 if exist(XmlFileName,'file') 64 break 65 end 66 end 67 end 68 end 69 if exist(XmlFileName,'file')~=2 45 if ~exist(XmlFileName,'file') 70 46 XmlFileName=''; 71 47 end 48 49 50 -
trunk/src/geometry_calib.m
r1151 r1152 125 125 if exist('inputfile','var')&& ~isempty(inputfile) 126 126 [RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(inputfile); 127 struct.XmlInputFile=find_imadoc(RootPath,SubDir ,RootFile,FileExt);127 struct.XmlInputFile=find_imadoc(RootPath,SubDir); 128 128 set(handles.ListCoord,'Data',[]) 129 129 if exist(struct.XmlInputFile,'file') … … 305 305 end 306 306 if find(~cellfun('isempty',strfind(ListDataSeries,'.'))) 307 msgbox_uvmat('ERROR','select only folders at the root, without dot (.) in the name'); 308 return 307 msgbox_uvmat('WARNING','select folders at the root, without dot (.) in the name'); 309 308 end 310 309 NbExp=0; % counter of the number of experiments set by the GUI browse_data … … 332 331 NbErrors=0; 333 332 for iexp=1:NbExp 334 XmlName=fullfile(ListPath{iexp},[ListSubdir{iexp} '.xml']); 335 if exist(XmlName,'file') 336 check_update=1; 337 else 338 check_update=0; 339 end 340 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 333 [check_update,xmlfile,errormsg]=update_imadoc(ListPath{iexp},ListSubdir{iexp},'GeometryCalib',GeometryCalib);% introduce the calibration data in the xml file 341 334 dispmessage=''; 342 335 if checkslice 343 errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the slice position in the xml file336 [~,~,errormsg]=update_imadoc(ListPath{iexp},ListSubdir{iexp},'Slice',Slice,0);% introduce the slice position in the xml file 344 337 dispmessage=' and slice position'; 345 338 end … … 349 342 else 350 343 if check_update 351 disp([ XmlName ' updated with calibration parameters' dispmessage]);344 disp([xmlfile ' updated with calibration parameters' dispmessage]); 352 345 else 353 disp([ XmlName ' created with calibration parameters: no timing defined' dispmessage]);346 disp([xmlfile ' created with calibration parameters: no timing defined' dispmessage]); 354 347 end 355 348 end … … 363 356 else 364 357 %% update the calibration parameters in the currently opened uvmat GUI 365 if ~exist(outputfile,'file') && ~isempty(SubDirBase) %copy the xml file from the old location if appropriate366 oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml'];367 if exist(oldxml,'file')368 [success,message]=copyfile(oldxml,outputfile);%copy the old xml file to a new one with the new convention369 end370 end371 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file358 % if ~exist(outputfile,'file') && ~isempty(SubDirBase) %copy the xml file from the old location if appropriate 359 % oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml']; 360 % if exist(oldxml,'file') 361 % [success,message]=copyfile(oldxml,outputfile);%copy the old xml file to a new one with the new convention 362 % end 363 % endSlice, 364 [~,~,errormsg]=update_imadoc(RootPath,get(hhuvmat.SubDir,'String'),'GeometryCalib',GeometryCalib);% introduce the calibration data in the xml file 372 365 if checkslice 373 errormsg=update_imadoc(Slice,outputfile,'Slice');% introduce the slice position in the xml file366 [~,~,errormsg]=update_imadoc(RootPath,get(hhuvmat.SubDir,'String'),'Slice',Slice,0);% introduce the slice position in the xml file 374 367 end 375 368 if ~strcmp(errormsg,'') … … 839 832 840 833 %------------------------------------------------------------------------ 841 % --- Executes on button press in STORE .834 % --- Executes on button press in STORE: store the current points 842 835 function STORE_Callback(hObject, eventdata, handles) 843 836 %------------------------------------------------------------------------ 844 837 Coord=get(handles.ListCoord,'Data'); 845 %Object=read_geometry_calib(Coord_cell);846 838 unitlist=get(handles.CoordUnit,'String'); 847 839 unit=unitlist{get(handles.CoordUnit,'value')}; … … 850 842 huvmat=findobj(allchild(0),'Name','uvmat'); 851 843 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 852 % RootPath=''; 853 % RootFile=''; 854 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 855 % testhandle=1; 844 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.SubDir) 856 845 RootPath=get(hhuvmat.RootPath,'String'); 857 RootFile=get(hhuvmat.RootFile,'String');858 filebase=[fullfile(RootPath, RootFile) '~'];846 SubDir=get(hhuvmat.SubDir,'String'); 847 filebase=[fullfile(RootPath,SubDir) '~']; 859 848 while exist([filebase '.xml'],'file') 860 849 filebase=[filebase '~']; 861 850 end 862 851 outputfile=[filebase '.xml']; 863 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib'); 852 [~,RootFile]=fileparts(filebase); 853 [~,~,errormsg]=update_imadoc(RootPath,SubDir,'GeometryCalib',GeometryCalib,0); 864 854 if ~strcmp(errormsg,'') 865 855 msgbox_uvmat('ERROR',errormsg); -
trunk/src/plot_field.m
r1144 r1152 1219 1219 if ~isempty(ivar_FF_vec) 1220 1220 if isfield(PlotParam.Vectors,'CheckShowFalse') && PlotParam.Vectors.CheckShowFalse==1 1221 %colorlist(nbcolor,:)=[1 0 1];% magenta color1222 colorlist(nbcolor,:)=[0 0 0];% blackcolor1221 colorlist(nbcolor,:)=[1 0 1];% magenta color 1222 %colorlist(nbcolor,:)=[0 0 0];% blackcolor 1223 1223 if strcmp(PlotParam.Vectors.FalseCriteria,'ALL') 1224 1224 col_vec(vec_FF~=0)=nbcolor; -
trunk/src/read_multimadoc.m
r1127 r1152 42 42 timecell=cell(1,nbview); 43 43 for iview=1:nbview%Loop on views 44 XmlFileName=find_imadoc(RootPath{iview},SubDir{iview} ,RootFile{iview},FileExt{iview});44 XmlFileName=find_imadoc(RootPath{iview},SubDir{iview}); 45 45 if ~isempty(XmlFileName) 46 46 [XmlData{iview},warnmsg]=imadoc2struct(XmlFileName);% read the ImaDoc xml file -
trunk/src/series.m
r1150 r1152 949 949 XmlData=[]; 950 950 check_calib=0; 951 XmlFileName=find_imadoc(InputTable{iview,1},InputTable{iview,2} ,InputTable{iview,3},InputTable{iview,5});951 XmlFileName=find_imadoc(InputTable{iview,1},InputTable{iview,2}); 952 952 if ~isempty(XmlFileName) 953 953 [XmlData,errormsg]=imadoc2struct(XmlFileName); -
trunk/src/series/civ_3D.m
r1151 r1152 189 189 %% get timing from the ImaDoc file or input video 190 190 if iview_A~=0 191 XmlFileName=find_imadoc(RootPath_A,SubDir_A ,RootFile_A,FileExt_A);191 XmlFileName=find_imadoc(RootPath_A,SubDir_A); 192 192 Time=[]; 193 193 if ~isempty(XmlFileName) -
trunk/src/series/civ_input.m
r1148 r1152 2362 2362 % --- Executes on selection change in field_ref2. 2363 2363 function field_ref2_Callback(hObject, eventdata, handles) 2364 2365 2366 -
trunk/src/series/civ_series.m
r1148 r1152 256 256 %% get timing from the ImaDoc file or input video 257 257 if iview_A~=0 258 XmlFileName=find_imadoc(RootPath_A,SubDir_A ,RootFile_A,FileExt_A);258 XmlFileName=find_imadoc(RootPath_A,SubDir_A); 259 259 Time=[]; 260 260 if ~isempty(XmlFileName) … … 488 488 end 489 489 if strcmp(Param.ActionInput.ListCompareMode, 'PIV volume') 490 Data.ListVarName=[Data.ListVarName 'Civ1_Z'];491 Data.Civ1_X=[];Data.Civ1_Y=[];Data.Civ1_Z=[];492 Data.Civ1_U=[];Data.Civ1_V=[];Data.Civ1_C=[];493 for ivol=1:NbSlice494 % caluclate velocity data (y and v in indices, reverse to y component)495 [xtable, ytable, utable, vtable, ctable, F, result_conv, errormsg] = civ (par_civ1);496 if ~isempty(errormsg)497 disp_uvmat('ERROR',errormsg,checkrun)498 return499 end500 Data.Civ1_X=[Data.Civ1_X reshape(xtable,[],1)];501 Data.Civ1_Y=[Data.Civ1_Y reshape(Param.Civ1.ImageHeight-ytable+1,[],1)];502 Data.Civ1_Z=[Data.Civ1_Z ivol*ones(numel(xtable),1)];% z=image index in image coordinates503 Data.Civ1_U=[Data.Civ1_U reshape(utable,[],1)];504 Data.Civ1_V=[Data.Civ1_V reshape(-vtable,[],1)];505 Data.Civ1_C=[Data.Civ1_C reshape(ctable,[],1)];506 Data.Civ1_FF=[Data.Civ1_FF reshape(F,[],1)];507 end490 % Data.ListVarName=[Data.ListVarName 'Civ1_Z']; 491 % Data.Civ1_X=[];Data.Civ1_Y=[];Data.Civ1_Z=[]; 492 % Data.Civ1_U=[];Data.Civ1_V=[];Data.Civ1_C=[]; 493 % for ivol=1:NbSlice 494 % % caluclate velocity data (y and v in indices, reverse to y component) 495 % [xtable, ytable, utable, vtable, ctable, F, result_conv, errormsg] = civ (par_civ1); 496 % if ~isempty(errormsg) 497 % disp_uvmat('ERROR',errormsg,checkrun) 498 % return 499 % end 500 % Data.Civ1_X=[Data.Civ1_X reshape(xtable,[],1)]; 501 % Data.Civ1_Y=[Data.Civ1_Y reshape(Param.Civ1.ImageHeight-ytable+1,[],1)]; 502 % Data.Civ1_Z=[Data.Civ1_Z ivol*ones(numel(xtable),1)];% z=image index in image coordinates 503 % Data.Civ1_U=[Data.Civ1_U reshape(utable,[],1)]; 504 % Data.Civ1_V=[Data.Civ1_V reshape(-vtable,[],1)]; 505 % Data.Civ1_C=[Data.Civ1_C reshape(ctable,[],1)]; 506 % Data.Civ1_FF=[Data.Civ1_FF reshape(F,[],1)]; 507 % end 508 508 else %usual PIV 509 509 % caluclate velocity data (y and v in indices, reverse to y component) -
trunk/src/series/merge_proj.m
r1147 r1152 338 338 end 339 339 [MaskData,~,errormsg] = read_field(maskname,'image'); 340 if ~isempty(NbSlice_calib) 341 MaskData.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform 342 end 340 343 if ~isempty(transform_fct) && nargin(transform_fct)>=2 341 344 MaskData=transform_fct(MaskData,XmlData{iview}); -
trunk/src/series/stereo_civ.m
r1126 r1152 95 95 time=[]; 96 96 for iview=1:size(Param.InputTable,1) 97 XmlFileName=find_imadoc(Param.InputTable{iview,1},Param.InputTable{iview,2} ,Param.InputTable{iview,3},Param.InputTable{iview,5});97 XmlFileName=find_imadoc(Param.InputTable{iview,1},Param.InputTable{iview,2}); 98 98 if isempty(XmlFileName) 99 99 disp_uvmat('ERROR', [XmlFileName ' not found'],checkrun) -
trunk/src/update_imadoc.m
r1151 r1152 1 1 %'update_imadoc': update an xml file with geometric calibration parameters 2 2 %-------------------------------------------------------------------------- 3 % function update_imadoc(Struct,outputfile)3 % function [checkcreate,xmlfile,errormsg]=update_imadoc(Struct,RootPath,SubDir,StructName) 4 4 % 5 %INPUT: 6 % Struct: structure containing the calibration parameters 7 % outputfile: xml file to modify 5 % OUTPUT: 6 % checkupdate= 1 if the xml file (containing timing)already exist, =0 when it has to be created 7 % xmlfile: name of the xmlfile containing the the calibration data 8 % errormsg: error message, ='' if OK 9 10 % INPUT: 11 12 % RootPath: path to the folder containing the image series to calibrate 13 % SubDir: folder contaiting the image series to calibrate 8 14 % StructName : Name of the field in the xml file 15 % Struct: Matlab structure containing the calibration parameters 16 % checkbackup=1 (default): backup of existing xml file as .xml~, 9 17 %------------------------------------------------------------- 10 18 … … 27 35 %======================================================================= 28 36 29 function errormsg=update_imadoc(Struct,outputfile,StructName) 37 function [checkupdate,xmlfile,errormsg]=update_imadoc(RootPath,SubDir,StructName,Struct,checkbackup) 38 30 39 errormsg=''; 31 testappend=0; 40 if ~exist('checkbackup','var') 41 checkbackup=1; 42 end 32 43 33 44 %% set the output xml file at the root, hide other existing xml files 34 dotchar=regexp(outputfile,'\.'); 35 for idot=1:numel(dotchar) 36 outputfile=[outputfile(1:dotchar(end-idot+1)-1) '.xml']; 37 if exist(outputfile,'file') 38 backupfile=outputfile; 39 testexist=2; 45 xmlfile=find_imadoc(RootPath,SubDir); 46 if isempty(xmlfile) 47 checkupdate=0; 48 else 49 checkupdate=1; 50 end 51 52 %% backup the existing xml file, adding a ~ to its name 53 if checkupdate 54 if checkbackup 55 backupfile=xmlfile; 56 testexist=2; 40 57 while testexist==2 41 58 backupfile=[backupfile '~']; 42 59 testexist=exist(backupfile,'file'); 43 60 end 44 [success,message]= movefile(outputfile,backupfile);%make backup61 [success,message]=copyfile(xmlfile,backupfile);%make backup 45 62 if success~=1 46 63 errormsg=['errror in xml file backup: ' message]; … … 48 65 end 49 66 end 50 end 51 52 53 %% backup the output file if it already exist, and read it 54 if exist(outputfile,'file')%=1 if the output file already exists, 0 else 55 testappend=1; 56 t=xmltree(outputfile); %read the file 67 t=xmltree(xmlfile); %read the file 57 68 title=get(t,1,'name'); 58 69 if ~strcmp(title,'ImaDoc') 59 errormsg=[ outputfile ' not appropriate for calibration'];70 errormsg=[xmlfile ' not appropriate for calibration']; 60 71 return 61 72 end … … 67 78 t=delete(t,uid_child); 68 79 end 69 end 70 71 %% create a new xml file 72 if ~testappend 80 else % create a new xml file 73 81 t=xmltree; 74 82 t=set(t,1,'name','ImaDoc'); 75 % in case of movie (avi file), copy timing info in the new xml file76 [pp,outputroot]=fileparts(outputfile);77 % imainfo=[];78 if exist(fullfile(pp,[outputroot '.avi']),'file')79 FileName=fullfile(pp,[outputroot '.avi']);80 hhh=which('videoreader');81 if isempty(hhh)%use old video function of matlab82 imainfo=aviinfo(FileName);83 imainfo.FrameRate=imainfo.FramesPerSecond;84 imainfo.NumberOfFrames=imainfo.NumFrames;85 else %use video function videoreader of matlab86 imainfo=get(videoreader(FileName));87 end88 if ~isempty(imainfo)89 [t,uid_camera]=add(t,1,'element','Camera');90 Camera.TimeUnit='s';91 Camera.BurstTiming.Time=0;92 Camera.BurstTiming.Dti=1/imainfo.FrameRate;93 Camera.BurstTiming.NbDti=imainfo.NumberOfFrames-1;94 t=struct2xml(Camera,t,uid_camera);95 end96 end97 83 [t,uid_calib]=add(t,1,'element',StructName); 98 84 end … … 101 87 t=struct2xml(Struct,t,uid_calib); 102 88 try 103 save(t, outputfile);89 save(t,xmlfile); 104 90 catch ME 105 errormsg=['error in saving ' outputfile ': ' ME.message];91 errormsg=['error in saving ' xmlfile ': ' ME.message]; 106 92 end -
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.