how to get only the edges and make transparent the face on a superimposed cube
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I have created a cube and superimposed to a dicom image. What I need to do now is to make transparent the faces of the cube, thus, only the edges of the cube are seen. The way that I create the cube and superimposed to the dicom image is:
[M,N,L] = size (imag);
cube = zeros(info_imag.Width, info_imag.Height, L);
cube(location(1,1)-10:(location(1,1)+9, (location(2,1)-10:(location(2,1)+9, (location(3,1)-10:(location(3,1)+9) = 0.3;
I = (int16(1000*cube))+imag;
Could someone suggest an idea on how to do that?
2 个评论
Sreeja Banerjee
2015-6-12
Hi Isabel, Since we do not have access to your data and you have not explained the variables that you have used in your code, it is difficult to give you any specific suggestion. In the code I could not find how you are displaying the cube.
However, if your question is specifically on how you can make the faces of the cube transparent then have you considered using the function ALPHA ( documentation )
If you are using a surface or patch to draw the faces of the cube, then you can modify the 'FaceAlpha' property to make it transparent. ( documentation )
采纳的回答
更多回答(1 个)
Walter Roberson
2015-6-15
You indicate that you SliceBrowser(test) but you have not defined test in what you show, only cube.
SliceBrowser() is using imagesc() to do the work of drawing the slices. SliceBrowser does not manipulate transparency at all. If I read the source correctly the only edges it draws explicitly are crosshairs. I see no reason to say that assigning 0 or 1 affects transparency when using SliceBrowser: it just controls the data value that are put through colormap processing.
If you want to continue using SliceBrowser then you will need to set a thin shell of pixels around the outside of the area you want pointed out.
But really if you want to talk about faces and edges and transparency you should be using some other display mechanism such as patch() or surface().
另请参阅
类别
在 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!