[Paraview] RGB color coding

Andy Bauer andy.bauer at kitware.com
Fri Aug 29 15:16:21 EDT 2014


FYI: With PV 4.2 you'll need to use make_vector() instead of hstack.


On Fri, Aug 29, 2014 at 3:11 PM, Casey Goodlett <casey.goodlett at kitware.com>
wrote:

> Hi all,
>
> I often do something similar when reading data originally from a text
> table.  In this case I need to turn 3 arrays into a single 3-component
> uchar array for the purpose of RGB coloring.  I found that I can also use
> the following python calculator expression to accomplish this goal
> (assuming the arrays are named 'R', 'G', 'B' respectively).  This assumes
> the values are already scaled between 0-255.
>
> hstack([inputs[0].PointData['R'], inputs[0].PointData['G'],
> inputs[0].PointData['B']]).astype(uint8)
>
> --
> Casey B. Goodlett, Ph.D.
> Technical Leader
> Kitware, Inc. - North Carolina Office
> http://www.kitware.com
> (919) 969-6990 x310
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20140829/ac72b3b6/attachment.html>


More information about the ParaView mailing list