Ignore:
Timestamp:
Apr 5, 2010, 3:11:51 AM (14 years ago)
Author:
sommeria
Message:

time_series: subdir for result /time_series
mouse_motio: attempt to improve the circle marking vectors: use Visible off and on.
phys: bug repair for combining two images
set_oject: bug repair for creating new object
--This line those below, will be ignored--time_series

M src/series/time_series.m
M src/mouse_motion.m
M src/transform_field/phys.m
M src/set_object.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/transform_field/phys.m

    r40 r79  
    168168    yima=[0.5 0.5 siz(1)-0.5 siz(1)-0.5];
    169169    [xcorner_new,ycorner_new]=phys_XYZ(Calib,xima,yima,ZIndex);%corresponding physical coordinates
     170    dx(icell)=(max(xcorner_new)-min(xcorner_new))/(siz(2)-1);
     171    dy(icell)=(max(ycorner_new)-min(ycorner_new))/(siz(1)-1);
    170172    xcorner=[xcorner xcorner_new];
    171173    ycorner=[ycorner ycorner_new];
     
    176178Rangy(1)=max(ycorner);
    177179test_multi=(max(npx)~=min(npx)) | (max(npy)~=min(npy));
    178 npx=max(npx);
    179 npy=max(npy);
    180 x=linspace(Rangx(1),Rangx(2),npx);
    181 y=linspace(Rangy(1),Rangy(2),npy);
     180npX=1+round((Rangx(2)-Rangx(1))/min(dx));% nbre of pixels in the new image (use the finest resolution min(dx) in the set of images)
     181npY=1+round((Rangy(1)-Rangy(2))/min(dy));
     182x=linspace(Rangx(1),Rangx(2),npX);
     183y=linspace(Rangy(1),Rangy(2),npY);
    182184[X,Y]=meshgrid(x,y);%grid in physical coordiantes
    183185vec_B=[];
     
    192194           zphys=SliceCoord(3); %to generalize for non-parallel planes
    193195        end
    194         [XIMA,YIMA]=px_XYZ(CalibIn{icell},X,Y,zphys);%corresponding image indices for each point in the real space grid
    195         XIMA=reshape(round(XIMA),1,npx*npy);%indices reorganized in 'line'
    196         YIMA=reshape(round(YIMA),1,npx*npy);
    197         flagin=XIMA>=1 & XIMA<=npx & YIMA >=1 & YIMA<=npy;%flagin=1 inside the original image
     196        [XIMA,YIMA]=px_XYZ(CalibIn{icell},X,Y,zphys);% image coordinates for each point in the real space grid
     197        XIMA=reshape(round(XIMA),1,npX*npY);%indices reorganized in 'line'
     198        YIMA=reshape(round(YIMA),1,npX*npY);
     199        flagin=XIMA>=1 & XIMA<=npx(icell) & YIMA >=1 & YIMA<=npy(icell);%flagin=1 inside the original image
    198200        testuint8=isa(A{icell},'uint8');
    199201        testuint16=isa(A{icell},'uint16');
    200202        if numel(siz)==2 %(B/W images)
    201             vec_A=reshape(A{icell},1,npx*npy);%put the original image in line
     203            vec_A=reshape(A{icell},1,npx(icell)*npy(icell));%put the original image in line
    202204            ind_in=find(flagin);
    203205            ind_out=find(~flagin);
    204             ICOMB=((XIMA-1)*npy+(npy+1-YIMA));
     206            ICOMB=((XIMA-1)*npy(icell)+(npy(icell)+1-YIMA));
    205207            ICOMB=ICOMB(flagin);%index corresponding to XIMA and YIMA in the aligned original image vec_A
    206208            vec_B(ind_in)=vec_A(ICOMB);
    207209            vec_B(ind_out)=zeros(size(ind_out));
    208             A_out{icell}=reshape(vec_B,npy,npx);%new image in real coordinates
     210            A_out{icell}=reshape(vec_B,npY,npX);%new image in real coordinates
    209211        elseif numel(siz)==3     
    210212            for icolor=1:siz(3)
Note: See TracChangeset for help on using the changeset viewer.