[Insight-developers] Using ConstantPadImageFilter on vector images

Lydia Ng lng@insightful.com
Wed, 2 Jan 2002 15:47:30 -0800


Jim,

> Can we change the code so that it tries to use NumericTraits
> of the "value type" of the pixel?
>=20
> 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.

Does this option mean that the filter then have to know
whether or not it is dealing with scalar or vector pixels?

The filter will also have to know how big the vector
is so that it can fill the vector with the appropriate
number of zeros.

-Lydia

> -----Original Message-----
> From: Miller, James V (CRD) [mailto:millerjv@crd.ge.com]
> Sent: Wednesday, January 02, 2002 2:03 PM
> To: Lydia Ng; Insight-developers (E-mail)
> Subject: RE: [Insight-developers] Using=20
> ConstantPadImageFilter on vector
> images
>=20
>=20
> Can we change the code so that it tries to use NumericTraits
> of the "value type" of the pixel?
>=20
> 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.
>=20
>=20
>=20
>=20
>=20
> -----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
>=20
>=20
> Hi All,
>=20
> I would like to use ConstantPadImageFilter
> on vector images (i.e. where the image pixel is
> of type itk::Vector<someScalar,vectorDimension>).
>=20
> 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.
>=20
> 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*?
>=20
> 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.
>=20
> Any suggestions?
>=20
> Cheers,
> Lydia
>=20
>=20
>=20
>=20
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>=20