color map based on area
1 次查看(过去 30 天)
显示 更早的评论
A 3D volume is constructed from a stack of 2D masks (slices). How to color each slice based on the area of the object inside. Suppose the volume is a trunk.
2 个评论
Walter Roberson
2018-7-25
Do you want all the pixels selected by the mask of a slice to be the same color? Or do you want to shade by value, different brightness of the color according to pixel value?
回答(2 个)
Walter Roberson
2018-7-25
colorval = repmat( sum( sum( masks3d, 1), 2) ), size(masks3d, 1), size(masks3d, 2), 1 ) .* masks3d;
vol3d('CData', colorval', 'alpha', double(masks3d))
0 个评论
另请参阅
类别
在 Help Center 和 File 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!