Azzera filtri
Azzera filtri

3d image of a computed tomography

6 visualizzazioni (ultimi 30 giorni)
SoyLeyenda
SoyLeyenda il 7 Feb 2012
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?

Risposte (2)

Sven
Sven il 7 Feb 2012
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 il 9 Feb 2012
Thank you for your answer Sven. The image is longer now but it seems to loose precision.
  1 Commento
Sven
Sven il 17 Feb 2012
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?

Accedi per commentare.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by