Hello,
I have just upgraded to 4.4 using VTK 6, and some of my more detailed TVTK
code has exploded. I have managed to fix some of it but I am so far unable
to find a solution to this problem:
the input to this code is 'bfield' which is a
mayavi.sources.array_source.ArraySource.
Old code:
#Make a streamline instance with the bfield
surf_field_lines = tvtk.StreamTracer()
surf_field_lines.input = bfield
surf_field_lines.source = surf_seeds
surf_field_lines.integrator = tvtk.RungeKutta4()
surf_field_lines.maximum_propagation = 1000
surf_field_lines.integration_direction = 'backward'
surf_field_lines.update()
which raises an 'input is read only error' and presumably will do the same
on 'source' once it gets there.
I have tried a few different things, including `input_connection` which
does this:
surf_field_lines.input_connection = bfield.outputs[0]
---------------------------------------------------------------------------TypeError
Traceback (most recent call
last)<ipython-input-38-a2fc63178a31> in <module>()----> 1
surf_field_lines.input_connection = bfield.outputs[0]
/usr/lib/python2.7/site-packages/tvtk/tvtk_classes.zip/tvtk_classes/algorithm.pyc
in _set_input_connection(self, obj) 191 def
_set_input_connection(self, obj): 192 old_val =
self._get_input_connection()--> 193
self._wrap_call(self._vtk_obj.SetInputConnection, deref_vtk(obj))
194 self.trait_property_changed('input_connection', old_val,
obj) 195 input_connection =
traits.Property(_get_input_connection,
/usr/lib/python2.7/site-packages/tvtk/tvtk_base.pyc in
_wrap_call(self, vtk_method, *args) 521 self._in_set += 1
522 mtime = self._wrapped_mtime(vtk_obj) + 1--> 523
ret = vtk_method(*args) 524 self._in_set -= 1 525
if self._wrapped_mtime(vtk_obj) > mtime:
TypeError: SetInputConnection argument 1: method requires a
vtkAlgorithmOutput, a vtkImageData was provided.
I also tried this:
import tvtk.common as tvtk_common
tvtk_common.configure_input(surf_field_lines, bfield.outputs[0])
---------------------------------------------------------------------------AttributeError
Traceback (most recent call
last)<ipython-input-37-2ac55d369a09> in <module>() 1 import
tvtk.common as tvtk_common----> 2
tvtk_common.configure_input(surf_field_lines, bfield.outputs[0])
/usr/lib/python2.7/site-packages/tvtk/common.pyc in
configure_input(inp, op) 83 inp.input_connection = op
84 elif op.is_a('vtkDataSet'):---> 85
inp.set_input_data(op) 86 else: 87 raise
ValueError('Unknown input type for object %s'%op)
AttributeError: 'StreamTracer' object has no attribute 'set_input_data'
With a very similar error happening for tvtk_common.configure_connection.
So what is the correct idiom for connecting the input and source data
on these objects?
Thanks
Stuart
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users