18 #ifndef itkImageToListSampleAdaptor_h
19 #define itkImageToListSampleAdaptor_h
53 template<
typename TImage >
55 public ListSample< typename MeasurementVectorPixelTraits< typename TImage::PixelType >::MeasurementVectorType >
105 void SetImage(
const TImage *image);
108 const TImage * GetImage()
const;
121 if( m_Image.IsNull() )
123 return Superclass::GetMeasurementVectorSize();
127 return m_Image->GetNumberOfComponentsPerPixel();
132 AbsoluteFrequencyType GetFrequency(InstanceIdentifier
id)
const override;
135 TotalAbsoluteFrequencyType GetTotalFrequency()
const override;
149 *
this = adaptor->
Begin();
154 m_InstanceIdentifier(iter.m_InstanceIdentifier)
172 return this->m_MeasurementVectorCache;
177 return m_InstanceIdentifier;
183 ++m_InstanceIdentifier;
189 return ( m_Iter != it.
m_Iter );
194 return ( m_Iter == it.
m_Iter );
200 m_Iter(std::move(iter)),
201 m_InstanceIdentifier(iid)
232 this->ConstIterator::operator=(iter);
255 ImageIteratorType imageIterator( nonConstImage, nonConstImage->GetLargestPossibleRegion() );
269 Iterator iter( imageIterator, largestRegion.GetNumberOfPixels() );
292 ConstIterator iter( imageConstIterator, largestRegion.GetNumberOfPixels() );
301 void PrintSelf(std::ostream & os,
Indent indent)
const override;
311 #ifndef ITK_MANUAL_INSTANTIATION
312 #include "itkImageToListSampleAdaptor.hxx"
ConstIterator End() const
InstanceIdentifier m_InstanceIdentifier
typename ImageType::IndexType IndexType
MeasurementVectorSizeType GetMeasurementVectorSize() const override
typename TMeasurementVector::ValueType ValueType
ImageConstPointer m_Image
typename Superclass::AbsoluteFrequencyType AbsoluteFrequencyType
InstanceIdentifier GetInstanceIdentifier() const
AbsoluteFrequencyType GetFrequency() const
typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
static void Assign(TArrayType &m, const TArrayType &v)
MeasurementVectorType m_MeasurementVectorInternal
typename MeasurementVectorTraitsType::ValueType MeasurementType
Traits for a pixel that define the dimension and component type.
bool operator!=(const ConstIterator &it)
typename Superclass::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
TPixelType MeasurementVectorType
ConstIterator(ImageConstIteratorType iter, InstanceIdentifier iid)
Iterator(const ImageIteratorType &iter, InstanceIdentifier iid)
typename Superclass::InstanceIdentifier InstanceIdentifier
ImageBaseType::IndexType IndexType
MeasurementVectorType m_MeasurementVectorCache
Represent a n-dimensional size (bounds) of a n-dimensional image.
Iterator & operator=(const Iterator &iter)
ConstIterator & operator=(const ConstIterator &iter)
ConstIterator(const ConstIterator &iter)
ConstIterator Begin() const
typename ImageType::ConstPointer ImageConstPointer
typename ImageType::PixelType PixelType
typename ImageType::Pointer ImagePointer
bool operator==(const ConstIterator &it)
typename MeasurementPixelTraitsType::MeasurementVectorType MeasurementVectorType
This class is the native implementation of the a Sample with an STL container.
ImageConstIteratorType m_Iter
Control indentation during Print() invocation.
Iterator(const Iterator &iter)
MeasurementVectorType ValueType
ConstIterator & operator++()
This class provides ListSample interface to ITK Image.
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
typename ImageType::PixelContainerConstPointer PixelContainerConstPointer
const MeasurementVectorType & GetMeasurementVector() const
ConstIterator(const ImageToListSampleAdaptor *adaptor)
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.