32 template<
unsigned int VIndexDimension >
71 template<
unsigned int VIndexDimension = 2 >
83 itkStaticConstMacro(
Dimension,
unsigned int, VIndexDimension);
104 for (
unsigned int i = 0; i < VIndexDimension; i++ )
105 { result[i] = m_Index[i] +
static_cast< IndexValueType >( size[i] ); }
113 for (
unsigned int i = 0; i < VIndexDimension; i++ )
126 for (
unsigned int i = 0; i < VIndexDimension; i++ )
127 { result[i] = m_Index[i] -
static_cast< IndexValueType >( size[i] ); }
135 for (
unsigned int i = 0; i < VIndexDimension; i++ )
147 for (
unsigned int i = 0; i < VIndexDimension; i++ )
148 { result[i] = m_Index[i] + offset[i]; }
156 for (
unsigned int i = 0; i < VIndexDimension; i++ )
157 { m_Index[i] += offset[i]; }
166 for (
unsigned int i = 0; i < VIndexDimension; i++ )
167 { m_Index[i] -= offset[i]; }
178 for (
unsigned int i = 0; i < VIndexDimension; i++ )
179 { result[i] = m_Index[i] - off.
m_Offset[i]; }
189 for (
unsigned int i = 0; i < VIndexDimension; i++ )
190 { result[i] = m_Index[i] - vec.
m_Index[i]; }
201 for (
unsigned int i = 0; i < VIndexDimension; i++ )
212 for (
unsigned int i = 0; i < VIndexDimension && same; i++ )
213 { same = ( m_Index[i] == vec.
m_Index[i] ); }
223 for (
unsigned int i = 0; i < VIndexDimension && same; i++ )
224 { same = ( m_Index[i] == vec.
m_Index[i] ); }
229 #if defined( __GNUC__ )
230 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 )
231 #pragma GCC diagnostic push
232 #pragma GCC diagnostic ignored "-Warray-bounds"
241 #if defined( __GNUC__ )
242 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 )
243 #pragma GCC diagnostic pop
251 {
return m_Index[dim]; }
275 { m_Index[element] = val; }
284 {
return m_Index[element]; }
289 static Self GetBasisIndex(
unsigned int dim);
294 {
for (
unsigned int i = 0; i < VIndexDimension; ++i ) { m_Index[i] = value; } }
304 template<
typename TCoordRep >
307 itkForLoopRoundingAndAssignmentMacro(
IndexType,
324 template<
typename TCoordRep >
327 for (
unsigned int i = 0; i < VIndexDimension; ++i )
334 #if defined( ITK_WRAPPING_PARSER )
341 void operator=(
const Self&);
355 template<
unsigned int VIndexDimension >
362 for (
unsigned int i = 0; i < VIndexDimension; ++i )
378 template<
unsigned int VIndexDimension >
379 Index< VIndexDimension >
390 template<
unsigned int VIndexDimension >
391 std::ostream & operator<<(std::ostream & os, const Index< VIndexDimension > & ind)
394 for (
unsigned int i = 0; i + 1 < VIndexDimension; ++i )
396 os << ind[i] <<
", ";
398 if ( VIndexDimension >= 1 )
400 os << ind[VIndexDimension - 1];
bool operator()(Index< VIndexDimension > const &l, Index< VIndexDimension > const &r) const
const IndexValueType * GetIndex() const
OffsetValueType m_Offset[VOffsetDimension]
const Self & operator-=(const OffsetType &offset)
const Self operator-(const OffsetType &off) const
IndexValueType & operator[](unsigned int dim)
Represent the offset between two n-dimensional indexes in a n-dimensional image.
bool operator!=(const Self &vec) const
IndexValueType m_Index[VIndexDimension]
Represent the size (bounds) of a n-dimensional image.
Size< VIndexDimension > SizeType
signed long OffsetValueType
signed long IndexValueType
const OffsetType operator-(const Self &vec) const
Order Index instances lexicographically.
Index< VIndexDimension > IndexType
Offset< VIndexDimension > OffsetType
void CopyWithRound(const FixedArray< TCoordRep, VIndexDimension > &point)
Simulate a standard C array with copy semnatics.
static Self GetBasisIndex(unsigned int dim)
::itk::IndexValueType IndexValueType
const Self & operator+=(const OffsetType &offset)
bool operator==(const Self &vec) const
static unsigned int GetIndexDimension()
void Fill(IndexValueType value)
const Self operator*(const SizeType &vec) const
const unsigned int Dimension
SizeValueType m_Size[VDimension]
const Self operator+(const SizeType &size) const
const Self operator+(const OffsetType &offset) const
void CopyWithCast(const FixedArray< TCoordRep, VIndexDimension > &point)
const Self operator-(const SizeType &size) const
const Self & operator-=(const SizeType &size)
Functor::IndexLexicographicCompare< VIndexDimension > LexicographicCompare
void SetElement(unsigned long element, IndexValueType val)
const Self & operator+=(const SizeType &size)
IndexValueType GetElement(unsigned long element) const
Represent a n-dimensional index in a n-dimensional image.
::itk::OffsetValueType OffsetValueType
void SetIndex(const IndexValueType val[VIndexDimension])
IndexValueType operator[](unsigned int dim) const