[Insight-users] Setting Radius in python - Median Filter

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Apr 6 15:30:34 EDT 2011


Hi Peter,

You may want to try WrapITK instead of the older CSwig wrapping.
With WrapITK, you line

   image_filter.SetRadius( 5 )

should work, and be equivalent to the solution you found.

You can use it by turning on USE_WRAP_ITK while building ITK.

Regards,

Gaëtan



Le 5 avr. 11 à 21:52, Peter a écrit :

> Sorry for this, but found the solution
> 	sizeRadius = itk.itkSize
> 	sizeRadius.SetElement
> Peter
>
> On Tuesday, April 05, 2011, Peter wrote:
>> Hi,
>>
>> I am new to itk and I apologise for this basic question.
>>
>> I have compiled itk v3.20.0 for python using CableSwig from the cvs
>> repository and all installed without error.
>>
>> I have a simple program where I want to apply a median filter to a  
>> data aet
>> and I use the following image_filter =  
>> itk.itkMedianImageFilterF3F3_New()
>> 	image_filter.SetRadius( 5 )
>>
>> but I get the following error
>> 	Traceback (most recent call last):
>> 	  File "/home/peter/Src/Python/Py_Scripts/itk_chk.py", line 21, in
>> <module> image_filter.SetRadius( 5 )
>> 	  File "/usr/local/lib/InsightToolkit/itkMedianImageFilter.py",  
>> line 1145,
>> in SetRadius def SetRadius(*args): return
>> _itkMedianImageFilter 
>> .itkMedianImageFilterF3F3_Pointer_SetRadius(*args)
>> TypeError: Expected a pointer
>> How do I pass the '5' as a pointer?
>>
>> Any help will be greatlyu appreciated,
>>
>> Peter
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.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
>
>
> -- 
> Peter M. Bloomfield
> Physicist,
> PET Centre,
> Centre for Addiction and Mental Health,
> 250 College St.,
> Toronto, Ontario,
> Canada M5T 1R8
> Tel: 416 535 8501 Ext. 4243
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110406/3c82af06/attachment.pgp>


More information about the Insight-users mailing list