improfile() through 3D image?

조회 수: 2 (최근 30일)
Justin Solomon
Justin Solomon 2012년 7월 8일
Hello,
I have a 3D image set (i.e., a stack of CT images), I would like to get a line profile through this 3D image set similar to what improfile() does on a normal 2D image. I can't find anything that does this. Help!
Thanks, Justin

채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 8일
If you can calculate the coordinates that you want to sample at, then you can use interp3(). But calculating the coordinates might require using something like http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
  댓글 수: 1
Justin Solomon
Justin Solomon 2012년 7월 10일
Thanks for the advice. I was able to find an implementation of Bresenham's line algorithm.
I have a follow up question about interp3().
I've got a 3D image, I, and I've defined a coordinate system (x,y,z) for I. Note that because I'm dealing with images, x actually corresponds to the second dimension (columns) of I,. Further, I have a list of points [Xprof Yprof Zprof] that define a line through the image (i.e., Xprof, Yprof, and Zprof are all vectors of length n where n is the number of points in the line). Now I would like to use interp3() to get values of I along the line defined by [Xprof Yprof Zprof].
I'm worried that I'm mixing up the x and y axis when I call interp3(). Should I do
1. HUs = interp3(y,x,z,I,Yprof,Xprof,Zprof);
or
2. HUs = interp3(x,y,z,I,Xprof,Yprof,Zprof);
Below is the calling sequence for interp3() described in the help menu.
VI = interp3(X,Y,Z,V,XI,YI,ZI)
I don't know if X is associated with the rows or columns of V. Any insight would be helpful.
Thanks, Justin

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

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by