how to form the volume from the single dicom image using isosurface in matlab
조회 수: 2 (최근 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;
댓글 수: 0
답변 (2개)
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
2016년 12월 1일
There definitely is an EdgeColor property for patch
https://www.mathworks.com/help/releases/R2015a/matlab/ref/patch-properties.html
참고 항목
카테고리
Help Center 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!