[Insight-developers] Template parameters
Joshua Cates
cates@cayenne.cs.utah.edu
Thu, 1 Mar 2001 18:19:05 -0700 (MST)
Seems like there was some discussion on this awhile back and people
agreed(?) that for most filters the <TInputImage, TOutputImage> was the
way to go. From a "black-box" component view of constructing a pipeline,
specifying input type and output type as the template parameters makes
good sense.
Downside is that it requires a lot of fancy typenaming of typedef'd
typedefs to get at the actual parameters you need. Might be wise to
establish some conventions for how to do this that are acceptable to all
the supported compilers. (ie. enum'ing the image dimension, getting the
pixel type, etc.)
Josh.
______________________________
Josh Cates
School of Computer Science
University of Utah
Email: cates@cs.utah.edu
Phone: (801) 587-7697
URL: www.cs.utk.edu/~cates
On Thu, 1 Mar 2001, Daniel J. Blezek, Ph.D. wrote:
> Hi all,
>
> I'm digging into the Insight code, and noticed some inconsistancies is
> how template paramaters are being used. In one case:
>
> template <class TPixel, unsigned int VDimension=2>
> class ITK_EXPORT NeighborhoodOperatorImageFilter :
> public ImageToImageFilter< Image<TPixel, VDimension>,
> Image<TPixel, VDimension> >
>
>
> In another:
>
> template <class TInputImage, class TOutputImage>
> class ITK_EXPORT ShrinkImageFilter:
> public ImageToImageFilter<TInputImage,TOutputImage>
>
>
> In another:
>
> template <class TImage>
> class ITK_EXPORT ThresholdImageFilter:public ImageToImageFilter<TImage,TImage>
>
>
> Case:
> 1. Specified the pixel type and dimension
> 2. Specified both input and output image types, not really necessary,
> shrink should not change the pixel type of the data
> 3. Use only one image type for both input and output
>
> I think this raises a fundamental question about how to specify a filter.
> Do we specify by pixel type and dimension, or by input/output type, or
> just one type?
>
> Ideas?
> -dan
>
> --
> Daniel Blezek, Ph.D.
> blezek@crd.ge.com
> Visualization and Computer Vision Program
> Electronic Systems Lab
> GE Corporate Research & Development
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>