Volumetric slice plot of tomographic data

조회 수: 2 (최근 30일)
Sordin
Sordin 2017년 4월 20일
편집: Sordin 2017년 4월 30일
I am trying to use the slice function to stack the following 79 slices and display a 3D representation of an object.
The problem is that the black regions in each image are obstructing the image of the previous slice. So, I'm only seeing the very last slice on top, rather than a meaningful volumetric presentation of the data. So, how can I include only the non-zero elements of each image in the plot?
Any suggestions would be greatly appreciated.
  댓글 수: 3
Sordin
Sordin 2017년 4월 21일
Hi Philip, thank you for your suggestions.
I already have the inverted brightness or complement images for each of the slices (I can also make the binary images). But how can I apply an alpha mask to images based on these masks? Do you know what code I need to use?
Basically, I want the black areas (backgrounds) to be made highly transparent. While the non-zero elements of each image (containing data) are to be opaque. I think this should help in making the 3D reconstruction more recognizable in terms of the anatomical features of the patient.
This is my code (I am trying to write it myself before trying vol3d or other viewers):
for i = 1 : 39
I=imread(filename);
I(:,:,i) = imread(filename);
mask = imcomplement(I(:,:,i));
M(:,:,i) = I(:,:,i);
end
hs = slice(M,[],[],1:1:39, 'nearest');
colormap('gray');
shading interp
set(hs,'FaceAlpha',0.8);
Philip G
Philip G 2017년 4월 24일
I found a nice way to use surf images ... see my anwer.

댓글을 달려면 로그인하십시오.

채택된 답변

Philip G
Philip G 2017년 4월 24일
편집: Philip G 2017년 4월 24일
Hi, if you do not want to use a simple isosurface or volume viewer as I suggested in my comment, every image can have an alphadata property (that can be a matrix and not only a single value), as explained here:
https://www.mathworks.com/company/newsletters/articles/image-overlay-using-transparency.html
You can extend this behavior towards 3D with the help of this:
https://de.mathworks.com/help/matlab/visualize/add-transparency-to-graphics-objects.html
For example by using surf.
One example:
img=peaks; % this is the color
t=abs(img); % this is the transparency
%t=img>1; % if you want to have a binary mask
for i=1:10
surf(img*0+i,p,'linestyle','none','alphadata',t,'facealpha','flat')
hold on
end
I hope you get the idea.

추가 답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2017년 4월 21일
If you change your colour-map from black-white to white-black then you might get some mileage out of experimentations with alpha-mapping, look at the help for alphamap and alim.
HTH

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by