[Insight-developers] PointSet always assumes 3-D points??

Brad King brad.king@kitware.com
Fri, 13 Apr 2001 08:46:37 -0400 (EDT)


> I have previously had a go at using PointSet.
> PointSet can take points of any dimension.
> The actual template parameters are PointSet<PixelType,MeshTraits>.
> It is through the MeshTraits you set the point dimension.
> 
> For example, if you wanted 4D points then you need to do
> something like this:
> 
>   enum{ SpaceDimension = 4 };
>   typedef int PixelType;
>   typedef itk::DefaultStaticMeshTraits< PixelType, SpaceDimension >
> MeshTraits;
>   typedef itk::PointSet< PixelType, MeshTraits > PointSet;
> 

This is definately inconsistent from the Image class, and was a mistake in
my original design of the Mesh.  I think this makes it too hard to change
the dimension of a Mesh (or its superclass, a PointSet).  Right now, the
Mesh (and PointSet) look like this:

template <typename TPixelType,
          typename TMeshTraits = DefaultStaticMeshTraits<TPixelType> >
class Mesh ....

The Image looks like this:

template <typename TPixelType,
          unsigned int VDimension = 2,
          typename TPixelContainer = ValarrayImageContainer<unsigned long,
                                                            TPixel> >
class Image ....

I suggest we change them to:

template <typename TPixelType,
          unsigned int VDimension = 3,
          typename TMeshTraits = DefaultStaticMeshTraits<TPixelType,
                                                         VDimension> >
class Mesh ....

and

template <typename TPixelType,
          unsigned int VDimension = 2,
          typename TImageTraits = DefaultImageTraits<TPixelType,
                                                     VDimension> >
class Image ....

Due to the existing use of default arguments, I don't think this will
require very much other code to be changed.  This will also make the two
classes more consistent.

Thoughts?
-Brad