18#ifndef itkImageToListSampleAdaptor_h
19#define itkImageToListSampleAdaptor_h
53template <
typename TImage>
55 :
public ListSample<typename MeasurementVectorPixelTraits<typename TImage::PixelType>::MeasurementVectorType>
97 using typename Superclass::AbsoluteFrequencyType;
98 using typename Superclass::TotalAbsoluteFrequencyType;
99 using typename Superclass::MeasurementVectorSizeType;
100 using typename Superclass::InstanceIdentifier;
106 SetImage(
const TImage * image);
114 Size()
const override;
121 GetMeasurementVectorSize()
const override
126 if (m_Image.IsNull())
128 return Superclass::GetMeasurementVectorSize();
132 return m_Image->GetNumberOfComponentsPerPixel();
142 GetTotalFrequency()
const override;
158 : m_Iter(iter.m_Iter)
159 , m_InstanceIdentifier(iter.m_InstanceIdentifier)
177 GetMeasurementVector()
const
180 return this->m_MeasurementVectorCache;
184 GetInstanceIdentifier()
const
186 return m_InstanceIdentifier;
193 ++m_InstanceIdentifier;
200 return (m_Iter == it.
m_Iter);
208 : m_Iter(
std::move(iter))
209 , m_InstanceIdentifier(iid)
245 this->ConstIterator::operator=(iter);
260 ImageIteratorType imageIterator(nonConstImage, nonConstImage->GetLargestPossibleRegion());
275 Iterator iter(imageIterator, largestRegion.GetNumberOfPixels());
300 ConstIterator iter(imageConstIterator, largestRegion.GetNumberOfPixels());
310 PrintSelf(std::ostream & os,
Indent indent)
const override;
314 mutable MeasurementVectorType m_MeasurementVectorInternal{};
320#ifndef ITK_MANUAL_INSTANTIATION
321# include "itkImageToListSampleAdaptor.hxx"
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.
Control indentation during Print() invocation.
Base class for most ITK classes.
Traits for a pixel that define the dimension and component type.
ImageConstIteratorType m_Iter
InstanceIdentifier m_InstanceIdentifier
Iterator(const ImageConstIteratorType &iter, InstanceIdentifier iid)=delete
Iterator(const ConstIterator &it)=delete
Iterator(const Self *adaptor)=delete
This class provides ListSample interface to ITK Image.
typename MeasurementVectorTraitsType::ValueType MeasurementType
typename ImageType::Pointer ImagePointer
typename MeasurementPixelTraitsType::MeasurementVectorType MeasurementVectorType
typename ImageType::IndexType IndexType
MeasurementVectorType ValueType
typename ImageType::ConstPointer ImageConstPointer
typename ImageType::PixelType PixelType
typename ImageType::PixelContainerConstPointer PixelContainerConstPointer
This class is the native implementation of the a Sample with an STL container.
TPixelType MeasurementVectorType
typename TMeasurementVector::ValueType ValueType
static void Assign(TArrayType &m, const TArrayType &v)
unsigned int MeasurementVectorSizeType
typename MeasurementVectorTraits::InstanceIdentifier InstanceIdentifier
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
MeasurementVectorTraits::AbsoluteFrequencyType AbsoluteFrequencyType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
Represent a n-dimensional size (bounds) of a n-dimensional image.