MATLAB: How to use a colormap for displaying voxel intensity when plotting 3D-voxels using voxel.m

3d plotscolorcolormapplotvoxelvoxel.m

Hi there,
I'm plotting a bunch of voxels using this function called voxel.m, see: http://www.mathworks.com/matlabcentral/fileexchange/3280-voxel
With this function it is easy to represent the intensity of the voxel by changing the opacity of each voxel. This however does not give such an informative figure when several voxels are plotted close to each other so I would prefer to instead have a constant opacity but instead change the color of the voxels depending on their intensity.
How can I change these lines from voxel.m where c is the color variable (for example 'r' for red) so that it instead gets an intensityvalue [0,1] as indata and then plots the color using a colormap?
h=patch(x(5:8,1),x(5:8,2),x(5:8,3),c);
set(h,'FaceAlpha',alpha);

Best Answer

I found this function instead, easier to add coloring to voxels and also seems more memory efficient.
Related Question