[Insight-developers] RE: BinaryErodeImageFilter

Miller, James V (Research) millerjv at crd . ge . com
Fri, 23 Aug 2002 08:56:23 -0400


The only problem would be in the SetKernel/GetKernel usage.

The kernel is typically a subclass of Neighborhood.  This permits 
the subclass to have "kernel" specific methods.

The way the code is now, you could call GetKernel() then call SetParam1()
on the kernel and then call SetKernel().

If the TKernel template parameter is removed, a user will not be able to 
"Get" the current kernel with the correct type.  But this is something
the user could work around (though it could be a bit clunky).  If the motivation
is to reduce template parameters, then it would probably be okay to remove 
it.  If the interest is making it easier on the user, we could have a 
default to the BinaryBallStructuringElement, etc.



> -----Original Message-----
> From: Brad King [mailto:brad.king@kitware.com]
> Sent: Thursday, August 22, 2002 6:07 PM
> To: Miller, James V (Research)
> Cc: Insight Developers
> Subject: BinaryErodeImageFilter
> 
> 
> Jim,
> 
> The BinaryErodeImageFilter is declared as follows:
> 
> template<class TInputImage, class TOutputImage, class TKernel>
> class ITK_EXPORT BinaryErodeImageFilter;
> 
> I quickly read through the code, and it looks like there is 
> no reason for
> TKernel to be a template argument.  The KernelType typedef 
> could instead
> be
> 
> Neighborhood<PixelType, Dimension, NeighborhoodAllocator<PixelType> >
> 
> Do you see any problem with removing the TKernel template 
> argument on this
> filter and others using the same design?
> 
> Thanks,
> -Brad
>