[vtkusers] vtkInformationKey in Python

David Gobbi david.gobbi at gmail.com
Thu Jan 6 14:49:19 EST 2011


Hi Tom,

I think the problem is that these keys classes are abstract classes.  So you
cannot instantiate them.  But there is a better way to deal with metadata.

Every vtkDataObject has FieldData, which allows you to attach any number
of named arrays to a data set.  The field data will be carried along by the
pipeline.

array = vtk.vtkStringArray()
array.SetName("xyz")
data.GetFieldData().AddArray(array)

 - David


On Thu, Jan 6, 2011 at 12:35 PM, Maxwell, Thomas P.
(GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] <thomas.maxwell at nasa.gov>
wrote:
> For clarification:   I am attempting to instantiate an existing
> vtkInformationKey subclass such as vtkInformationIntegerKey, not define a
> new vtkInformationKey subclass.
>
> On 1/6/11 2:00 PM, "Thomas Maxwell" <thomas.maxwell at nasa.gov> wrote:
>
> How does one create a user-defined vtkInformationKey (subclass) in python?
> The methods used in C++ don’t seem to work in python.
>
> ( I would like to pass ImageData metadata down the pipeline in a python app.
>  I’m attempting to add custom fields to the port information objects.  Is
> there is a better way to pass the metadata? )
>
> Thanks,
> Tom
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list