Filter löschen
Filter löschen

How can i convert a 3d medical image to rgb format?

4 Ansichten (letzte 30 Tage)
Galiyabi P S
Galiyabi P S am 29 Jan. 2017
Kommentiert: Walter Roberson am 31 Jan. 2017
I am working database of brain tumor which is in ha format. Can anybody help me to convert these mha files into rgb format?

Antworten (2)

Walter Roberson
Walter Roberson am 29 Jan. 2017
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.
  2 Kommentare
Galiyabi P S
Galiyabi P S am 31 Jan. 2017
Sir, I am working on MRI image of brain in mha format. How could I give the colour map input to the function ind2rgb(). Can you help me to convert?
Walter Roberson
Walter Roberson am 31 Jan. 2017
cmap = copper(256);
recolored_image = ind2rgb(IndexedImage, cmap);

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 29 Jan. 2017
Bearbeitet: Jan am 29 Jan. 2017
  2 Kommentare
Galiyabi P S
Galiyabi P S am 31 Jan. 2017
Bearbeitet: Walter Roberson am 31 Jan. 2017
this link helps me to read mha file to 256*256*155 dimension image. Can you help me to convert this image to rgb format?
Walter Roberson
Walter Roberson am 31 Jan. 2017
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by