Ignore:
Timestamp:
Jan 15, 2015, 6:05:57 PM (10 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r838 r847  
    170170%------------------------------------------------------------------------
    171171%% 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');
     172set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation
     173huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat
    174174hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
    175175
    176176RootPath='';
    177177if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile)
    178     RootPath=get(hhuvmat.RootPath,'String');
     178    RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image
    179179    SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$','');
    180180    outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image
     
    326326
    327327%% 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;%default
    330 % 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 %     end
    340 % end
    341 
    342328answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';...
    343329    ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];...
    344330    ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']});
    345 
    346 %% get plane position(s)
    347 if ~strcmp(answer,'Yes')
     331if 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
     336else
    348337    GeometryCalib=[];
    349338    index=1;
    350     return
    351 end
    352 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration
    353     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; %default
    361 %     else
    362 %         Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);
    363 %     end
    364      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});
    370339end
    371340
Note: See TracChangeset for help on using the changeset viewer.