3d image of a computed tomography

6 次查看(过去 30 天)
SoyLeyenda
SoyLeyenda 2012-2-7
I have many shots from a computed tomography. I have used the matlab patch function to plot a 3d image. Here is the code:
data = smooth3(data);
p = patch(isosurface(data),'FaceColor','yellow', 'EdgeColor', 'none');
isonormals(data,p)
view(3); axis vis3d tight
camlight; lighting phong
There is a spacing of 2mm between each plane of the tomography. The spacing of x and y axis is 1mm. I think the voxel must be rectangular. How can i do it?

回答(2 个)

Sven
Sven 2012-2-7
The isosurface function can take in an x, y and z vector specifying the location of each voxel. So try this:
xVec = 1:size(data,2); % "X" is the 2nd dimension of the matrix
yVec = 1:size(data,1); % "Y" is the 1st dimension
zVec = (1:size(data,3))*2; % Multiply by 2 for 2mm spacing
p = patch(isosurface(xVec,yVec,zVec,data),'FaceColor','yellow', 'EdgeColor', 'none');
Does this work for you?
You may also have your exact X, Y, and Z spacing defined in mm, embedded in the .PixelSpacing (for x,y) and .ImagePositionPatient (for each slice of z) fields of the original DICOM files.

SoyLeyenda
SoyLeyenda 2012-2-9
Thank you for your answer Sven. The image is longer now but it seems to loose precision.
  1 个评论
Sven
Sven 2012-2-17
As long as your actual pixel (well, "voxel", because it's 3d) dimensions are true to the original voxel space, then I'm afraid that you didn't _lose_ precision at all... it's just that your Z precision was *always* lower than your X-Y-precision. Is the question answered or are there still any issues you're having?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by