|
ITK
5.2.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkNeighborhood_h
19 #define itkNeighborhood_h
25 #include "vnl/vnl_vector.h"
53 template <
typename TPixel,
unsigned int VDimension = 2,
typename TAllocator = NeighborhoodAllocator<TPixel>>
64 static constexpr
unsigned int NeighborhoodDimension = VDimension;
105 m_StrideTable[i] = 0;
121 operator=(
const Self & other);
125 operator=(Self &&) =
default;
177 return (axis < VDimension) ? m_StrideTable[axis] : 0;
184 return m_DataBuffer.end();
189 return m_DataBuffer.begin();
194 return m_DataBuffer.end();
199 return m_DataBuffer.begin();
207 return m_DataBuffer.size();
216 return m_DataBuffer[i];
224 return (this->
operator[]((this->
Size()) >> 1));
253 this->PrintSelf(os,
Indent(0));
262 const AllocatorType &
279 return m_OffsetTable[i];
282 virtual NeighborIndexType
283 GetNeighborhoodIndex(
const OffsetType &)
const;
288 return static_cast<NeighborIndexType>(this->
Size() / 2);
292 GetSlice(
unsigned int)
const;
301 m_Size[i] = m_Radius[i] * 2 + 1;
310 m_DataBuffer.set_size(i);
315 PrintSelf(std::ostream &,
Indent)
const;
319 ComputeNeighborhoodStrideTable();
324 ComputeNeighborhoodOffsetTable();
346 template <
typename TPixel,
unsigned int VDimension,
typename TContainer>
350 os <<
"Neighborhood:" << std::endl;
351 os <<
" Radius:" << neighborhood.
GetRadius() << std::endl;
352 os <<
" Size:" << neighborhood.
GetSize() << std::endl;
359 #ifndef ITK_MANUAL_INSTANTIATION
360 # include "itkNeighborhood.hxx"
const AllocatorType & GetBufferReference() const
const TPixel & operator[](NeighborIndexType i) const
Represent a n-dimensional size (bounds) of a n-dimensional image.
A flexible iterator for itk containers(i.e. itk::Neighborhood) that support pixel access through oper...
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
NeighborIndexType Size() const
OffsetValueType GetStride(DimensionValueType axis) const
void SetRadius(const SizeValueType *rad)
SizeValueType GetRadius(DimensionValueType n) const
A light-weight container object for storing an N-dimensional neighborhood of values.
ImageBaseType::SizeType SizeType
Control indentation during Print() invocation.
AllocatorType m_DataBuffer
SizeValueType GetSize(DimensionValueType n) const
std::vector< OffsetType > m_OffsetTable
AllocatorType & GetBufferReference()
TPixel & operator[](NeighborIndexType i)
typename SizeType::SizeValueType SizeValueType
const SizeType GetRadius() const
typename AllocatorType::iterator Iterator
unsigned int DimensionValueType
bool operator==(const Self &other) const
const char * const_iterator
typename AllocatorType::const_iterator ConstIterator
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
OffsetType GetOffset(NeighborIndexType i) const
void Print(std::ostream &os) const
SizeValueType m_InternalArray[VDimension]
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
TPixel GetCenterValue() const
signed long OffsetValueType
TPixel & GetElement(NeighborIndexType i)
virtual void Allocate(NeighborIndexType i)
SizeValueType NeighborIndexType
NeighborIndexType GetCenterNeighborhoodIndex() const
TPixel & operator[](const OffsetType &o)
const TPixel & operator[](const OffsetType &o) const
unsigned long SizeValueType
bool operator!=(const Self &other) const