Randall Hopper:
 |Randall Hopper:
 | |     If you have some arbitrary field with colors and a colormap, and you
 | |want to convert it to field with direct colors, what's the simplest way to
 | |do that?  Map comes to mind, but I clearly don't want interpolation.  
 | |
 | |     Is there a module for this I've forgotten about?
 |
 |Why I looked for this: If you Reduce a colormapped volume or image, you
 |just get a mess (interpolating colormap indicies most likely).  So it seems
 |there should be a simple way to expand colors explicitly, or Reduce should
 |probably either emit an error or expand colors automatically.  Thoughts?

(Plowing ahead until someone humbles me with the simple answer...)

If I try this in the UI:

   cmap       = Extract  ( field, "color map" );
   cmap_field = Construct( {[0]}, {[1]}, 256, cmap );
   do_it      = Map      ( field, cmap_field, "colors", "colors" );

I get:

   ERROR: Map: Invalid data: rank/shape mismatch between input and map

I'm puzzled with this one.  The ubyte "colors" component of field (a
scalar) is to be used to lookup into the positions component of cmap_field
(a scalar) to produce a ubyte[3] color.  Where's the rank/shape mismatch?

Randy

-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711

Reply via email to