Matlab 3D Volume visualization - dicom file

三世轮回 提交于 2019-12-21 21:28:48

问题


I am looking forward to visualize a 3D matrix into matlab from dicom files. As I am not quite familiar with matlab, i managed to get help from this post:

The difference is that my matrix is not made of 1 and 0 but negative numbers that are correctly red with imshow(dicomeread(dicomFile))

How can I get to the same contrast but with a 3D rendering ?

My code :

dicomFilesZm = dir(fullfile(myDcmFolder, 'SLZ-*.dcm')); %Get files name
dicomFilesZp = dir(fullfile(myDcmFolder, 'SLZ+*.dcm')); %~

Z = dicomFilesZm(end:-1:1); % sort

dicomFilesZ = [Z ; dicomFilesZp]; % recompose final array with files name

Iz1 = fullfile(myDcmFolder, dicomFilesZ(1).name); 
v = NaN([size(dicomread(Iz1)) numel(dicomFilesZ)]); % creation of empty matrix with the good size    
for i = 1 : numel(dicomFilesZ)
    Iz = fullfile(myDcmFolder, dicomFilesZ(i).name);
    v(:,:,i) = dicomread(Iz); % fill the matrix with each image
end

p = patch( isosurface(v,0) );
isonormals(v, p)
set(p, 'FaceColor','r', 'EdgeColor','none')
daspect([1 1 1])

Thank you for your help.


回答1:


Two options for solving your problem:

  1. Naively, why won't you just set v=v+min(v(:)) so the image will scale from zero to a different maximum value?

  2. Why won't isosurface(V,isovalue) with negative isovlaue solve this issue for you? Or if you want loop over isovalues from (-n:step_size:m) to get the dynamic range you want (with some alpha(0.2) to see the layers you want)



来源:https://stackoverflow.com/questions/13084377/matlab-3d-volume-visualization-dicom-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!