How can I use a colormap for displaying voxel intensity when plotting 3D-voxels using voxel.m?

1 vue (au cours des 30 derniers jours)
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);

Réponse acceptée

Jonathan
Jonathan le 21 Jan 2013
I found this function instead, easier to add coloring to voxels and also seems more memory efficient.

Plus de réponses (0)

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by