Changeset 847 for trunk/src/geometry_calib.m
- Timestamp:
- Jan 15, 2015, 6:05:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r838 r847 170 170 %------------------------------------------------------------------------ 171 171 %% look for the GUI uvmat and check for an image as input 172 set(handles.APPLY,'BackgroundColor',[1 1 0]) 173 huvmat=findobj(allchild(0),'Name','uvmat'); 172 set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation 173 huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat 174 174 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 175 175 176 176 RootPath=''; 177 177 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 178 RootPath=get(hhuvmat.RootPath,'String'); 178 RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image 179 179 SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$',''); 180 180 outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image … … 326 326 327 327 %% store the calibration data, by default in the xml file of the currently displayed image 328 UvData=get(hhuvmat.uvmat,'UserData');329 % NbSlice_j=1;%default330 % ZStart=Z_plane;331 % ZEnd=Z_plane;332 % volume_scan='n';333 % if isfield(UvData,'XmlData')334 % if isfield(UvData.XmlData,'TranslationMotor')335 % NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;336 % ZStart=UvData.XmlData.TranslationMotor.ZStart/10;337 % ZEnd=UvData.XmlData.TranslationMotor.ZEnd/10;338 % volume_scan='y';339 % end340 % end341 342 328 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 343 329 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 344 330 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']}); 345 346 %% get plane position(s) 347 if ~strcmp(answer,'Yes') 331 if strcmp(answer,'Yes') %store the calibration data 332 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 333 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'}) 334 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 335 end 336 else 348 337 GeometryCalib=[]; 349 338 index=1; 350 return351 end352 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration353 msgbox_uvmat('CONFIRMATION',{['The current image series is assumed by default in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be modified by MenuSetSlice in the upper bar menu of uvmat'})354 % input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle y axis','tilt angle x axis'};355 % input_val=[{num2str(ZEnd)} {num2str(ZStart)} {num2str(ZStart)} {'1.333'} num2str(NbSlice_j) {volume_scan} {'0'} {'0'}];356 % answer=inputdlg(input_key,'slice position(s)',ones(1,8), input_val,'on');357 % GeometryCalib.NbSlice=str2double(answer{5});358 % GeometryCalib.VolumeScan=answer{6};359 % if isempty(answer)360 % Z_plane=0; %default361 % else362 % Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);363 % end364 GeometryCalib.SliceCoord=Z_plane'*[0 0 1];365 % GeometryCalib.SliceAngle(:,3)=0;366 % GeometryCalib.SliceAngle(:,2)=str2double(answer{7})*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise)367 % GeometryCalib.SliceAngle(:,1)=str2double(answer{8})*ones(GeometryCalib.NbSlice,1);%rotation around x axis (to generalise)368 % GeometryCalib.InterfaceCoord=[0 0 str2double(answer{3})];369 % GeometryCalib.RefractionIndex=str2double(answer{4});370 339 end 371 340
Note: See TracChangeset
for help on using the changeset viewer.