18 #ifndef itkSubsample_h
19 #define itkSubsample_h
41 template <
typename TSample>
42 class ITK_TEMPLATE_EXPORT
Subsample :
public TSample
54 itkOverrideGetNameOfClassMacro(
Subsample);
82 return this->m_IdHolder;
87 SetSample(
const TSample * sample);
94 InitializeWithAllInstances();
98 AddInstance(InstanceIdentifier
id);
103 Size()
const override;
111 const MeasurementVectorType &
112 GetMeasurementVector(InstanceIdentifier
id)
const override;
115 AbsoluteFrequencyType
116 GetFrequency(InstanceIdentifier
id)
const override;
119 TotalAbsoluteFrequencyType
120 GetTotalFrequency()
const override;
123 Swap(
unsigned int index1,
unsigned int index2);
126 GetInstanceIdentifier(
unsigned int index);
128 const MeasurementVectorType &
129 GetMeasurementVectorByIndex(
unsigned int index)
const;
131 AbsoluteFrequencyType
132 GetFrequencyByIndex(
unsigned int index)
const;
136 Graft(
const DataObject * thatObject)
override;
164 return (m_Iter == it.
m_Iter);
179 return m_Sample->GetFrequency(*m_Iter);
185 return m_Sample->GetMeasurementVector(*m_Iter);
191 return (m_Iter - m_Subsample->GetIdHolder().begin());
201 , m_Subsample(classSample)
202 , m_Sample(classSample->GetSample())
206 typename InstanceIdentifierHolder::const_iterator
m_Iter;
231 this->ConstIterator::operator=(iter);
240 Iterator(
typename InstanceIdentifierHolder::const_iterator iter,
const Self * classSample);
246 Iterator(
typename InstanceIdentifierHolder::iterator iter,
Self * classSample)
258 Iterator iter(m_IdHolder.begin(),
this);
268 Iterator iter(m_IdHolder.end(),
this);
293 PrintSelf(std::ostream & os,
Indent indent)
const override;
296 const TSample * m_Sample{};
298 unsigned int m_ActiveDimension{};
304 #ifndef ITK_MANUAL_INSTANTIATION
305 # include "itkSubsample.hxx"