[Insight-developers] gradient filter output

Damion Shelton dmsst59+@pitt.edu
Tue, 22 May 2001 14:30:50 -0400


Hi...

As an update to last week's discussion on handling gradient output, I'd like
some feedback on the current implementation of our Difference of Gaussian's
filter. The declaration looks like:

template<class TInputImage>
class ITK_EXPORT DifferenceOfGaussiansGradientImageFilter :
public ImageToImageFilter<TInputImage,
PhysicalImage<itk::CovariantVector<double, TInputImage::ImageDimension>,
  TInputImage::ImageDimension> >

Is there any sort of consensus about forcing the user to use a particular
output image type? With "normal" templating (i.e. full templating over input
and output type) I'd get a compiler error if I didn't instantiate the class
with the correct type - it seems friendlier to provide information about
this return type within the class, rather than assuming that the user will
do the right thing. Therefore., the syntax for getting data out of this
class is:

TDOGFilterType::TOutputImage::Pointer gradientOutput =
DOGFilter->GetOutput();

where TOutputImage is an internal typedef (in the
DifferenceOfGaussiansGradientImageFilter class).

To summarize, I guess the question is: How generic should we try to be? If
it makes sense to force output to a particular type, does this rub anyone
the wrong way?

Also, as a style question, I separated gradient magnitude calculations into
a separate class, GradientToMagnitudeImageFilter, which takes a gradient
(vector) image as input and produces a magnitude (scalar) image as output.
Does this seem agreeable to everyone?

Finally, if either of these implementations overlap existing work, please
let me know as soon as possible.

Thanks,

-Damion-