30 template<
unsigned int VOffsetDimension >
55 template<
unsigned int VOffsetDimension = 2 >
63 itkStaticConstMacro(
Dimension,
unsigned int, VOffsetDimension);
81 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
82 { result[i] = m_Offset[i] + offset[i]; }
92 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
93 { result[i] = m_Offset[i] + size[i]; }
101 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
102 { m_Offset[i] += size[i]; }
111 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
112 { m_Offset[i] -= size[i]; }
123 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
124 { result[i] = m_Offset[i] - vec.
m_Offset[i]; }
132 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
142 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
154 for (
unsigned int i = 0; i < VOffsetDimension && same; i++ )
155 { same = ( m_Offset[i] == vec.
m_Offset[i] ); }
165 for (
unsigned int i = 0; i < VOffsetDimension && same; i++ )
166 { same = ( m_Offset[i] == vec.
m_Offset[i] ); }
173 {
return m_Offset[dim]; }
179 {
return m_Offset[dim]; }
192 val+VOffsetDimension,
199 static Self GetBasisOffset(
unsigned int dim);
204 {
for (
unsigned int i = 0; i < VOffsetDimension; ++i ) { m_Offset[i] = value; } }
213 #if defined( ITK_WRAPPING_PARSER )
220 void operator=(
const Self&);
234 template<
unsigned int VOffsetDimension >
241 for (
unsigned int i = 0; i < VOffsetDimension; ++i )
257 template<
unsigned int VOffsetDimension >
258 Offset< VOffsetDimension >
269 template<
unsigned int VOffsetDimension >
270 std::ostream & operator<<(std::ostream & os, const Offset< VOffsetDimension > & ind)
273 unsigned int dimlim = VOffsetDimension - 1;
274 for (
unsigned int i = 0; i < dimlim; ++i )
276 os << ind[i] <<
", ";
278 if ( VOffsetDimension >= 1 )
280 os << ind[VOffsetDimension - 1];
OffsetValueType m_Offset[VOffsetDimension]
Represent the offset between two n-dimensional indexes in a n-dimensional image.
const Self & operator-=(const Self &vec)
Represent the size (bounds) of a n-dimensional image.
signed long OffsetValueType
const Self operator+(const Size< VOffsetDimension > &size) const
const OffsetValueType * GetOffset() const
Order Offset instances lexicographically.
const Self & operator+=(const Self &vec)
bool operator==(const Self &vec) const
OffsetValueType operator[](unsigned int dim) const
bool operator()(Offset< VOffsetDimension > const &l, Offset< VOffsetDimension > const &r) const
void SetOffset(const OffsetValueType val[VOffsetDimension])
void Fill(OffsetValueType value)
const unsigned int Dimension
static unsigned int GetOffsetDimension()
bool operator!=(const Self &vec) const
const Self operator-(const Self &vec)
Functor::OffsetLexicographicCompare< VOffsetDimension > LexicographicCompare
OffsetValueType & operator[](unsigned int dim)
const Self & operator-=(const Size< VOffsetDimension > &size)
itk::OffsetValueType OffsetValueType
Offset< VOffsetDimension > OffsetType
const Self & operator+=(const Size< VOffsetDimension > &size)
static Self GetBasisOffset(unsigned int dim)
const Self operator+(const Self &offset) const