0
$\begingroup$

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

$\endgroup$
  • 1
    $\begingroup$ You've seen Colorize[]? $\endgroup$ – J. M. will be back soon Nov 24 '15 at 21:26
  • $\begingroup$ J.M. -- I don't think Colorize works for 3D... only 2D. $\endgroup$ – bill s Nov 24 '15 at 22:00
  • 1
    $\begingroup$ @bills it does take a ColorFunction option though. $\endgroup$ – dr.blochwave Nov 24 '15 at 22:04
  • $\begingroup$ Possibe duplicates: (72363) and (38305)? $\endgroup$ – dr.blochwave Nov 24 '15 at 22:12
  • 1
    $\begingroup$ Use ColorFunction -> "HueOpacity" instead of ColorFunction -> Hue. $\endgroup$ – J. M. will be back soon Nov 25 '15 at 5:16
5
$\begingroup$

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

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.