18 #ifndef itkImageToNeighborhoodSampleAdaptor_h
19 #define itkImageToNeighborhoodSampleAdaptor_h
34 namespace Statistics {
51 template <
typename TImage,
typename TBoundaryCondition >
53 public ListSample< std::vector< ConstNeighborhoodIterator< TImage, TBoundaryCondition > > >
98 typename std::vector< ConstNeighborhoodIterator< TImage, TBoundaryCondition > >;
99 using ValueType =
typename MeasurementVectorType::value_type;
108 void SetImage(
const TImage* image);
111 const TImage* GetImage()
const;
125 void SetUseImageRegion(
const bool& flag);
128 itkGetConstMacro( UseImageRegion,
bool );
131 itkBooleanMacro( UseImageRegion );
157 *
this = adaptor->
Begin();
180 return this->m_MeasurementVectorCache;
185 return m_InstanceIdentifier;
190 ++(m_MeasurementVectorCache[0]);
191 ++m_InstanceIdentifier;
211 this->m_MeasurementVectorCache.clear();
212 this->m_MeasurementVectorCache.push_back(iter);
213 m_InstanceIdentifier = iid;
243 this->ConstIterator::operator=( iter );
247 #if !(defined(_MSC_VER) && (_MSC_VER <= 1200))
279 Iterator iter(nIterator, m_Region.GetNumberOfPixels());
308 void PrintSelf(std::ostream& os,
Indent indent)
const override;
317 bool m_UseImageRegion{
true};
324 template <
typename TImage,
typename TBoundaryCondition>
330 #ifndef ITK_MANUAL_INSTANTIATION
331 #include "itkImageToNeighborhoodSampleAdaptor.hxx"
typename std::vector< ConstNeighborhoodIterator< TImage, TBoundaryCondition > > MeasurementVectorType
typename NeighborhoodIteratorType::NeighborhoodType NeighborhoodType
ConstIterator(NeighborhoodIteratorType iter, InstanceIdentifier iid)
NeighborhoodRadiusType m_Radius
typename RegionType::OffsetTableType OffsetTableType
ITK_ITERATOR_VIRTUAL void GoToBegin() ITK_ITERATOR_FINAL
Iterator(const Iterator &iter)
InstanceIdentifier m_InstanceIdentifier
ConstIterator(const ImageToNeighborhoodSampleAdaptor *adaptor)
ConstIterator & operator++()
bool operator==(const ConstIterator &it)
A light-weight container object for storing an N-dimensional neighborhood of values.
AbsoluteFrequencyType GetFrequency() const
typename ImageType::RegionType RegionType
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
typename Superclass::AbsoluteFrequencyType AbsoluteFrequencyType
typename NeighborhoodIteratorType::IndexType NeighborhoodIndexType
typename ImageType::Pointer ImagePointer
ConstIterator & operator=(const ConstIterator &iter)
ImageConstPointer m_Image
typename ImageType::PixelContainerConstPointer PixelContainerConstPointer
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
MeasurementVectorType m_MeasurementVectorCache
typename Superclass::InstanceIdentifier InstanceIdentifier
typename ImageType::OffsetType OffsetType
InstanceIdentifier GetInstanceIdentifier() const
ConstIterator Begin() const
ITK_ITERATOR_VIRTUAL void GoToEnd() ITK_ITERATOR_FINAL
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Represent a n-dimensional size (bounds) of a n-dimensional image.
bool operator!=(const ConstIterator &it)
typename ImageType::ConstPointer ImageConstPointer
const MeasurementVectorType & GetMeasurementVector() const
ValueType MeasurementType
ConstIterator(const ConstIterator &iter)
typename MeasurementVectorType::value_type ValueType
typename ImageType::PixelType PixelType
This class is the native implementation of the a Sample with an STL container.
typename ImageType::OffsetValueType OffsetValueType
typename ImageType::SizeType SizeType
Control indentation during Print() invocation.
MeasurementVectorType m_MeasurementVectorInternal
OffsetTableType m_OffsetTable
Iterator(NeighborhoodIteratorType iter, InstanceIdentifier iid)
ConstIterator End() const
typename ImageType::IndexType IndexType
typename Superclass::RadiusType RadiusType
IndexType m_NeighborIndexInternal
typename Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
This class provides ListSample interface to ITK Image.
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
signed long OffsetValueType
InstanceIdentifier m_InstanceIdentifierInternal
Base class for all data objects in ITK.
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
typename NeighborhoodIteratorType::SizeType NeighborhoodSizeType
typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
typename NeighborhoodIteratorType::RadiusType NeighborhoodRadiusType