Changeset 1152 for trunk/src/geometry_calib.m
- Timestamp:
- Jul 4, 2024, 4:23:43 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.