[ITK] pixeltype define and template lost in python warped ITK

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Sep 15 13:09:11 EDT 2014


Hello,

2) I believe that is the error message when the the filter hasn't been instantiated with that template argument. Poke around itk.BinaryImageToLabelMapFilter's dict interface, some method along the lines 'keys()' should give you a list of the types that have been compiled and can be created.

hope this helps,
Brad

On Sep 15, 2014, at 1:04 PM, gowith king <gowithking at googlemail.com> wrote:

> Hi, my Itk friends,
>       I am using python warped ITK to write my first itk process to analysis series of  mhd images, I test my procedure in slicer4 first to make sure it works well. Then I start the programming. However, two problem block me for a whole day. 
>      The imagetype of itk.Image.UC3 should be used for 16 bit image in all the itk instructions. But in my case it only has a range of 0-255. Then I take itk.Image.F3, then it get a range of '-3.40282346639e+38  3.40282346639e+38' . The grey value of my image is 0-9000 . How could I read it proprietorially?
> 
> 
>      I need to get a label map with simply threshold method, and then make few statistics with LabelStatisticsImageFilter. So the BinaryImageToLabelMapFilter is taken. but then the key error occurs: 
>  LabelFilter = itk.BinaryImageToLabelMapFilter[IUC3].New()
>   File "/usr/local/lib/ITK-4.7/Python/itkTemplate.py", line 263, in __getitem__
>     (str(parameters), self.__name__))
> KeyError: "itkTemplate : No template [<class 'itkImagePython.itkImageUC3'>] for the itk::BinaryImageToLabelMapFilter class"
> 
> 
>        What should I do to achieve the LabelStatisticsImageFilter ?
>       Thank you in advance<330.gif>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140915/88bea067/attachment-0002.html>


More information about the Community mailing list