[Insight-users] Can't create PoinSet type - WrapITK Python

Luis Ibanez luis.ibanez at kitware.com
Mon Jul 6 09:23:55 EDT 2009


Hi Carlos,


The PointSet has not been instantiated for

        pixel type = "unsigned short"  (itk.US)


You will find instantiations for


        pixel type = "double"   (itk.D)



Please try the following:


    import itk
    pixeltype = itk.D
    dim = 3
    traitstype = itk.DefaultStaticMeshTraits[itk.D, dim, dim, itk.D]
    pointsettype = itk.PointSet[ itk.D, dim, traitstype ]
    pointset1 = pointsettype.New()




Regards,



     Luis



-------------------
Carlos Moro wrote:
> Hi!
> 
> I'm trying to create a PointSet type with the following code:
> 
> import itk
> pixelType = itk.US
> dimension = 3
> PointSetType = itk.PointSet[pixelType, dimension]
> 
> But I get the following error:
> 
> Traceback (most recent call last):
>   File "PointSet1.py", line 53, in <module>
>     PointSetType = itk.PointSet[pixelType, dimension]
>   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 (<itkCType unsigned short>, 3) for 
> the itk::PointSet class'
> 
> Looking at WrapITK/lib/itkPointSet.py, there are definitions like  
> itkPointSetD3D:
>    def __repr__(self):
>         return "<C 
> itk::PointSet<(double,3u,itk::DefaultDynamicMeshTraits<(double,3u,3u,double,float,double)>)> 
> instance at %s>" % (self.this,)
> ... but I can't figure out how to template them .
> 
> I'm using ubuntu + paulnovo.org <http://paulnovo.org> packages with WrapITK.
> 
> Best regards,
> Carlos
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> 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 ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list