Ignore:
Timestamp:
Jan 26, 2022, 7:37:21 PM (2 years ago)
Author:
sommeria
Message:

set_slice separated from geometrey_calib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r1111 r1112  
    256256    [num2str(numel(ind_removed)) ' points removed']});
    257257% SliceCoord_ref=[0 0 0]; %default reference plane
     258checkslice=0;
    258259if strcmp(answer,'Yes') %store the calibration data
    259260    Z=Coord(:,3);
    260261    if strcmp(calib_cell{val}(1:2),'3D') && isequal(max(Z),min(Z))%set the plane position for 3D (projection) calibration
    261262        %set the Z position of the reference plane used for calibration
    262         answer=msgbox_uvmat('INPUT_Y-N',{['Assume that the illuminated plane is at z=' num2str(Z(1)) ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'});
     263        answer=msgbox_uvmat('INPUT_Y-N',{['Do you assume that the illuminated plane is at z=' num2str(Z(1)) '?' ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'});
    263264        if strcmp(answer,'Yes')
    264             GeometryCalib.NbSlice=1;
    265             GeometryCalib.SliceCoord=[0 0 Z(1)];
     265            Slice.NbSlice=1;
     266            Slice.SliceCoord=[0 0 Z(1)];
     267            checkslice=1;% will document the item <Slice> in ImaDoc
    266268        end
    267269    end
     
    319321                end
    320322                errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file
     323                dispmessage='';
     324                if checkslice
     325                    errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the slice position in the xml file
     326                    dispmessage=' and slice position';
     327                end
    321328                if ~strcmp(errormsg,'')
    322329                    msgbox_uvmat('ERROR',errormsg);
    323330                else
    324331                    if check_update
    325                         display([XmlName ' updated with calibration parameters'])
     332                        display([XmlName ' updated with calibration parameters' dispmessage])
    326333                    else
    327                         display([XmlName ' created with calibration parameters'])
     334                        display([XmlName ' created with calibration parameters' dispmessage])
    328335                    end
    329                     %nbcalib=nbcalib+1;
    330336                end
    331337            end
     
    333339        msgbox_uvmat('CONFIMATION',['calibration replicated for ' num2str(NbExp) ' experiments']);
    334340    else
    335         %% copy the xml file from the old location if appropriate, then update with the calibration parameters
    336         if ~exist(outputfile,'file') && ~isempty(SubDirBase)
     341        %% update the calibration parameters in the currently opened uvmat GUI
     342        if ~exist(outputfile,'file') && ~isempty(SubDirBase) %copy the xml file from the old location if appropriate
    337343            oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml'];
    338344            if exist(oldxml,'file')
     
    341347        end
    342348        errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file
     349        if checkslice
     350                    errormsg=update_imadoc(Slice,outputfile,'Slice');% introduce the slice position in the xml file
     351        end
    343352        if ~strcmp(errormsg,'')
    344353            msgbox_uvmat('ERROR',errormsg);
    345354        end
    346355       
    347         %% display image with new calibration in the currently opened uvmat interface
     356        %% display image with new calibration in the currently opened uvmat GUI
    348357        FieldList=get(hhuvmat.FieldName,'String');
    349358        val=get(hhuvmat.FieldName,'Value');
     
    413422x_ima=Coord(:,4);
    414423y_ima=Coord(:,5);
    415 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera)
     424[Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera)
    416425GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    417426GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     
    436445    x_ima=Coord(:,4);
    437446    y_ima=Coord(:,5);
    438     [Xpoints,Ypoints]=px_XYZ(GeometryCalib,X,Y,Z);
     447    [Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],X,Y,Z);
    439448    GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    440449    GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     
    805814x_ima=Coord(:,4);
    806815y_ima=Coord(:,5);
    807 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
     816[Xpoints,Ypoints]=px_XYZ(Calib,[],X,Y,Z);
    808817ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
    809818ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
Note: See TracChangeset for help on using the changeset viewer.