Orfeo Toolbox  3.16
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
itk::Index< VIndexDimension > Class Template Reference

Represent a n-dimensional index in a n-dimensional image. More...

#include <itkIndex.h>

+ Inheritance diagram for itk::Index< VIndexDimension >:

List of all members.

Public Types

typedef Index< VIndexDimension > IndexType
typedef long IndexValueType
typedef
Functor::IndexLexicographicCompare
< VIndexDimension > 
LexicographicCompare
typedef Offset< VIndexDimension > OffsetType
typedef OffsetType::OffsetValueType OffsetValueType
typedef Index Self
typedef Size< VIndexDimension > SizeType

Public Member Functions

template<class TCoordRep >
void CopyWithCast (const FixedArray< TCoordRep, VIndexDimension > &point)
template<class TCoordRep >
void CopyWithRound (const FixedArray< TCoordRep, VIndexDimension > &point)
void Fill (IndexValueType value)
IndexValueType GetElement (unsigned long element) const
const IndexValueTypeGetIndex () const
bool operator!= (const Self &vec) const
const Self operator* (const SizeType &vec) const
const Self operator+ (const SizeType &size) const
const Self operator+ (const OffsetType &offset) const
const Selfoperator+= (const SizeType &size)
const Selfoperator+= (const OffsetType &offset)
const Self operator- (const SizeType &size) const
const Self operator- (const OffsetType &off) const
const OffsetType operator- (const Self &vec) const
const Selfoperator-= (const SizeType &size)
const Selfoperator-= (const OffsetType &offset)
bool operator== (const Self &vec) const
IndexValueTypeoperator[] (unsigned int dim)
IndexValueType operator[] (unsigned int dim) const
void SetElement (unsigned long element, IndexValueType val)
void SetIndex (const IndexValueType val[VIndexDimension])

Static Public Member Functions

static Self GetBasisIndex (unsigned int dim)
static unsigned int GetIndexDimension ()

Public Attributes

IndexValueType m_Index [VIndexDimension]

Detailed Description

template<unsigned int VIndexDimension = 2>
class itk::Index< VIndexDimension >

Represent a n-dimensional index in a n-dimensional image.

Index is a templated class to represent a multi-dimensional index, i.e. (i,j,k,...). Index is templated over the dimension of the index. ITK assumes the first element of an index is the fastest moving index.

For efficiency sake, Index does not define a default constructor, a copy constructor, or an operator=. We rely on the compiler to provide efficient bitwise copies.

Index is an "aggregate" class. Its data is public (m_Index) allowing for fast and convenient instantiations/assignments.

The following syntax for assigning an index is allowed/suggested:

Index<3> index = {{5, 2, 7}};

The double braces {{ and }} are needed to prevent a compiler warning about a partly bracketed initializer.

Remarks:
Should there be an itkBoundedIndex to handle bounds checking? Or should there be an API to perform bounded increments in the iterator.

Definition at line 68 of file itkIndex.h.


Member Typedef Documentation

template<unsigned int VIndexDimension = 2>
typedef Index<VIndexDimension> itk::Index< VIndexDimension >::IndexType

Compatible Index and value typedef

Definition at line 74 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef long itk::Index< VIndexDimension >::IndexValueType

Definition at line 75 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef Functor::IndexLexicographicCompare<VIndexDimension> itk::Index< VIndexDimension >::LexicographicCompare

Lexicographic ordering functor type.

Definition at line 88 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef Offset<VIndexDimension> itk::Index< VIndexDimension >::OffsetType

Compatible Offset and Offset value typedef.

Definition at line 84 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef OffsetType::OffsetValueType itk::Index< VIndexDimension >::OffsetValueType

Definition at line 85 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef Index itk::Index< VIndexDimension >::Self

Standard class typedefs.

Definition at line 71 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
typedef Size<VIndexDimension> itk::Index< VIndexDimension >::SizeType

Compatible Size typedef.

Definition at line 81 of file itkIndex.h.


Member Function Documentation

template<unsigned int VIndexDimension = 2>
template<class TCoordRep >
void itk::Index< VIndexDimension >::CopyWithCast ( const FixedArray< TCoordRep, VIndexDimension > &  point)
inline

Copy values from a FixedArray by casting each one of the components

Definition at line 280 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
template<class TCoordRep >
void itk::Index< VIndexDimension >::CopyWithRound ( const FixedArray< TCoordRep, VIndexDimension > &  point)
inline

