[Insight-developers] Using ConstantPadImageFilter on vector i mages

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 2 Jan 2002 17:02:53 -0500


Can we change the code so that it tries to use NumericTraits
of the "value type" of the pixel?

One option is to call an overloaded function where the scalar version
returns NumericTraits<PixelType>::Zero and the vector version returns
NumericTraits<PixelType::ValueType>::Zero.





-----Original Message-----
From: Lydia Ng [mailto:lng@insightful.com]
Sent: Thursday, December 27, 2001 6:11 PM
To: Insight-developers (E-mail)
Subject: [Insight-developers] Using ConstantPadImageFilter on vector
images


Hi All,

I would like to use ConstantPadImageFilter
on vector images (i.e. where the image pixel is
of type itk::Vector<someScalar,vectorDimension>).

The existing implementation does not work because as
it requires the used of NumericsTraits<PixelType>::Zero
to initialize the padding value to "zero".
Currently, NumericsTraits for itk::Vector's are not defined.

I am not sure how to go about defining a generic
NumericsTraits for Vector. Does one have to explicitly
specialize NumericsTraits for every combination
of *someScalar* and *vectorDimension*?

My other option is to create a vector version
of the filter (i.e. a VectorConstantPadImageFilter) but
that seems to be an awful lot of code duplication.

Any suggestions?

Cheers,
Lydia




_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers