how to form the volume from the single dicom image using isosurface in matlab

4 次查看(过去 30 天)
want to do volume rendering for the data containing dicom images . Each dicom contains again 72 frames can any one help me how to get the volume from the below code
rojectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002';
% y = length(projectdir);
y=72;
X = zeros(128, 128, 1, 72, y, 'uint8');
% Read the series of images.
for p=1:1:y
thisfile = sprintf('IM_%d.dcm', p);
filename = fullfile( projectdir, thisfile );
imdata = dicomread(filename);
imsize = size(imdata);
if ~isequal( imsize, [128 128 1 72] )
fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename);
else
X(:, :, :, :, p) = imdata;
end
end
isoval=0.5;
hiso=patch(isosurface(X,isoval),...
'FaceColor',[1,0.75,0.65],'EdgeColor','none');%this is for volume display
set(hiso,'FaceAlpha',0.74);
lighting phong;
lightangle(45,30);
rotate3d on;

回答(2 个)

Walter Roberson
Walter Roberson 2016-11-30
编辑:Walter Roberson 2016-11-30
volumes_of_objects = squeeze( sum(sum(sum(X,1),2),3) );
Note: this assumes, though, that voxels are cubic. If your distance between z slices is different than the size of the pixels in the x and y directions, then you should multiply the above by the ratio of the z slice distance compared to the x distance. Or multiply by the physical X pixel width, physical Y pixel width, and physical Z distance: you can extract those parameters from the DICOM information structure.
  14 个评论
Walter Roberson
Walter Roberson 2016-12-1
There definitely is an EdgeColor property for patch
https://www.mathworks.com/help/releases/R2015a/matlab/ref/patch-properties.html

请先登录,再进行评论。


andhavarapu lokesh
andhavarapu lokesh 2016-12-1
编辑:andhavarapu lokesh 2016-12-1
i wanted to display like this image by forming a volume with those images

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by