Changeset 79 for trunk/src


Ignore:
Timestamp:
Apr 5, 2010, 3:11:51 AM (15 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

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r78 r79  
    105105                                    set(0,'Children',hstack);%put back the initial figure stack after plot creation
    106106                                else
     107                                    set(hhh,'Visible','on')
    107108                                    set(hhh,'Position',[AxeData.X(ivec)-AxeData.Mesh/2 AxeData.Y(ivec)-AxeData.Mesh/2 AxeData.Mesh AxeData.Mesh])
    108109                                end
     
    135136                    else
    136137                        if ~isempty(hhh)
    137                             delete(hhh)
     138                            set(hhh,'Visible','off')
    138139                        end
    139140                    end
  • trunk/src/series/time_series.m

    r76 r79  
    536536    %name of result file
    537537    [filemean]=...
    538                name_generator(filebase_out,num_i1{1}(i_slice),num_j1{1}(i_slice),'.nc','_i1-i2_j1-j2',1,num_i2{end}(ifile),num_j2{end}(ifile),SubDir{1});
     538               name_generator(filebase_out,num_i1{1}(i_slice),num_j1{1}(i_slice),'.nc','_i1-i2_j1-j2',1,num_i2{end}(ifile),num_j2{end}(ifile),subdir_result);
    539539    errormsg=struct2nc(filemean,RecordData); %save result file
    540540    if isempty(errormsg)
  • trunk/src/set_object.m

    r77 r79  
    778778    PlotHandles=get_plot_handles(hhuvmat);
    779779    IndexObj=IndexObj_1;
    780 elseif strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field
     780elseif IndexObj_2<=numel(ListObject)&& strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field
    781781    hview_field=findobj('tag','view_field');
    782782    if ~isempty(hview_field)
  • 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.