2D slice of a 3D volume!(arbitrary plane-slice function)

5 Ansichten (letzte 30 Tage)
Hossein
Hossein am 7 Okt. 2013
Kommentiert: Hossein am 7 Okt. 2013
Hi,
slice function, just show a 2D slice along X,Y,Z plane.
I wonder if there is a function which has an optional plane as input from the user and slice the volume along that plane.

Akzeptierte Antwort

Image Analyst
Image Analyst am 7 Okt. 2013
Why do you say this when it's not true? Is it possible you have a really really old release of MATLAB? Could it be that you just never looked at the help for slice() so you did not see the slices cutting through the volume at arbitrary angles? Please explain, because slice() will do exactly what you asked for, if I understood you correctly. You just have to specify the plane.
  1 Kommentar
Hossein
Hossein am 7 Okt. 2013
Bearbeitet: Hossein am 7 Okt. 2013
You are right! I did not read the help thorougly!
Could you please have a look at this script!
It doesn't work:
Chargecar=load('CHGCAR3.dat','Chargecar');
B=reshape(Chargecar,96,96,151);
hsp = surf(linspace(0,100,100),linspace(0,100,100),zeros(100));
rotate(hsp,[1,0,0],0)
xd = get(hsp,'XData');
yd = get(hsp,'YData');
zd = get(hsp,'ZData');
delete(hsp)
%slice (B,2,60,40)
slice(x,y,z,B,xd,yd,zd), %shading flat;
Thanks in advance

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Sean de Wolski
Sean de Wolski am 7 Okt. 2013
There are many:

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by