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

4 ビュー (過去 30 日間)
andhavarapu lokesh
andhavarapu lokesh 2016 年 11 月 30 日
コメント済み: Walter Roberson 2016 年 12 月 1 日
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 件のコメント
andhavarapu lokesh
andhavarapu lokesh 2016 年 12 月 1 日
matlab2015
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 Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by