18 #ifndef itkImageToListSampleAdaptor_h
19 #define itkImageToListSampleAdaptor_h
53 template <
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;
126 if (m_Image.IsNull())
128 return Superclass::GetMeasurementVectorSize();
132 return m_Image->GetNumberOfComponentsPerPixel();
137 AbsoluteFrequencyType
138 GetFrequency(InstanceIdentifier
id)
const override;
141 TotalAbsoluteFrequencyType
142 GetTotalFrequency()
const override;
158 : m_Iter(iter.m_Iter)
159 , m_InstanceIdentifier(iter.m_InstanceIdentifier)
180 return this->m_MeasurementVectorCache;
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);
259 const ImagePointer nonConstImage = const_cast<ImageType *>(m_Image.GetPointer());
260 ImageIteratorType imageIterator(nonConstImage, nonConstImage->GetLargestPossibleRegion());
262 const Iterator iter(imageIterator, 0);
271 const ImagePointer nonConstImage = const_cast<ImageType *>(m_Image.GetPointer());
275 const Iterator iter(imageIterator, largestRegion.GetNumberOfPixels());
300 const ConstIterator iter(imageConstIterator, largestRegion.GetNumberOfPixels());
310 PrintSelf(std::ostream & os,
Indent indent)
const override;
320 #ifndef ITK_MANUAL_INSTANTIATION
321 # include "itkImageToListSampleAdaptor.hxx"