template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
class itk::BoundingBox< TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer >
Represent and compute information about bounding boxes.
BoundingBox is a supporting class that represents, computes, and caches information about bounding boxes. The bounding box can be computed from several sources, including manual specification and computation from an input points container.
This is a templated, n-dimensional version of the bounding box. Bounding boxes are represented by n pairs of (min,max) pairs, where min is the minimum coordinate value and max is the maximum coordinate value for coordinate axis i.
Template parameters for BoundingBox:
- Template Parameters
-
TPointIdentifier | The type used to access a particular point (i.e., a point's id) |
TCoordinate | Numerical type with which to represent each coordinate value. |
VPointDimension | Geometric dimension of space. |
- Examples
- SphinxExamples/src/Core/Common/BoundingBoxOfAPointSet/Code.cxx.
Definition at line 70 of file itkBoundingBox.h.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Get the length squared of the diagonal of the bounding box. Returns zero if bounding box cannot be computed. Note that the Accumulate type is used to represent the length.
Definition at line 179 of file itkBoundingBox.h.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Hold on to the type information specified by the template parameters.
Definition at line 91 of file itkBoundingBox.h.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Compute and return the corners of the bounding box.
- Note
- This function returns the same points as the legacy member function
GetCorners()
, but it is const
, and it avoids dynamic memory allocation by using std::array
.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
void itk::BoundingBox< TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer >::ConsiderPoint |
( |
const PointType & |
| ) |
|
Adjust bounds (if necessary) as if the given point was in the set of points being considered. Does not add the given point to the set. Therefore, this point not considered in future computeboundingbox/gets once the point set is changed.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Duplicates this bounding box
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Get the bounding box. This method should only be invoked after ComputeBoundingBox(), otherwise the Bounds values will not be up to date. Note that many methods in this class invoke ComputeBoundingBox() internally, for example GetMinimum(), GetMaximum(), GetCenter(), GetDiagonalLength2(). Therefore it is safe to invoke GetBounds() after any of those methods.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Get the center of the bounding box. Returns a point at the origin when the bounding box object is just default-initialized.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Get the maximum point of the bounding box. Returns a point at the origin when the bounding box object is just default-initialized.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Get the minimum point of the bounding box. Returns a point at the origin when the bounding box object is just default-initialized.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Method Compute the Modified Time based on changed to the components.
Reimplemented from itk::Object.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
bool itk::BoundingBox< TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer >::IsInside |
( |
const PointType & |
| ) |
const |
Method that checks if a point is inside the bounding box.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Compute and return the corners of the bounding box Method that actually computes bounding box.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Method for creation through the object factory.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
void itk::BoundingBox< TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer >::PrintSelf |
( |
std::ostream & |
os, |
|
|
Indent |
indent |
|
) |
| const |
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::LightObject.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Set the maximum point of the bounding box. May not be valid for the given set of points. Will be preserved until this filter's (i.e., the point set's) modified time changes.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Set the minimum point of the bounding box. May not be valid for the given set of points. Will be preserved until this filter's (i.e., the point set's) modified time changes.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
Set/Get the points from which the bounding box should be computed. The bounding box is cached and is not recomputed if the points are not changed.
template<typename TPointIdentifier = IdentifierType, unsigned int VPointDimension = 3, typename TCoordinate = float, typename TPointsContainer = VectorContainer<TPointIdentifier, Point<TCoordinate, VPointDimension>>>
constexpr unsigned int itk::BoundingBox< TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer >::PointDimension = VPointDimension |
|
staticconstexpr |
Hold on to the dimensions specified by the template parameters.
Definition at line 105 of file itkBoundingBox.h.