[vtkusers] Multi-Input and Math on Data

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu Aug 26 19:19:31 EDT 2004


> On Thu, 26 Aug 2004 17:38:17 -0400, Stewart Dickson <dicksonsp at ornl.gov> wrote:
> > I wish to visualize a derived 480x480x480 scalar data field:
> > entropy = pressure / density ^ 1.33333
> > 
> > I have the vtkNetCDFHDFReader library which is distributed with ASPECT
> > <http://www.aspect-sdm.org>  Therefore, I can read the data files into Vtk.
> > 
> > Is there a library in Vtk to allow one to do exponentiation and division
> > on the output of two vtkNetCDFHDFReaders?
> 
> I'm assuming the vtkNetCDFHDFReaders output vtkImageData types.  In
> that case, you can use vtkImageMathematics[1] to perform the division,
> but raising to a power is currently not directly supported (unless I'm
> overlooking something).  The right way would be be to adapt the
> vtkImageMathematics class to support this - this would be
> straight-forward modification.  A kludge would be to decompose your
> exponentiation into exp and log, both operations that are supported by
> vtkImageMathematics.

You can also play with:

http://www.vtk.org/doc/nightly/html/classvtkArrayCalculator.html

It supports:
standard operations: + - * / ^ .
 access vector components: iHat, jHat, kHat
 abs
 acos
 asin
 atan
 ceil
 cos
 cosh
 exp
 floor
 log
 mag
 min
 max
 norm
 sign
 sin
 sinh
 sqrt
 tan
 tanh
 

HTH
Mathieu






More information about the vtkusers mailing list