From: Matt J on 23 Mar 2010 11:25 "mat001 " <dres01(a)lycos.com> wrote in message <hoall3$j7a$1(a)fred.mathworks.com>... > > This requires some guessing on our part about where you like to put your axes, but here's a possible example > > > > > > M=rand(100,100,100); %A 3D volume M(x,y,z) > > > > xy_plane=M(:,:,i); > > xz_plane=squeze(M(:,j,:)); > > yz_plane=squeeze(M(k,:,:)); > > I did not undersatnd your little code :( That tells us very little. What aspect of the example requires explanation? Did you do "help squeeze" to get familiar with the squeeze() function? Do you not understand the indexing notation M(:,:,i)? Did you try this on a small example, e.g., >> M=reshape(1:32,4,[],2); %Small 3D volume M(:,:,1) = 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 M(:,:,2) = 17 21 25 29 18 22 26 30 19 23 27 31 20 24 28 32 >> xy_plane=M(:,:,1); %First xy plane in the volume xy_plane = 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 >> xz_plane=squeeze(M(:,1,:)); %first xz plane in the volume xz_plane = 1 17 2 18 3 19 4 20
From: mat001 on 23 Mar 2010 11:30 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hoaksj$541$1(a)fred.mathworks.com>... > "mat001 " <dres01(a)lycos.com> wrote in message <hoak29$jkp$1(a)fred.mathworks.com>... > > Can someone explain me how to get 2d image like images out of 3d volume. > > > > XY plane image > > YZ plane > > ZX plane image > =============== > > This requires some guessing on our part about where you like to put your axes, but here's a possible example > > > M=rand(100,100,100); %A 3D volume M(x,y,z) > > xy_plane=M(:,:,i); > xz_plane=squeze(M(:,j,:)); > yz_plane=squeeze(M(k,:,:)); I have a 3d volume M(x,y,z) 80 * 60 *40 xy_plane=M(:,:,1); imagesc(xy-plane) its comes 2d image but light green color, I did not understand what is this?
From: mat001 on 23 Mar 2010 11:36 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hoamh5$5rb$1(a)fred.mathworks.com>... > "mat001 " <dres01(a)lycos.com> wrote in message <hoall3$j7a$1(a)fred.mathworks.com>... > > > > This requires some guessing on our part about where you like to put your axes, but here's a possible example > > > > > > > > > M=rand(100,100,100); %A 3D volume M(x,y,z) > > > > > > xy_plane=M(:,:,i); > > > xz_plane=squeze(M(:,j,:)); > > > yz_plane=squeeze(M(k,:,:)); > > > > I did not undersatnd your little code :( > > > That tells us very little. What aspect of the example requires explanation? Did you do "help squeeze" to get familiar with the squeeze() function? Do you not understand the indexing notation M(:,:,i)? Did you try this on a small example, e.g., > > > >> M=reshape(1:32,4,[],2); %Small 3D volume > > M(:,:,1) = > > 1 5 9 13 > 2 6 10 14 > 3 7 11 15 > 4 8 12 16 > > > M(:,:,2) = > > 17 21 25 29 > 18 22 26 30 > 19 23 27 31 > 20 24 28 32 > > >> xy_plane=M(:,:,1); %First xy plane in the volume > > xy_plane = > > 1 5 9 13 > 2 6 10 14 > 3 7 11 15 > 4 8 12 16 > > >> xz_plane=squeeze(M(:,1,:)); %first xz plane in the volume > > xz_plane = > > 1 17 > 2 18 > 3 19 > 4 20 so if I want to cut exactly from middle for XY image then in my case for 80*60*40 it should be xy-plane = M(:,:,20) is it okey?
From: mat001 on 23 Mar 2010 11:38 Thanks alot I did it.
From: Matt J on 23 Mar 2010 11:39 "mat001 " <dres01(a)lycos.com> wrote in message <hoamqn$b6q$1(a)fred.mathworks.com>... > > I have a 3d volume M(x,y,z) 80 * 60 *40 > xy_plane=M(:,:,1); > imagesc(xy-plane) > > its comes 2d image but light green color, I did not understand > what is this? ==== You can control the colormap using the colormap() function, or from the figure property editor.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: control of an external program in MATLAB Next: matrix inequations and optimization |