18 #ifndef itkSubsample_h
19 #define itkSubsample_h
41 template <
typename TSample>
42 class ITK_TEMPLATE_EXPORT
Subsample :
public TSample
80 #if defined(__clang__) && defined(__has_warning)
81 # if __has_warning("-Winconsistent-missing-override")
82 # pragma clang diagnostic push
83 # pragma clang diagnostic ignored "-Winconsistent-missing-override"
91 return this->m_IdHolder;
94 #if defined(__clang__) && defined(__has_warning)
95 # if __has_warning("-Winconsistent-missing-override")
96 # pragma clang diagnostic pop
102 SetSample(
const TSample * sample);
109 InitializeWithAllInstances();
113 AddInstance(InstanceIdentifier
id);
118 Size()
const override;
126 const MeasurementVectorType &
127 GetMeasurementVector(InstanceIdentifier
id)
const override;
130 AbsoluteFrequencyType
131 GetFrequency(InstanceIdentifier
id)
const override;
134 TotalAbsoluteFrequencyType
135 GetTotalFrequency()
const override;
138 Swap(
unsigned int index1,
unsigned int index2);
141 GetInstanceIdentifier(
unsigned int index);
143 const MeasurementVectorType &
144 GetMeasurementVectorByIndex(
unsigned int index)
const;
146 AbsoluteFrequencyType
147 GetFrequencyByIndex(
unsigned int index)
const;
151 Graft(
const DataObject * thatObject)
override;
179 return (m_Iter != it.
m_Iter);
185 return (m_Iter == it.
m_Iter);
198 return m_Sample->GetFrequency(*m_Iter);
204 return m_Sample->GetMeasurementVector(*m_Iter);
210 return (m_Iter - m_Subsample->GetIdHolder().begin());
220 , m_Subsample(classSample)
221 , m_Sample(classSample->GetSample())
225 typename InstanceIdentifierHolder::const_iterator
m_Iter;
250 this->ConstIterator::operator=(iter);
259 Iterator(
typename InstanceIdentifierHolder::const_iterator iter,
const Self * classSample);
265 Iterator(
typename InstanceIdentifierHolder::iterator iter,
Self * classSample)
277 Iterator iter(m_IdHolder.begin(),
this);
287 Iterator iter(m_IdHolder.end(),
this);
312 PrintSelf(std::ostream & os,
Indent indent)
const override;
323 #ifndef ITK_MANUAL_INSTANTIATION
324 # include "itkSubsample.hxx"