imaging::DiscretizableShapeInterface< N > Class Template Reference
[Shape Module]

Abstract class interface for discretizable shapes of dimension N. More...

#include <DiscretizableShapeInterface.hpp>

List of all members.

Public Member Functions

virtual std::auto_ptr
< BoundaryDiscretizer
boundary_discretizer (size_t n_points) const =0

Static Public Attributes

static const size_t SHAPE_DIMENSION = N

Detailed Description

template<size_t N>
class imaging::DiscretizableShapeInterface< N >

Abstract class interface for discretizable shapes of dimension N.

This class interface defines shapes of dimension N, which can be discretized. I.e. they provide the factory function boundary_discretizer(), which returns a boundary discretizer of dimension N for the given shape. A template function which integrates an image with floating point values along the boundary of an N-dimensional shape could generically be implemented as follows:

  template <size_t N>
  float_t boundary_area(const DiscretizableShapeInterface<N> & shape, const Image<N + 1, float_t> & image)
    // sample 100 boundary points
    std::auto_ptr< BoundaryDiscretizer<N> > boundary_discretizer = shape.boundary_discretizer(100);
    return boundary_discretizer->integrate(image);

Member Function Documentation

template<size_t N>
virtual std::auto_ptr< BoundaryDiscretizer<SHAPE_DIMENSION> > imaging::DiscretizableShapeInterface< N >::boundary_discretizer ( size_t  n_points  )  const [pure virtual]

Returns a boundary discretizer for this shape.

Implemented in imaging::BsplineShape, imaging::Circle, imaging::MrepModel2d, and imaging::PolygonModel2d.

Member Data Documentation

template<size_t N>
const size_t imaging::DiscretizableShapeInterface< N >::SHAPE_DIMENSION = N [static]

The spatial dimension of the shape class. N is 2 for planar shapes and 3 for volumes.

Reimplemented in imaging::BsplineShape, and imaging::Circle.

The documentation for this class was generated from the following file:

Generated on Tue Feb 10 10:01:31 2009 for imaging2 by  doxygen 1.5.5