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

Peter peter.bloomfield at camhpet.ca
Tue Apr 5 15:52:57 EDT 2011


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


More information about the Insight-users mailing list