#include <DiscretizableShapeInterface.hpp>
Public Member Functions | |
virtual std::auto_ptr < BoundaryDiscretizer < SHAPE_DIMENSION > > | boundary_discretizer (size_t n_points) const =0 |
Static Public Attributes | |
static const size_t | SHAPE_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); }
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.
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.