[Paraview] Python API problem

Zach Mullen zach.mullen at kitware.com
Thu Apr 11 17:22:04 EDT 2013


Hi guys,

I'm writing a ParaViewWeb application in python and I'm running into
trouble.  I load the data source, which is a volume image (.mha) as follows:

srcObj = simple.OpenDataFile(fullpath)
simple.SetActiveSource(srcObj)
rep = simple.Show()

I have managed to get the bounds and color array name information, but for
some reason I can't get to the Range information.  The way I'm trying is:

imageData = srcObj.GetPointDataInformation().GetArray(0)
scalarRange = imageData.GetRange()


I get an error saying GetComponentRange() function does not exist, and
indeed when I get the instance of the underlying vtkPVArrayInformation,
that function is not there in python, so I'm not sure how to get the range.
 I looked at the C++ header for vtkPVArrayInformation, and the
GetComponentRange is there, but it isn't available on that python object
exposed to me, even though SetComponentRange is present.

This is on current master branch of ParaView built with python wrapping.
 When I run the same code in v3.98 in the GUI with python shell, it works
fine and I get back the range for the image.  If there is some better way
to get the range, please let me know.  In older versions of the script I
just used simple.GetDataInformation(), but it looks like that function has
gone away.

Thanks,


-- 
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130411/761fd189/attachment.htm>


More information about the ParaView mailing list