[Paraview] Reading json colormap files in Python and exporting color data

Andy Smith agsmith424 at gmail.com
Tue Apr 26 10:15:06 EDT 2016


I have two questions:

1. I am trying to load colormaps in a Python script so that I have access
to the lookup table later in the script.  I have successfully used the
LoadLookupTable function with xml colormap files but this does not seem to
work on json files.  I get a parsing error:

ERROR: parsing lut file /path/to/my/colormap.json

The json colormap file loads correctly inside the GUI.  Is there another
function that I should be calling instead of LoadLookupTable or is there an
issue with this function?  Should it call a different parser based on the
file extension?

2. Is there a way to export the discretized color data?  For example, my
colormap may have seven control points in Lab space but I'd like to export
256 control points and the associated R,G,B values for use in other tools.
Alternatively, are there any ParaView Python functions that I can use to
extract R,G,B values from a colormap based on input array values?

Thanks,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160426/9b356f9d/attachment.html>


More information about the ParaView mailing list