Copy values from a FixedArray by rounding each one of the components

Definition at line 266 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
void itk::Index< VIndexDimension >::Fill ( IndexValueType  value)
inline

Set one value for the index in all dimensions. Useful for initializing an offset to zero.

Definition at line 254 of file itkIndex.h.

Referenced by itk::MRFImageFilter< TInputImage, TClassifiedImage >::Allocate(), itk::BresenhamLine< VDimension >::BuildLine(), itk::DeformableSimplexMesh3DGradientConstraintForceFilter< TInputMesh, TOutputMesh >::ComputeExternalForce(), itk::BalloonForceFilter< TInputMesh, TOutputMesh >::ComputeForce(), itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDeformationField >::ComputeUpdate(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::ConstNeighborhoodIterator(), itk::ImageIORegionAdaptor< VDimension >::Convert(), otb::ForwardFourierMellinTransformImageFilter< TPixel, TInterpol, Dimension >::GenerateOutputInformation(), otb::Rectangle< TValue >::GetBoundingRegion(), itk::KLMRegionGrowImageFilter< TInputImage, TOutputImage >::GetLabelledImage(), otb::ImageWidgetBoxForm::ImageWidgetBoxForm(), otb::ImageWidgetPointForm::ImageWidgetPointForm(), otb::ImageWidgetRectangleForm::ImageWidgetRectangleForm(), itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::Initialize(), otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor(), itk::MetaImageConverter< NDimensions, PixelType >::MetaImageToImageMaskSpatialObject(), itk::MetaImageConverter< NDimensions, PixelType >::MetaImageToImageSpatialObject(), itk::ImageSpatialObject< TDimension, TPixelType >::SetImage(), and itk::ImageRegion< VImageDimension >::Slice().

template<unsigned int VIndexDimension>
Index< VIndexDimension > itk::Index< VIndexDimension >::GetBasisIndex ( unsigned int  dim)
static

Return a basis vector of the form [0, ..., 0, 1, 0, ... 0] where the "1" is positioned in the location specified by the parameter "dim". Valid values of "dim" are 0, ..., VIndexDimension-1.

Definition at line 332 of file itkIndex.h.

References itk::Index< VIndexDimension >::m_Index.

template<unsigned int VIndexDimension = 2>
IndexValueType itk::Index< VIndexDimension >::GetElement ( unsigned long  element) const
inline

Gets the value of one of the elements in the index. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.

Warning:
No bound checking is performed
See also:
GetIndex()
SetElement()

Definition at line 244 of file itkIndex.h.

Referenced by itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::ThreadedGenerateData().

template<unsigned int VIndexDimension = 2>
const IndexValueType* itk::Index< VIndexDimension >::GetIndex ( void  ) const
inline

Get the index. This provides a read only reference to the index.

See also:
SetIndex()

Definition at line 220 of file itkIndex.h.

Referenced by itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::CollapsePhiLattice(), itk::ImageBase< ::itk::GetImageDimension< TImage >::ImageDimension >::ComputeIndex(), otb::ImageToSIFTKeyPointSetFilter< TInputImage, TOutputPointSet >::ComputeKeyPointDescriptor(), otb::ImageToSIFTKeyPointSetFilter< TInputImage, TOutputPointSet >::ComputeKeyPointOrientations(), itk::ImageBase< ::itk::GetImageDimension< TImage >::ImageDimension >::ComputeOffset(), otb::ImageToImageRCC8Calculator< TInputImage >::ConvertToBoolImage(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::Evaluate(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::EvaluateGradient(), itk::DifferenceOfGaussiansGradientImageFilter< TInputImage, TDataType >::GenerateData(), itk::DirectFourierReconstructionImageToImageFilter< TInputPixelType, TOutputPixelType >::GenerateData(), otb::ListSampleToHistogramListGenerator< TListSample, THistogramMeasurement, TFrequencyContainer >::GenerateData(), itk::HistogramToImageFilter< THistogram, TFunction >::GenerateData(), itk::Statistics::ListSampleToHistogramGenerator< TListSample, THistogramMeasurement, TFrequencyContainer, TMeasurementVectorLength >::GenerateData(), itk::ActiveShapeModelCalculator< TImage >::GenerateData(), otb::SparseUnmixingImageFilter< TInputImage, TOutputImage, VNbInputImage, TPrecision, TMotherWaveletOperator >::GenerateNumberOfComponentsRequired(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::GenerateOutputImageFast(), itk::DirectFourierReconstructionImageToImageFilter< TInputPixelType, TOutputPixelType >::GenerateOutputInformation(), itk::TileImageFilter< TInputImage, TOutputImage >::GenerateOutputInformation(), itk::LabelObject< TLabel, VImageDimension >::GetIndex(), itk::HoughTransform2DLinesImageFilter< TInputPixelType, TOutputPixelType >::GetLines(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::Initialize(), itk::LabelObject< TLabel, VImageDimension >::Optimize(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::RefineControlPointLattice(), itk::SpatialObject< TDimension >::RequestedRegionIsOutsideOfTheBufferedRegion(), itk::ImageBase< VImageDimension >::RequestedRegionIsOutsideOfTheBufferedRegion(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::SetBound(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::ThreadedGenerateData(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::UpdatePointSet(), itk::SpatialObject< TDimension >::VerifyRequestedRegion(), and itk::ImageBase< VImageDimension >::VerifyRequestedRegion().

template<unsigned int VIndexDimension = 2>
static unsigned int itk::Index< VIndexDimension >::GetIndexDimension ( )
inlinestatic

Get the dimension (size) of the index.

Definition at line 78 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
bool itk::Index< VIndexDimension >::operator!= ( const Self vec) const
inline

Compare two indices.

Definition at line 199 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self itk::Index< VIndexDimension >::operator* ( const SizeType vec) const
inline

Multiply an index by a size (elementwise product). This method models a random access Index.

Definition at line 179 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self itk::Index< VIndexDimension >::operator+ ( const SizeType size) const
inline

Add a size to an index. This method models a random access Index.

Definition at line 92 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self itk::Index< VIndexDimension >::operator+ ( const OffsetType offset) const
inline

Add an offset to an index.

Definition at line 130 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self& itk::Index< VIndexDimension >::operator+= ( const SizeType size)
inline

Increment index by a size. This method models a random access Index.

Definition at line 102 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self& itk::Index< VIndexDimension >::operator+= ( const OffsetType offset)
inline

Increment index by an offset. This method models a random access Index.

Definition at line 140 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self itk::Index< VIndexDimension >::operator- ( const SizeType size) const
inline

Subtract a size from an index. This method models a random access Index.

Definition at line 111 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self itk::Index< VIndexDimension >::operator- ( const OffsetType off) const
inline

Subtract an offset from an index.

Definition at line 158 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const OffsetType itk::Index< VIndexDimension >::operator- ( const Self vec) const
inline

Subtract two indices. This method models a random access Index.

Definition at line 168 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self& itk::Index< VIndexDimension >::operator-= ( const SizeType size)
inline

Decrement index by a size. This method models a random access Index.

Definition at line 121 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
const Self& itk::Index< VIndexDimension >::operator-= ( const OffsetType offset)
inline

Decrement index by an offset. This method models a random access Index.

Definition at line 149 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
bool itk::Index< VIndexDimension >::operator== ( const Self vec) const
inline

Compare two indices.

Definition at line 189 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
IndexValueType& itk::Index< VIndexDimension >::operator[] ( unsigned int  dim)
inline

Access an element of the index. Elements are numbered 0, ..., VIndexDimension-1. No bounds checking is performed.

Definition at line 209 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
IndexValueType itk::Index< VIndexDimension >::operator[] ( unsigned int  dim) const
inline

Access an element of the index. Elements are numbered 0, ..., VIndexDimension-1. This version can only be an rvalue. No bounds checking is performed.

Definition at line 215 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
void itk::Index< VIndexDimension >::SetElement ( unsigned long  element,
IndexValueType  val 
)
inline

Sets the value of one of the elements in the index. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.

Warning:
No bound checking is performed
See also:
SetIndex()
GetElement()

Definition at line 235 of file itkIndex.h.

template<unsigned int VIndexDimension = 2>
void itk::Index< VIndexDimension >::SetIndex ( const IndexValueType  val[VIndexDimension])
inline

Member Data Documentation

template<unsigned int VIndexDimension = 2>
IndexValueType itk::Index< VIndexDimension >::m_Index[VIndexDimension]

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

Generated at Sun Feb 3 2013 01:54:51 for Orfeo Toolbox with doxygen 1.8.1.1