Changeset 437 for trunk/src/civ_matlab.m


Ignore:
Timestamp:
Jun 4, 2012, 12:03:58 AM (12 years ago)
Author:
sommeria
Message:

rationalisation of civ parameter names
civ results now put in a directory outside the image directory.
*xml file management needs to be updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_matlab.m

    r435 r437  
    209209   
    210210    Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Patch1_Rho','Patch1_Threshold','Patch1_SubDomain'}];
    211     Data.Patch1_Rho=Param.Patch1.SmoothingParam;
     211    Data.Patch1_Rho=Param.Patch1.FieldSmooth;
    212212    Data.Patch1_Threshold=Param.Patch1.MaxDiff;
    213213    Data.Patch1_SubDomain=Param.Patch1.SubdomainSize;
     
    263263        par_civ2.ImageB=par_civ1.ImageB;
    264264    end
    265     ibx2=ceil(par_civ2.Bx/2);
    266     iby2=ceil(par_civ2.By/2);
     265    ibx2=ceil(par_civ2.CorrBoxSize(1)/2);
     266    iby2=ceil(par_civ2.CorrBoxSize(2)/2);
    267267    isx2=ibx2+4;% search ara +-4 pixels around the guess
    268268    isy2=iby2+4;
     
    308308        mask=imread(par_civ2.Mask);
    309309    end
    310     par_civ2.Searchx=2*isx2+1;
    311     par_civ2.Searchy=2*isy2+1;
    312     par_civ2.Shiftx=Shiftx(nbval>=1)./nbval(nbval>=1);
    313     par_civ2.Shifty=Shifty(nbval>=1)./nbval(nbval>=1);
    314     par_civ2.Grid=[GridX(nbval>=1)-par_civ2.Shiftx/2 GridY(nbval>=1)-par_civ2.Shifty/2];% grid taken at the extrapolated origin of the displacement vectors
     310    par_civ2.SearchBoxSize(1)=2*isx2+1;
     311    par_civ2.SearchBoxSize(2)=2*isy2+1;
     312    par_civ2.SearchBoxShift=[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
     313%     par_civ2.SearchBoxShift(2)=Shifty(nbval>=1)./nbval(nbval>=1);
     314    par_civ2.Grid=[GridX(nbval>=1)-par_civ2.SearchBoxShift(:,1)/2 GridY(nbval>=1)-par_civ2.SearchBoxShift(:,2)/2];% grid taken at the extrapolated origin of the displacement vectors
    315315    if par_civ2.CheckDeformation
    316316        par_civ2.DUDX=DUDX./nbval;
     
    392392if isfield (Param,'Patch2')
    393393    Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Patch2_Rho','Patch2_Threshold','Patch2_SubDomain'}];
    394     Data.Patch2_Rho=Param.Patch2.SmoothingParam;
     394    Data.Patch2_Rho=Param.Patch2.FieldSmooth;
    395395    Data.Patch2_Threshold=Param.Patch2.MaxDiff;
    396396    Data.Patch2_SubDomain=Param.Patch2.SubdomainSize;
     
    454454
    455455%% prepare grid
    456 ibx2=ceil(par_civ.Bx/2);
    457 iby2=ceil(par_civ.By/2);
    458 isx2=ceil(par_civ.Searchx/2);
    459 isy2=ceil(par_civ.Searchy/2);
    460 shiftx=round(par_civ.Shiftx);
    461 shifty=-round(par_civ.Shifty);% sign minus because image j index increases when y decreases
     456ibx2=ceil(par_civ.CorrBoxSize(1)/2);
     457iby2=ceil(par_civ.CorrBoxSize(2)/2);
     458isx2=ceil(par_civ.SearchBoxSize(1)/2);
     459isy2=ceil(par_civ.SearchBoxSize(2)/2);
     460shiftx=round(par_civ.SearchBoxShift(:,1));
     461shifty=-round(par_civ.SearchBoxShift(:,2));% sign minus because image j index increases when y decreases
    462462if isfield(par_civ,'Grid')
    463463    if ischar(par_civ.Grid)%read the drid file if the input is a file name
     
    466466    end
    467467else% automatic measurement grid
    468     ibx2=ceil(par_civ.Bx/2);
    469     iby2=ceil(par_civ.By/2);
    470     isx2=ceil(par_civ.Searchx/2);
    471     isy2=ceil(par_civ.Searchy/2);
     468%     ibx2=ceil(par_civ.Bx/2);
     469%     iby2=ceil(par_civ.By/2);
     470%     isx2=ceil(par_civ.Searchx/2);
     471%     isy2=ceil(par_civ.Searchy/2);
    472472    miniy=max(1+isy2+shifty,1+iby2);
    473473    minix=max(1+isx2-shiftx,1+ibx2);
     
    609609            if ~isempty(y) && ~isempty(x)
    610610                try
    611                     if par_civ.Rho==1
     611                    if par_civ.CorrSmooth==1
    612612                        [vector,F(ivec)] = SUBPIXGAUSS (result_conv,x,y);
    613                     elseif par_civ.Rho==2
     613                    elseif par_civ.CorrSmooth==2
    614614                        [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y);
    615615                    end
Note: See TracChangeset for help on using the changeset viewer.