[Insight-users] Problem with PointsContainer - WrapITK-Pyhon

Carlos Moro cfmoro at gmail.com
Sat Jul 11 11:16:10 EDT 2009


Hi all,

I'm trying to set the points in a PointSet with a code like:

pointType = itk.Point[itk.D , dim]
pointSetType = itk.PointSet[ itk.D, dim, traitstype ]
pointSet = pointSetType.New()
p0 = pointType()
p0.SetElement(0,-1)
p0.SetElement(1,0)
p0.SetElement(2,0)
points = (p0,p1)
pointSet.SetPoints( cont )

Doubt 1: Is there any way to set the values of the points in a unique line,
something like [-1,0,0]
Doubt 2: With such code, I get this error:
   File "/usr/lib/WrapITK/lib/itkPointSet.py", line 1207, in SetPoints
       def SetPoints(*args): return
_itkPointSet.itkPointSetD3S_Pointer_SetPoints(*args)
   TypeError: Expected a pointer

Looking in the documentation, the points are stored in a PointsContainer,
that in this case should be a
VectorContainer. But If I try to create a VectorContainer like this: cont =
itk.VectorContainer[pointType],
I get this error:
   File "/usr/lib/WrapITK/Python/itkTemplate.py", line 215, in __getitem__
       raise KeyError, 'itkTemplate : No template %s for the %s class' %
(str(parameters), self.__name__)
   KeyError: "itkTemplate : No template [<class 'itkPoint.itkPointD3'>] for
the itk::VectorContainer class"

Best regards,
Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090711/777dc8fd/attachment.htm>


More information about the Insight-users mailing list