Changeset 1112 for trunk


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

set_slice separated from geometrey_calib

Location:
trunk/src
Files:
11 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)));
  • trunk/src/mouse_motion.m

    r1107 r1112  
    497497%% draw ruler
    498498if test_ruler && isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'ruler')
    499     if isfield(AxeData,'RulerHandle')
     499    if isfield(AxeData,'RulerHandle') && ~isempty(findobj(AxeData.RulerHandle)) && size(xy,2)>=2
    500500        pointershape='crosshair'; %give  the mouse pointer a cross shape
    501501        RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)]; %coordinates defining the ruler segment
  • trunk/src/mouse_up.m

    r1107 r1112  
    363363    RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)];% append the recorded ruler origin to the current mouse coordinates
    364364    RulerCoord=diff(RulerCoord,1);% coordiante difference between segment end and beginning
    365     RulerCoord=RulerCoord(1)+i*RulerCoord(2);
     365    RulerCoord=RulerCoord(1)+1i*RulerCoord(2);
    366366    distance=abs(RulerCoord);
    367367    azimuth=(180/pi)*angle(RulerCoord);
    368368    msgbox_uvmat('RULER','',['length: ' num2str(distance,3) ',  angle(degrees): ' num2str(azimuth,3)])
     369    if isfield(AxeData,'RulerHanle')&&~isempty(findobj(AxeData.RulerHandle))
    369370    delete(AxeData.RulerHandle)%delete the ruler graphic object
    370371    AxeData=rmfield(AxeData,'RulerHandle');%remove the ruler handle in AxeData
     372    end
    371373    AxeData.Drawing='off';%exit the ruler drawing mode
    372374end
  • trunk/src/phys_XYZ.m

    r1111 r1112  
    3333%=======================================================================
    3434
    35 function [Xphys,Yphys,Zphys]=phys_XYZ(Calib,X,Y,Zindex)
     35function [Xphys,Yphys,Zphys]=phys_XYZ(Calib,Slice,X,Y,Zindex)
    3636%------------------------------------------------------------------------
    3737testangle=0;% =1 if the illumination plane is tilted with respect to the horizontal plane Xphys Yphys
    3838test_refraction=0;% =1 if the considered points are viewed through an horizontal interface (located at z=Calib.InterfaceCoord(3)')
    3939Zphys=0; %default output
    40 if exist('Zindex','var')&& isequal(Zindex,round(Zindex))&& Zindex>0 && isfield(Calib,'SliceCoord')&&size(Calib.SliceCoord,1)>=Zindex
    41     if isfield(Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=Zindex && ~isequal(Calib.SliceAngle(Zindex,:),[0 0 0])
     40if isempty(Slice)
     41    Slice=Calib;%old convention < 2022
     42end
     43if exist('Zindex','var')&& isequal(Zindex,round(Zindex))&& Zindex>0 && isfield(Slice,'SliceCoord')&&size(Slice.SliceCoord,1)>=Zindex
     44    if isfield(Slice, 'SliceAngle') && size(Slice.SliceAngle,1)>=Zindex && ~isequal(Slice.SliceAngle(Zindex,:),[0 0 0])
    4245        testangle=1;
    43         norm_plane=angle2normal(Calib.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane
     46        norm_plane=angle2normal(Slice.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane
    4447    end
    45     Z0=Calib.SliceCoord(Zindex,3);%horizontal plane z=cte
     48    Z0=Slice.SliceCoord(Zindex,3);%horizontal plane z=cte
    4649    Z0virt=Z0;
    47     if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')
    48         H=Calib.InterfaceCoord(3);% z position of the water surface
     50    if isfield(Slice,'InterfaceCoord') && isfield(Slice,'RefractionIndex')
     51        H=Slice.InterfaceCoord(3);% z position of the water surface
    4952        if H>Z0
    50             Z0virt=H-(H-Z0)/Calib.RefractionIndex; %corrected z (virtual object)
     53            Z0virt=H-(H-Z0)/Slice.RefractionIndex; %corrected z (virtual object)
    5154            test_refraction=1;
    5255        end
     
    8689        b=-norm_plane(2)/norm_plane(3);
    8790        if test_refraction
    88             avirt=a/Calib.RefractionIndex;
    89             bvirt=b/Calib.RefractionIndex;
     91            avirt=a/Slice.RefractionIndex;
     92            bvirt=b/Slice.RefractionIndex;
    9093        else
    9194            avirt=a;
    9295            bvirt=b;
    9396        end
    94         cvirt=Z0virt-avirt*Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
     97        cvirt=Z0virt-avirt*Slice.SliceCoord(Zindex,1)-bvirt*Slice.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
    9598                               % c=z coordinate at (x,y)=(0,0)
    96         c=Z0-a*Calib.SliceCoord(Zindex,1)-b*Calib.SliceCoord(Zindex,2);
     99        c=Z0-a*Slice.SliceCoord(Zindex,1)-b*Slice.SliceCoord(Zindex,2);
    97100        R(1)=R(1)+avirt*R(3);
    98101        R(2)=R(2)+bvirt*R(3);
  • trunk/src/phys_ima.m

    r1085 r1112  
    2727    npx=[npx siz(2)];
    2828    npy=[npy siz(1)];
    29     Calib=XmlData{icell}.GeometryCalib;
     29    Calib{icell}=XmlData{icell}.GeometryCalib;
     30    Slice{icell}=Calib{icell};
     31    if isfield(XmlData{icell},'Slice')
     32    Slice{icell}=XmlData{icell}.Slice;
     33    end
    3034    coord_x=[0.5 siz(2)-0.5];
    3135    coord_y=[0.5 siz(1)-0.5];
     
    3438    y_edge=[coord_y(1)*ones(1,npx(icell)) linspace(coord_y(1),coord_y(end),npy(icell))...
    3539        coord_y(end)*ones(1,npx(icell)) linspace(coord_y(end),coord_y(1),npy(icell))];%y coordinates of the image edge(four sides)
    36     [xcorner_new,ycorner_new]=phys_XYZ(Calib,x_edge,y_edge,ZIndex);%corresponding physical coordinates
     40    [xcorner_new,ycorner_new]=phys_XYZ(Calib{icell},Slice{icell},x_edge,y_edge,ZIndex);%corresponding physical coordinates
    3741    dx(icell)=(max(xcorner_new)-min(xcorner_new))/(siz(2)-1);
    3842    dy(icell)=(max(ycorner_new)-min(ycorner_new))/(siz(1)-1);
     
    5458A_out=cell(1,numel(A));
    5559
    56 for icell=1:length(A)
    57     Calib=XmlData{icell}.GeometryCalib;
     60for icell=1:numel(A)
    5861    % rescaling of the image coordinates without change of the image array
    59     if strcmp(Calib.CalibrationType,'rescale') && isequal(Calib,XmlData{1}.GeometryCalib)
     62    if strcmp(Calib{icell}.CalibrationType,'rescale') && isequal(Calib,XmlData{1}.GeometryCalib)
    6063        A_out{icell}=A{icell};%no transform
    6164        Rangx=[0.5 npx-0.5];%image coordiantes of corners
    6265        Rangy=[npy-0.5 0.5];
    63         [Rangx]=phys_XYZ(Calib,Rangx,[0.5 0.5],ZIndex);%case of translations without rotation and quadratic deformation
    64         [~,Rangy]=phys_XYZ(Calib,[0.5 0.5],Rangy,ZIndex);
     66        [Rangx]=phys_XYZ(Calib{icell},[],Rangx,[0.5 0.5],ZIndex);%case of translations without rotation and quadratic deformation
     67        [~,Rangy]=phys_XYZ(Calib{icell},[],[0.5 0.5],Rangy,ZIndex);
    6568    else
    6669        % the image needs to be interpolated to the new coordinates
    6770        Z=0; %default
    68         if isfield(Calib,'SliceCoord')&& size(Calib.SliceCoord,1)>=ZIndex %.Z= index of plane
    69             SliceCoord=Calib.SliceCoord(ZIndex,:);
     71        if isfield(Slice{icell},'SliceCoord')&& size(Slice{icell}.SliceCoord,1)>=ZIndex %.Z= index of plane
     72            SliceCoord=Slice{icell}.SliceCoord(ZIndex,:);
    7073            Z=SliceCoord(3);
    71             if isfield(Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=ZIndex && ~isequal(Calib.SliceAngle(ZIndex,:),[0 0 0])
    72                 norm_plane=angle2normal(Calib.SliceAngle(ZIndex,:));
     74            if isfield(Slice{icell}, 'SliceAngle') && size(Slice{icell}.SliceAngle,1)>=ZIndex && ~isequal(Slice{icell}.SliceAngle(ZIndex,:),[0 0 0])
     75                norm_plane=angle2normal(Slice{icell}.SliceAngle(ZIndex,:));
    7376                Z=Z-(norm_plane(1)*(X-SliceCoord(1))+norm_plane(2)*(Y-SliceCoord(2)))/norm_plane(3);
    7477            end
     
    7780        yima=npy(icell)-0.5:-1:0.5;
    7881        [XIMA_init,YIMA_init]=meshgrid(xima,yima);%grid of initial image in px coordinates
    79         [XIMA,YIMA]=px_XYZ(XmlData{icell}.GeometryCalib,X,Y,Z);% image coordinates for each point in the real
     82        [XIMA,YIMA]=px_XYZ(Calib{icell},Slice{icell},X,Y,Z);% image coordinates for each point in the real
    8083        testuint8=isa(A{icell},'uint8');
    8184        testuint16=isa(A{icell},'uint16');
  • trunk/src/px_XYZ.m

    r1111 r1112  
    2828%=======================================================================
    2929
    30 function [X,Y]=px_XYZ(Calib,Xphys,Yphys,Zphys)
     30function [X,Y]=px_XYZ(Calib,Slice,Xphys,Yphys,Zphys)
    3131if ~exist('Zphys','var')
    3232    Zphys=0;
     
    4040
    4141%%%%%%%%%%%%%
     42if isempty(Slice)
     43    Slice=Calib;
     44end
    4245% general case
    4346if isfield(Calib,'R')
    4447    R=(Calib.R)';
    4548    %correct z for refraction if needed
    46     if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')
    47         H=Calib.InterfaceCoord(3);
     49    if isfield(Slice,'InterfaceCoord') && isfield(Slice,'RefractionIndex')
     50        H=Slice.InterfaceCoord(3);
    4851        if H>Zphys
    49             Zphys=H-(H-Zphys)/Calib.RefractionIndex; %corrected z (virtual object)Calib
     52            Zphys=H-(H-Zphys)/Slice.RefractionIndex; %corrected z (virtual object)Calib
    5053           
    5154          %  test_refraction=1;
  • trunk/src/series/extract_rdvision.m

    r1110 r1112  
    1 %'extract_rdvision': relabel an image series with two indices, and correct errors from the RDvision transfer program
     1%'extunningact_rdvision': relabel an image series with two indices, and correct errors from the RDvision transfer program
    22%------------------------------------------------------------------------
    33% function ParamOut=extract_rdvision(Param)
  • trunk/src/set_grid.m

    r1107 r1112  
    258258    end
    259259    tsaiA=[];%default
     260    SliceA=[];
    260261    if exist(fileAxml,'file')
    261262        [XmlDataA,errormsg]=imadoc2struct(fileAxml);
     
    266267        if isfield(XmlDataA,'GeometryCalib')
    267268            tsaiA=XmlDataA.GeometryCalib;
     269            SliceA=tsaiA;%default
     270        end
     271        if isfield(XmlDataA,'Slice')
     272            SliceA=XmlDataA.Slice;
    268273        end
    269274    end
     
    271276        msgbox_uvmat('WARNING','no geometric calibration available for image A, phys =pixel')
    272277    else
    273         [grid_x_imaA,grid_y_imaA]=px_XYZ(tsaiA,grid_x,grid_y,GUI.Z);
     278        [grid_x_imaA,grid_y_imaA]=px_XYZ(tsaiA,SliceA,grid_x,grid_y,GUI.Z);
    274279    end
    275280end
     
    293298    end
    294299    tsaiB=[];%default
     300    SliceB=[];
    295301    if exist(fileBxml,'file')
    296302        [XmlDataB,errormsg]=imadoc2struct(fileBxml);
     
    301307        if isfield(XmlDataB,'GeometryCalib')
    302308            tsaiB=XmlDataB.GeometryCalib;
     309            SliceB=tsaiB;%default
     310        end
     311        if isfield(XmlDataB,'Slice')
     312            SliceB=XmlDataB.Slice;
    303313        end
    304314    end
     
    308318        grid_y_imaB=grid_y;
    309319    else
    310         [grid_x_imaB,grid_y_imaB]=px_XYZ(tsaiB,grid_x,grid_y,GUI.Z);
     320        [grid_x_imaB,grid_y_imaB]=px_XYZ(tsaiB,SliceB,grid_x,grid_y,GUI.Z);
    311321    end
    312322    B=imread(GUI.ImageB);
  • trunk/src/transform_field/phys.m

    r1107 r1112  
    5555DataOut=DataIn;%default first output field
    5656if nargin>=2 % nargin =nbre of input variables
     57     Calib{1}=[];
    5758    if isfield(XmlData,'GeometryCalib')
    5859        Calib{1}=XmlData.GeometryCalib;
    59     else
    60         Calib{1}=[];
     60    end
     61    Slice{1}=Calib{1};
     62    if isfield(XmlData,'Slice')
     63        Slice{1}=XmlData.Slice;
    6164    end
    6265    if nargin>=3  %two input fields
    6366        DataOut_1=DataIn_1;%default second output field
    64         if nargin>=4 && isfield(XmlData_1,'GeometryCalib')
    65             Calib{2}=XmlData_1.GeometryCalib;
    66         else
    67             Calib{2}=Calib{1};
     67        Calib{2}=Calib{1};
     68        if nargin>=4
     69            if isfield(XmlData_1,'GeometryCalib')
     70                Calib{2}=XmlData_1.GeometryCalib;
     71            end
     72            Slice{2}=Calib{2};
     73            if isfield(XmlData_1,'Slice')
     74                Slice{2}=XmlData_1.Slice;
     75            end
    6876        end
    6977    end
     
    7179
    7280%% get the z index defining the section plane
     81ZIndex=1;
    7382if isfield(DataIn,'ZIndex')&&~isempty(DataIn.ZIndex)&&~isnan(DataIn.ZIndex)
    7483    ZIndex=DataIn.ZIndex;
    75 else
    76     ZIndex=1;
    7784end
    7885
     
    8289if  ~isempty(Calib{1})
    8390    if isfield(Calib{1},'CalibrationType')&& isfield(Calib{1},'CoordUnit') && isfield(DataIn,'CoordUnit')&& strcmp(DataIn.CoordUnit,'pixel')   
    84         DataOut=phys_1(DataIn,Calib{1},ZIndex);% transform coordinates and velocity components
     91        DataOut=phys_1(DataIn,Calib{1},Slice{1},ZIndex);% transform coordinates and velocity components
    8592        %case of images or scalar: in case of two input fields, we need to project the transform  on the same regular grid
    8693        if isfield(DataIn,'A') && isfield(DataIn,'Coord_x') && ~isempty(DataIn.Coord_x) && isfield(DataIn,'Coord_y')&&...
     
    94101
    95102%% document the selected  plane position and angle if relevant
    96 if  checktransform && isfield(Calib{1},'SliceCoord')&&size(Calib{1}.SliceCoord,1)>=ZIndex
    97     DataOut.PlaneCoord=Calib{1}.SliceCoord(ZIndex,:);% transfer the slice position corresponding to index ZIndex
    98     if isfield(Calib{1},'SliceAngle') % transfer the slice rotation angles
    99         if isequal(size(Calib{1}.SliceAngle,1),1)% case of a unique angle
    100             DataOut.PlaneAngle=Calib{1}.SliceAngle;
     103if  checktransform && isfield(Slice{1},'SliceCoord')&&size(Slice{1}.SliceCoord,1)>=ZIndex
     104    DataOut.PlaneCoord=Slice{1}.SliceCoord(ZIndex,:);% transfer the slice position corresponding to index ZIndex
     105    if isfield(Slice{1},'SliceAngle') % transfer the slice rotation angles
     106        if isequal(size(Slice{1}.SliceAngle,1),1)% case of a unique angle
     107            DataOut.PlaneAngle=Slice{1}.SliceAngle;
    101108        else  % case of multiple planes with different angles: select the plane with index ZIndex
    102             DataOut.PlaneAngle=Calib{1}.SliceAngle(ZIndex,:);
     109            DataOut.PlaneAngle=Slice{1}.SliceAngle(ZIndex,:);
    103110        end
    104111    end
     
    113120    end
    114121    if isfield(Calib{2},'CalibrationType')&&isfield(Calib{2},'CoordUnit') && isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel')
    115         DataOut_1=phys_1(DataOut_1,Calib{2},ZIndex);
    116         if isfield(Calib{1},'SliceCoord')
    117             if ~(isfield(Calib{2},'SliceCoord') && isequal(Calib{2}.SliceCoord,Calib{1}.SliceCoord))
     122        DataOut_1=phys_1(DataOut_1,Calib{2},Slice{2},ZIndex);
     123        if isfield(Slice{2},'SliceCoord')
     124            if ~(isfield(Slice{2},'SliceCoord') && isequal(Slice{2}.SliceCoord,Slice{1}.SliceCoord))
    118125                DataOut_1.Txt='different plane positions for the two input fields';
    119126                return
    120127            end
    121128            DataOut_1.PlaneCoord=DataOut.PlaneCoord;% same plane position for the two input fields
    122             if isfield(Calib{1},'SliceAngle')
    123                 if ~(isfield(Calib{2},'SliceAngle') && isequal(Calib{2}.SliceAngle,Calib{1}.SliceAngle))
     129            if isfield(Slice{1},'SliceAngle')
     130                if ~(isfield(Slice{2},'SliceAngle') && isequal(Slice{2}.SliceAngle,Slice{1}.SliceAngle))
    124131                    DataOut_1.Txt='different plane angles for the two input fields';
    125132                    return
     
    131138                ~isempty(DataIn_1.Coord_y)&&length(DataIn_1.A)>1
    132139            iscalar=iscalar+1;
    133             Calib{iscalar}=Calib{2};
     140%             Calib{iscalar}=Calib{2};
    134141            A{iscalar}=DataIn_1.A;
    135142        end
     
    163170%------------------------------------------------
    164171%--- transform a single field
    165 function DataOut=phys_1(Data,Calib,ZIndex)
     172function DataOut=phys_1(Data,Calib,Slice,ZIndex)
    166173%------------------------------------------------
    167174%% set default output
     
    171178%% transform  X,Y coordinates for velocity fields (transform of an image or scalar done in phys_ima)
    172179if isfield(Data,'X') &&isfield(Data,'Y')&&~isempty(Data.X) && ~isempty(Data.Y)
    173   [DataOut.X,DataOut.Y]=phys_XYZ(Calib,Data.X,Data.Y,ZIndex);
     180  [DataOut.X,DataOut.Y]=phys_XYZ(Calib,Slice,Data.X,Data.Y,ZIndex);
    174181    Dt=1; %default
    175182    if isfield(Data,'dt')&&~isempty(Data.dt)
     
    180187    end
    181188    if isfield(Data,'U')&&isfield(Data,'V')&&~isempty(Data.U) && ~isempty(Data.V)
    182         [XOut_1,YOut_1]=phys_XYZ(Calib,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);
    183         [XOut_2,YOut_2]=phys_XYZ(Calib,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);
     189        [XOut_1,YOut_1]=phys_XYZ(Calib,Slice,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);
     190        [XOut_2,YOut_2]=phys_XYZ(Calib,Slice,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);
    184191        DataOut.U=(XOut_2-XOut_1)/Dt;
    185192        DataOut.V=(YOut_2-YOut_1)/Dt;
     
    213220    % estimate the Jacobian matrix DXpx/DXphys
    214221    for ip=1:length(Data.X)
    215         [Xp1,Yp1]=phys_XYZ(Calib,Data.X(ip)+0.5,Data.Y(ip),ZIndex);
    216         [Xm1,Ym1]=phys_XYZ(Calib,Data.X(ip)-0.5,Data.Y(ip),ZIndex);
    217         [Xp2,Yp2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)+0.5,ZIndex);
    218         [Xm2,Ym2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)-0.5,ZIndex);
     222        [Xp1,Yp1]=phys_XYZ(Calib,Slice,Data.X(ip)+0.5,Data.Y(ip),ZIndex);
     223        [Xm1,Ym1]=phys_XYZ(Calib,Slice,Data.X(ip)-0.5,Data.Y(ip),ZIndex);
     224        [Xp2,Yp2]=phys_XYZ(Calib,Slice,Data.X(ip),Data.Y(ip)+0.5,ZIndex);
     225        [Xm2,Ym2]=phys_XYZ(Calib,Slice,Data.X(ip),Data.Y(ip)-0.5,ZIndex);
    219226        %Jacobian matrix DXpphys/DXpx
    220227        DjXi(1,1)=(Xp1-Xm1);
  • trunk/src/transform_field/phys_polar.m

    r1107 r1112  
    7878Data=DataIn; %default output
    7979if isfield(Data,'CoordUnit')
    80 Data=rmfield(Data,'CoordUnit');
     80    Data=rmfield(Data,'CoordUnit');
    8181end
    8282Data.ListVarName = {};
     
    8585DataCell{1}=DataIn;
    8686Calib{1}=[];
     87Slice{1}=[];
    8788DataCell{2}=[];%default
    8889checkpixel(1)=0;
    89 if isfield(DataCell{1},'CoordUnit')&& strcmp(DataCell{1}.CoordUnit,'pixel') 
     90if isfield(DataCell{1},'CoordUnit')&& strcmp(DataCell{1}.CoordUnit,'pixel')
    9091    checkpixel(1)=1;
    9192end
     
    9495        Calib{1}=XmlData.GeometryCalib;
    9596    end
     97    Slice{1}=Calib{1};
     98    if isfield(XmlData,'Slice')
     99        Slice{1}=XmlData.Slice;
     100    end
    96101    Calib{2}=Calib{1};
     102    Slice{2}=Slice{1};
    97103else
    98104    Data.Txt='wrong input: need two or four structures';
     
    101107if nargin==4% case of two input fields
    102108    checkpixel(2)=0;
    103 if isfield(DataCell{2},'CoordUnit')&& strcmp(DataCell{2}.CoordUnit,'pixel')
    104     checkpixel(2)=1;
    105 end
     109    if isfield(DataCell{2},'CoordUnit')&& strcmp(DataCell{2}.CoordUnit,'pixel')
     110        checkpixel(2)=1;
     111    end
    106112    DataCell{2}=DataIn_1;%default
    107113    if isfield(XmlData_1,'GeometryCalib')&& ~isempty(XmlData_1.GeometryCalib) && checkpixel(2)
    108114        Calib{2}=XmlData_1.GeometryCalib;
     115    end
     116    if isfield(XmlData_1,'Slice')
     117        Slice{2}=XmlData_1.Slice;
    109118    end
    110119    nbinput=2;
     
    218227                    if ~isempty(Calib{ifield})
    219228                        [X,Y,Z,DataCell{ifield}.(UName),DataCell{ifield}.(VName)]=...
    220                             phys_XYUV(DataCell{ifield},Calib{ifield},ZIndex);
     229                            phys_XYUV(DataCell{ifield},Calib{ifield},Slice{ifield},ZIndex);
    221230                    end
    222231                end
     
    304313                    ZInd(nbgrid)=ZIndex;
    305314                    Calib_new{nbgrid}=Calib{ifield};
     315                    Slice_new{nbgrid}=Slice{ifield};
    306316                end
    307317                if isfield(CellInfo{icell},'VarIndex_vector_x')&& isfield(CellInfo{icell},'VarIndex_vector_y')
     
    325335                    Calib_new{nbgrid+1}=Calib{ifield};
    326336                    Calib_new{nbgrid+2}=Calib{ifield};
     337                    Slice_new{nbgrid+1}=Calib{ifield};
     338                    Slice_new{nbgrid+2}=Calib{ifield};
    327339                    nbgrid=nbgrid+2;
    328340                    nbvar=nbvar+2;
     
    335347%% tranform cartesian to polar coordinates for gridded data
    336348if nbgrid~=0
    337     [A,Data.radius,Data.theta]=phys_Ima_polar(A,coord_x,coord_y,Calib_new,ZInd,origin_xy,radius_offset,angle_offset,angle_scale);
     349    [A,Data.radius,Data.theta]=phys_Ima_polar(A,coord_x,coord_y,Calib_new,Slice_new,ZInd,origin_xy,radius_offset,angle_offset,angle_scale);
    338350    for icell=1:numel(A)
    339351        if icell<=numel(A)-1 && check_vector(icell)==1 && check_vector(icell+1)==1   %transform u,v into polar coordinates
     
    373385%------------------------------------------------
    374386%--- transform a single field into phys coordiantes
    375 function [X,Y,Z,U,V]=phys_XYUV(Data,Calib,ZIndex)
     387function [X,Y,Z,U,V]=phys_XYUV(Data,Calib,Slice,ZIndex)
    376388%------------------------------------------------
    377389%% set default output
     
    385397%% transform  X,Y coordinates for velocity fields (transform of an image or scalar done in phys_ima)
    386398if isfield(Data,'X') &&isfield(Data,'Y')&&~isempty(Data.X) && ~isempty(Data.Y)
    387     [X,Y,Z]=phys_XYZ(Calib,Data.X,Data.Y,ZIndex);
     399    [X,Y,Z]=phys_XYZ(Calib,Slice,Data.X,Data.Y,ZIndex);
    388400    Dt=1; %default
    389401    if isfield(Data,'dt')&&~isempty(Data.dt)
     
    394406    end
    395407    if isfield(Data,'U')&&isfield(Data,'V')&&~isempty(Data.U) && ~isempty(Data.V)
    396         [XOut_1,YOut_1]=phys_XYZ(Calib,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);
    397         [XOut_2,YOut_2]=phys_XYZ(Calib,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);
     408        [XOut_1,YOut_1]=phys_XYZ(Calib,Slice,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);
     409        [XOut_2,YOut_2]=phys_XYZ(Calib,Slice,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);
    398410        U=(XOut_2-XOut_1)/Dt;
    399411        V=(YOut_2-YOut_1)/Dt;
     
    404416% tranform gridded field into polar coordiantes on a regular polar grid,
    405417% transform to phys coordiantes if requested by calibration input
    406 function [A_out,radius,theta]=phys_Ima_polar(A,coord_x,coord_y,CalibIn,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale)
     418function [A_out,radius,theta]=phys_Ima_polar(A,coord_x,coord_y,CalibIn,SliceIn,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale)
    407419rcorner=[];
    408420thetacorner=[];
     
    420432    % transform edges into phys coordinates if requested
    421433    if ~isempty(CalibIn{icell})
    422         [x_edge,y_edge]=phys_XYZ(CalibIn{icell},x_edge,y_edge,ZIndex(icell));% physical coordinates of the image edge
     434        [x_edge,y_edge]=phys_XYZ(CalibIn{icell},SliceIn{icell},x_edge,y_edge,ZIndex(icell));% physical coordinates of the image edge
    423435    end
    424436   
  • trunk/src/uvmat.m

    r1110 r1112  
    12081208
    12091209UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    1210 % check=0;
    1211 if isfield(UvData,'XmlData')&&isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord')
    1212     GeometryCalib=UvData.XmlData{1}.GeometryCalib;
    1213 else
    1214     msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices')
    1215     return
    1216 end
    1217 SliceCoord=GeometryCalib.SliceCoord;
    1218 InterfaceCoord=min(SliceCoord(:,3));
    1219 if isfield(GeometryCalib,'InterfaceCoord')
    1220     InterfaceCoord=GeometryCalib.InterfaceCoord(1,3);
    1221 end
    1222 NbSlice=size(SliceCoord,1);
     1210Slice=[];
     1211if isfield(UvData,'XmlData')
     1212    if isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord')
     1213        Slice=UvData.XmlData{1}.GeometryCalib;%old convention < 2022
     1214    elseif isfield(UvData.XmlData{1},'Slice')
     1215        Slice=UvData.XmlData{1}.Slice;% new convention ( 2022)
     1216    end
     1217end
     1218% default input
     1219if ~(isfield(Slice,'SliceCoord') && size(Slice.SliceCoord,2)==3)
     1220    Slice.SliceCoord=[0 0 0];
     1221end
     1222InterfaceCoord=min(Slice.SliceCoord(:,3));
     1223if isfield(Slice,'InterfaceCoord')
     1224    InterfaceCoord=Slice.InterfaceCoord(1,3);
     1225end
     1226NbSlice=size(Slice.SliceCoord,1);
    12231227CheckVolumeScan=0;
    1224 if isfield(GeometryCalib,'CheckVolumeScan')
    1225     CheckVolumeScan=GeometryCalib.CheckVolumeScan;
     1228if isfield(Slice,'CheckVolumeScan')
     1229    CheckVolumeScan=Slice.CheckVolumeScan;
    12261230end
    12271231RefractionIndex=1.33;
    12281232CheckRefraction=0;% default value of the check box refraction
    1229 if isfield(GeometryCalib,'RefractionIndex')
    1230     RefractionIndex=GeometryCalib.RefractionIndex;
     1233if isfield(Slice,'RefractionIndex')
     1234    RefractionIndex=Slice.RefractionIndex;
    12311235    CheckRefraction=1;
    12321236end
    12331237SliceAngle=[0 0 0];
    1234 if isfield(GeometryCalib,'SliceAngle')
    1235     SliceAngle=GeometryCalib.SliceAngle;
     1238if isfield(Slice,'SliceAngle')
     1239    SliceAngle=Slice.SliceAngle;
    12361240end
    12371241
     
    12441248Bottom=ScreenSize(4)-Height-40; %put fig at top right
    12451249hfig=findobj(allchild(0),'Tag','set_slice');
    1246 if ~isempty(hfig),delete(hfig), end; %delete existing version of the GUI
    1247 hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',GeometryCalib);
     1250if ~isempty(hfig),delete(hfig), end %delete existing version of the GUI
     1251hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',Slice);
    12481252BackgroundColor=get(hfig,'Color');
    12491253hh=0.14; % box height (relative)
     
    12621266    'String','Z','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
    12631267uicontrol('Style','edit','Units','normalized', 'Position', [2*ii+ww 0.95-2*ii-hh ww hh],'tag','num_Z_1','BackgroundColor',[1 1 1],...
    1264     'String',num2str(SliceCoord(1,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_1'': z position of first slice');%edit box
     1268    'String',num2str(Slice.SliceCoord(1,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_1'': z position of first slice');%edit box
    12651269uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-2*ii-hh ww hh],'tag','num_Z_2','BackgroundColor',[1 1 1],...
    1266     'String',num2str(SliceCoord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box
     1270    'String',num2str(Slice.SliceCoord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box
    12671271uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-2*ii-hh ww hh],'tag','num_H','BackgroundColor',[1 1 1],...
    12681272    'String',num2str(InterfaceCoord),'Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_H'': z position of the water surface (=Z_1 in air)');%edit box
     
    12911295
    12921296uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceCoord_1','BackgroundColor',[1 1 1],...
    1293     'String',num2str(SliceCoord(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box
     1297    'String',num2str(Slice.SliceCoord(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box
    12941298uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceCoord_2','BackgroundColor',[1 1 1],...
    1295     'String',num2str(SliceCoord(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box
     1299    'String',num2str(Slice.SliceCoord(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box
    12961300
    12971301uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4*hh 1.3*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_1',...
     
    13491353[RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(FileName);
    13501354XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file
    1351 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');%read the xml file
    1352 if~isempty(errormsg)
    1353     msgbox_uvmat('ERROR',errormsg)
    1354     return
    1355 end
    1356 GeometryCalib=s.GeometryCalib;% get thegeometric calibration data
     1355% [s,errormsg]=imadoc2struct(XmlFile,'Slice');%read the xml file
     1356% if~isempty(errormsg)
     1357%     msgbox_uvmat('ERROR',errormsg)
     1358%     return
     1359% end
     1360% Slice=s.Slice;% get thegeometric calibration data
    13571361
    13581362%% read the content of the GUI set_slice
     
    13611365Z_plane=str2num(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector
    13621366SliceData=read_GUI(hset_slice);
    1363 GeometryCalib.NbSlice=SliceData.NbSlice;
    1364 GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan;
     1367Slice.NbSlice=SliceData.NbSlice;
     1368Slice.CheckVolumeScan=SliceData.CheckVolumeScan;
    13651369if numel(Z_plane)<=2
    13661370    Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
     
    13681372    set(hZ,'String',num2str(Z_plane))% restitute the display qfter reqding by read_GUI
    13691373end
    1370 GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
    1371 GeometryCalib.SliceCoord(:,1)=SliceData.SliceCoord(1);
    1372 GeometryCalib.SliceCoord(:,2)=SliceData.SliceCoord(2);
    1373 GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
     1374Slice.SliceCoord=Z_plane'*[0 0 1];
     1375Slice.SliceCoord(:,1)=SliceData.SliceCoord(1);
     1376Slice.SliceCoord(:,2)=SliceData.SliceCoord(2);
     1377Slice.SliceAngle=zeros(Slice.NbSlice,3);
    13741378Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice);
    13751379Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice);
    1376 GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation angle around x axis
    1377 GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation angle around y axis
    1378 GeometryCalib.SliceAngle(:,3)=0;
     1380Slice.SliceAngle(:,1)=Angle_1';%rotation angle around x axis
     1381Slice.SliceAngle(:,2)=Angle_2';%rotation angle around y axis
     1382Slice.SliceAngle(:,3)=0;
    13791383if SliceData.CheckRefraction
    1380     GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
    1381     GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
    1382 elseif isfield(GeometryCalib,'RefractionIndex')
    1383     GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');
    1384     GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');
     1384    Slice.InterfaceCoord=[0 0 SliceData.H];
     1385    Slice.RefractionIndex=SliceData.RefractionIndex;
     1386elseif isfield(Slice,'RefractionIndex')
     1387    Slice=rmfield(Slice,'RefractionIndex');
     1388    Slice=rmfield(Slice,'InterfaceCoord');
    13851389end
    13861390
     
    14301434                check_update=0;
    14311435            end
    1432             errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file
     1436            errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the calibration data in the xml file
    14331437            if ~strcmp(errormsg,'')
    14341438                msgbox_uvmat('ERROR',errormsg);
     
    14461450   
    14471451    %% store the result in the xml file used for calibration
    1448     errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file
     1452    errormsg=update_imadoc(Slice,XmlFile,'Slice');% introduce the calibration data in the xml file
    14491453    if strcmp(errormsg,'')
    14501454        msgbox_uvmat('CONFIRMATION',['slice positions saved in ' XmlFile]);
     
    19251929                            pos(:,3)=pos(:,3)+Calib.SliceCoord(3);
    19261930                        end
    1927                         [X,Y]=px_XYZ(Calib,pos(:,1),pos(:,2),pos(:,3));
     1931                        [X,Y]=px_XYZ(Calib,Slice,pos(:,1),pos(:,2),pos(:,3));
    19281932                    end
    19291933                    flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
     
    24792483        drawnow
    24802484        if isfield(XmlDataRead, 'GeometryCalib') && ~isempty(XmlDataRead.GeometryCalib)
    2481             XmlData.GeometryCalib=XmlDataRead.GeometryCalib;
    2482             if isfield(XmlData.GeometryCalib,'CheckVolumeScan') && isequal(XmlData.GeometryCalib.CheckVolumeScan,1)
     2485            XmlData.GeometryCalib=XmlDataRead.GeometryCalib;     
     2486        end
     2487        XmlData.Slice=XmlData.GeometryCalib;%default
     2488        if isfield(XmlDataRead, 'Slice') && ~isempty(XmlDataRead.Slice)
     2489            XmlData.Slice=XmlDataRead.Slice;
     2490            % check whether the GUI geometry_calib is opened
     2491%             hgeometry_calib=findobj('tag','geometry_calib');
     2492%             if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param
     2493%                 GUserData=get(hgeometry_calib,'UserData');
     2494%                 if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName))
     2495%                     answer=msgbox_uvmat('INPUT_Y-N','refresh the display of the GUI geometry_calib with the new input data?');
     2496%                     if strcmp(answer,'Yes')
     2497%                         geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib
     2498%                     end
     2499%                 end
     2500%             end
     2501        end
     2502        if isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1)
    24832503                set (handles.slices,'String','volume')
    24842504            end
    2485             % check whether the GUI geometry_calib is opened
    2486             hgeometry_calib=findobj('tag','geometry_calib');
    2487             if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param
    2488                 GUserData=get(hgeometry_calib,'UserData');
    2489                 if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName))
    2490                     answer=msgbox_uvmat('INPUT_Y-N','refresh the display of the GUI geometry_calib with the new input data?');
    2491                     if strcmp(answer,'Yes')
    2492                         geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib
    2493                     end
    2494                 end
    2495             end
    2496         end
    24972505        if isfield(XmlDataRead, 'LIFCalib')
    24982506            XmlData.LIFCalib=XmlDataRead.LIFCalib;
     
    25712579            set(handles.TransformName,'Value',3); % phys transform by default if fixedLimits is off
    25722580        end
    2573         if isfield(GeometryCalib,'SliceCoord')
    2574            siz=size(GeometryCalib.SliceCoord);
     2581        if isfield(XmlData.Slice,'SliceCoord')
     2582           siz=size(XmlData.Slice.SliceCoord);
    25752583           if siz(1)>1
    25762584               NbSlice=siz(1);
     
    25782586               set(handles.slices,'Value',1)
    25792587           end
    2580            if isfield(GeometryCalib,'CheckVolumeScan') && isequal(GeometryCalib.CheckVolumeScan,1)
     2588           if isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1)
    25812589               set(handles.num_NbSlice,'Visible','off')
    25822590           else
     
    51835191                    Y=ObjectData.Coord(:,2);
    51845192                    if testphys
    5185                         [X,Y]=px_XYZ(Calib,X,Y,0);% to generalise with 3D cases
     5193                        [X,Y]=px_XYZ(Calib,[],X,Y,0);% to generalise with 3D cases
    51865194                    end
    51875195                    flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
Note: See TracChangeset for help on using the changeset viewer.