29 template<
unsigned int VOffsetDimension >
54 template<
unsigned int VOffsetDimension = 2 >
62 itkStaticConstMacro(Dimension,
unsigned int, VOffsetDimension);
80 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
81 { result[i] = m_Offset[i] + offset[i]; }
91 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
92 { result[i] = m_Offset[i] + size[i]; }
100 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
101 { m_Offset[i] += size[i]; }
110 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
111 { m_Offset[i] -= size[i]; }
122 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
123 { result[i] = m_Offset[i] - vec.
m_Offset[i]; }
131 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
141 for (
unsigned int i = 0; i < VOffsetDimension; i++ )
153 for (
unsigned int i = 0; i < VOffsetDimension && same; i++ )
154 { same = ( m_Offset[i] == vec.
m_Offset[i] ); }
164 for (
unsigned int i = 0; i < VOffsetDimension && same; i++ )
165 { same = ( m_Offset[i] == vec.
m_Offset[i] ); }
172 {
return m_Offset[dim]; }
178 {
return m_Offset[dim]; }
182 const OffsetValueType *
GetOffset()
const {
return m_Offset; }
188 void SetOffset(
const OffsetValueType val[VOffsetDimension])
191 val+VOffsetDimension,
198 static Self GetBasisOffset(
unsigned int dim);
202 void Fill(OffsetValueType value)
203 {
for (
unsigned int i = 0; i < VOffsetDimension; ++i ) { m_Offset[i] = value; } }
210 OffsetValueType m_Offset[VOffsetDimension];
214 #if defined( ITK_WRAPPING_PARSER ) 215 Offset() ITK_DELETE_FUNCTION;
216 Offset(const Self &) ITK_DELETE_FUNCTION;
217 void operator=(const Self &) ITK_DELETE_FUNCTION;
232 template<
unsigned int VOffsetDimension >
233 class OffsetLexicographicCompare
239 for (
unsigned int i = 0; i < VOffsetDimension; ++i )
255 template<
unsigned int VOffsetDimension >
262 memset(ind.
m_Offset, 0,
sizeof( OffsetValueType ) * VOffsetDimension);
267 template<
unsigned int VOffsetDimension >
268 std::ostream & operator<<(std::ostream & os, const Offset< VOffsetDimension > & ind)
271 unsigned int dimlim = VOffsetDimension - 1;
272 for (
unsigned int i = 0; i < dimlim; ++i )
274 os << ind[i] <<
", ";
276 if ( VOffsetDimension >= 1 )
278 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)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
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)
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