[Paraview] custom colormaps/lookup tables... using batch?

Berk Geveci berk.geveci at gmail.com
Tue Nov 23 10:42:18 EST 2004


This is not too hard.

1. Create a server manager xml file. Start with copying 
Servers/ServerManager/Resources/utilities.xml and deleting all proxies
but the LookupTableProxy

2. Add a property called TableValues. It will probably be similar to
this (from filters.xml)

     <DoubleVectorProperty
        name="ContourValues"
        command="SetValue"
        repeat_command="1"
        set_number_command="SetNumberOfContours"
        number_of_elements_per_command="1"
        use_index="1">
     </DoubleVectorProperty>

3. In your script, load the configuration file with something like:

#Initialization

vtkSMObject foo
set proxyManager [foo GetProxyManager]

set smApplication [foo GetApplication]
$smApplication AddConfigurationFile modules.pvsm /home/berk/etc/paraview
$smApplication ParseConfigurationFiles
foo Delete

4. In your script, do something like:

   [$pvTemp218 GetProperty TableValues]  SetNumberOfElements 256
    for {set i 0} {$i < 256} {incr i 1} {
      [$pvTemp218 GetProperty TableValues] SetElement $i value
   }


On Mon, 22 Nov 2004 15:11:24 -0800 (PST), santiago v lombeyda
<slombey at cacr.caltech.edu> wrote:
> 
>         i need to be able to use specific colormaps that
>         do not have a linear HSB equivalents. though such
>         may currently not be possible _within_ paraview, is
>         it possible to modify a batch script dumped from
>         paraview to do this? something like:
> 
> [...]
> set pvTemp218 [$proxyManager NewProxy lookup_tables LookupTable]
>   $proxyManager RegisterProxy lookup_tables pvTemp218 $pvTemp218
>   $pvTemp218 UnRegister {}
>   [$pvTemp218 GetProperty NumberOfTableValues] SetElements1 256
>   [$pvTemp218 GetProperty HueRange] SetElements2 0 0.333333
>   [$pvTemp218 GetProperty SaturationRange] SetElements2 1 1
>   [$pvTemp218 GetProperty ValueRange] SetElements2 1 1
>   [$pvTemp218 GetProperty ScalarRange] SetElements2 -1.79864 1.06823
>   [$pvTemp218 GetProperty VectorComponent] SetElements1 0
>   [$pvTemp218 GetProperty VectorMode] SetElements1 0
>     # CUSTOM CODE
>     for {set i 0} {$i < 256} {incr i 1} {
>        $pvTemp218 SetTableValue  $i [$i/255] [1-$i/255] 0 1
>        #[$pvTemp218 GetProperty SetTableValue] SetElements5 $i ...
>        #[$pvTemp218 GetObject] SetTableValue $i ...
>     }
>     # END CUSTOM CODE
>   $pvTemp218 UpdateVTKObjects
>   $pvTemp218 Build
> [...]
> 
>         i guess i mostly do not understand the object proxies,
>         and what is exposed as far as vtkLookupTables that i
>         can get a handle on and modify manually...
> 
>         (i am using version 1.7 under linux)
> 
>         thanks!
> 
>         - santiago
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list