0

I have a 3D image where the values are in {1/4, 2/4, 3/4, 4/4} and its size is {134, 134, 67}. I used Image3D to display it. However, I am wondering if there is a possibility to colorize the image by 4 different colors. I have an image like this 3d image

exemple.

Image3D[image3D,ColorFunction->Hue] gives

I need just to use a kind of Opacity[] function to see all points. result

BetterEnglish
  • 2,026
  • 13
  • 19

1 Answers1

5

How about adding `ColorFunction' to your Image3D:

m = RandomChoice[{1/4, 1/2, 3/4, 1}, {4, 4, 4}];
Image3D[m, ColorFunction -> Hue]

enter image description here

Play with the Colorfunction to get different color schemes:

m = RandomChoice[{1/4, 1/2, 3/4, 1}, {5, 10, 10}];
Image3D[m, ColorFunction -> "TemperatureMap"]

enter image description here

bill s
  • 68,936
  • 4
  • 101
  • 191