필터 지우기
필터 지우기

Using SLICE on a 3D Image Volume

조회 수: 60 (최근 30일)
Sean de Wolski
Sean de Wolski 2011년 6월 28일
답변: Adam 2014년 10월 1일
Hi Guys,
I have what should be a simple problem but what I'm sad to say I can't figure out. I have a 3-dimensional image volume. I want to view a slice of it using the slice function but can't get seem to get it. The slice should range from: size(X,1) at page 1 to 1 in the first dimension at size(X,3). (So for an example perfect cube 500x500x500, the slice would be 45degrees into the third dimension).
Here's a sketch I made: http://dropdo.com/55E/Picture%2014
I've toyed with the slice function demo, but can't seem to figure out how to make it diagonal in only one dimension. Any pointers please on how to set up x,y,z is much appreciated?
Thanks! - Sean

채택된 답변

Patrick Kalita
Patrick Kalita 2011년 6월 28일
Maybe you're looking for something like this?
% Define 3D data
[x,y,z] = meshgrid(linspace(-1,1,30));
v = x.^2 + y.^2 + z.^2;
% Define the slice plane
[xi, yi] = meshgrid(linspace(-1,1,50));
zi = xi;
% Slice it
slice(x,y,z,v,xi,yi,zi);
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2011년 6월 28일
Exactly!
Changed to represent volumetric data (100x100x100):
% Define 3D data
[x,y,z] = meshgrid(1:100);
v = repmat(magic(100),[1 1 100]);
% Define the slice plane
[xi, yi] = meshgrid(1:100);
zi = xi;
% Slice it
slice(x,y,z,v,xi,yi,zi);
Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Adam
Adam 2014년 10월 1일
You can rotate along one axis using the rotate() function. Check out this page
Adam

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by