How can i convert a 3d medical image to rgb format?
4 次查看(过去 30 天)
显示 更早的评论
I am working database of brain tumor which is in ha format. Can anybody help me to convert these mha files into rgb format?
0 个评论
回答(2 个)
Walter Roberson
2017-1-29
Read the image. mat2gray() to convert it to the range 0 to 1. im2uint8(). ind2rgb() passing in a colormap with 256 entries. The result will be an RGB image created by doing pseudocolor lookup on the grayscale image.
Jan
2017-1-29
编辑:Jan
2017-1-29
A short search in the internet (meta message :-) ) reveals this:
2 个评论
Walter Roberson
2017-1-31
cmap = copper(256);
numslice = size(IndexedMHA,3);
colored_MHA = zeros(size(IndexedMHA, 1), size(IndexedMHA, 2), 3, numslice);
for slice = 1 : numslice
colored_MHA(:,:,slice) = ind2rgb(IndexedMHA(:,:,slice), cmap);
end
Note: I put the color data as the third dimension. Some of the File Exchange routines work with the color data in the third dimension but some work with it in the fourth dimension.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!