Ignore:
Timestamp:
Feb 5, 2011, 11:25:38 PM (14 years ago)
Author:
sommeria
Message:

introduce edit boxes to set axis limits. rationalisation of names FixScal?, FixLimits?....
introduce volume scan in calibration procedures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r177 r191  
    204204
    205205% store the calibration data, by default in the xml file of the currently displayed image
    206 hhuvmat=guidata(findobj(allchild(0),'Name','uvmat'));%handles of elements in the GUI uvmat
     206huvmat=findobj(allchild(0),'Name','uvmat');
     207UvData=get(huvmat,'UserData');
     208NbSlice_j=1;%default
     209ZStart=Z_plane;
     210ZEnd=Z_plane;
     211if isfield(UvData,'XmlData')
     212    UvData.XmlData
     213    if isfield(UvData.XmlData,'TranslationMotor')
     214        NbSlice_j=UvData.XmlData.TranslationMotor.Nbslice;
     215        ZStart=UvData.XmlData.TranslationMotor.ZStart;
     216        ZEnd=UvData.XmlData.TranslationMotor.ZEnd;
     217    end
     218end
     219hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat
    207220RootPath='';
    208221RootFile='';
     
    227240if strcmp(answer,'Yes')
    228241    if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration
    229         answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane));
    230         if strcmp(answer_1,'Cancel')
     242       input_key={'Z (first position)','Z (last position)','Z (water surface)', 'refractive index','NbSlice','volume scan (y/n)','tilt angle'};
     243       input_val=[{num2str(ZEnd/10)} {num2str(ZStart/10)} {num2str(ZStart/10)} {'1.33'} num2str(NbSlice_j) {'y'} {'0'}];
     244        answer=inputdlg(input_key,'slice position(s)',ones(1,7), input_val,'on');
     245        %answer_1=msgbox_uvmat('INPUT_TXT',' Z= ',num2str(Z_plane));
     246        GeometryCalib.NbSlice=str2double(answer{5});
     247        GeometryCalib.VolumeScan=answer{6};
     248        if isempty(answer)
    231249            Z_plane=0; %default
    232250        else
    233             Z_plane=str2double(answer_1);
    234         end
    235         GeometryCalib.NbSlice=1;
    236         GeometryCalib.SliceCoord=[0 0 Z_plane];
     251            Z_plane=linspace(str2double(answer{1}),str2double(answer{2}),GeometryCalib.NbSlice);
     252        end     
     253        GeometryCalib.SliceCoord=Z_plane'*[0 0 1]
    237254    end
    238255    errormsg=update_imadoc(GeometryCalib,outputfile);% introduce the calibration data in the xml file
     
    250267        delete(hhh);
    251268    end
    252     set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off'
    253     set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
     269    set(hhuvmat.FixLimits,'Value',0)% put FixedLimits option to 'off'
     270    set(hhuvmat.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
    254271    UserData=get(handles.geometry_calib,'UserData');
    255272    UserData.XmlInputFile=outputfile;%save the current xml file name
Note: See TracChangeset for help on using the changeset viewer.