0001 function [h1,h2,h3] = vb_plot_slice2(B,V_bv,V,xxP,indx,PARA)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 vdim = PARA.vdim;
0022
0023
0024 cmap2=colormap('jet');
0025
0026 [NBx,NBy,NBz]=size(B);
0027
0028 switch vdim,
0029 case 1,
0030 x=3; y=1; z=2;
0031 B2=reshape(B(indx,:,:),NBy,NBz);
0032
0033
0034
0035 case 2,
0036 x=3; y=2; z=1;
0037 B2=reshape(B(:,indx,:),NBx,NBz);
0038
0039
0040
0041 case 3,
0042 x=1; y=2; z=3;
0043
0044 B2=B(:,:,indx);
0045 end;
0046
0047
0048
0049 hold off;
0050 h1=image(B2,'CDataMapping','scaled');
0051
0052 colormap('gray');
0053 axis('equal');
0054 axis('tight');
0055 hold on;
0056
0057 tstr = {'Up-down cut'; 'Front-back cut'; 'Left-right cut'};
0058
0059 isl0 = indx;
0060 isl1 = isl0 - PARA.width;
0061 isl2 = isl0 + PARA.width;
0062
0063
0064 if ~isempty(V_bv)
0065 pix = find(V_bv(:,z)>=isl1-0.5 & V_bv(:,z)<isl2+0.5);
0066 Vdisp=V_bv(pix,:);
0067 X=Vdisp(:,x);
0068 Y=Vdisp(:,y);
0069 h2 = plot(X,Y, PARA.mtype,'MarkerSize',PARA.msize);
0070 else
0071 h2 = [];
0072 end
0073
0074
0075 if ~isempty(V)
0076 xxP_max = max(abs(xxP))*PARA.wmax;
0077 xxP_min = max(abs(xxP))*PARA.wmin;
0078 pix = find(V(:,z)>=isl1-0.5 & V(:,z)<isl2+0.5 ...
0079 & xxP<=xxP_max & xxP>=xxP_min);
0080 Vdisp=V(pix,:);
0081 X=Vdisp(:,x);
0082 Y=Vdisp(:,y);
0083 activity = fix(xxP(pix)/max(xxP)*63)+1;
0084 h3 = scatter(X,Y, 2*PARA.msize, cmap2(activity,:), 'filled');
0085 else
0086 h3 = [];
0087 end
0088
0089 title(sprintf('%s (%d - %d)',tstr{vdim},isl1,isl2));