[Insight-developers] Variable sigma along each axis in itk::SmoothingRecursiveGaussianImageFilter

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jun 17 14:05:00 EDT 2010


Hello Karthik,

In general I think this is a good idea. However looking at the convention for the DiscreteGaussianImageFilter, I see that it uses methods overloading to have the following functions:
	virtual void SetVarriance( ArrayType _arg );
	void SetVariance (const typename ArrayType::ValueType v);
	void SetVariance (const double *v);
	void SetVariance (const float *v);

with only one get method:
	virtual ArrayType GetVariance( void ) const;

However looking at all the other recursive Gaussian filters (not compressive list):
	GradientMagnitudeRecursiveGaussianImageFilter
	RecursiveGaussianImageFilter
	GradientRecursiveGaussianImageFilter
	HessianRecursiveGaussianImageFilter
	SmoothingRecursiveGaussianImageFilter
	LaplacianRecursiveGaussianImageFilter.h

They currently seem to follow the convention of just:
	void SetSigma( RealType sigma );
	RealType GetSigma( void );

1) While there is not consistency between the Discrete and Recursive filters they currently are consistent amongst themselves. If array methods are added to one recursive filter, they should be added to them all to maintain the same interface.
2) More often then not I believe function overloading with different parameters is used to set the array in this type of situation. Again a constant interface is good.
3) Due to not being able to overload return methods, I don't think we can get a good interface with the Get methods...

my thoughts,
Brad

On Jun 17, 2010, at 1:12 PM, Karthik Krishnan wrote:

> I'd like to commit a minor enhancement to itk::SmoothingRecursiveGaussianImageFilter to be able to take in variable sigma along each dimension. The patch is attached. All tests seem to be passing on the experimental submitted to the dashboard from isengard.
> 
> There are no changes to the public or protected API. Just the addition of the method SetSigmaArray( const SigmaArrayType & ) . The existing SetSigma( scalar ) method goes through the above method. Also the type of m_Sigma is been changed from a scalar to a vector, but this should cause no issues to users or derived classes, since m_Sigma is private.
> 
> Thanks
> --
> karthik
> <itkSmoothingRecursiveGaussianImageFilter.patch><ATT00001..txt>

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100617/bbf97733/attachment.htm>


More information about the Insight-developers mailing list