18#ifndef itkMembershipSample_h
19#define itkMembershipSample_h
21#include <unordered_map>
56template <
typename TSample>
109 itkGetConstMacro(NumberOfClasses,
unsigned int);
191 ++m_InstanceIdentifier;
198 return m_Sample->GetFrequency(m_InstanceIdentifier);
204 return m_Sample->GetMeasurementVector(m_InstanceIdentifier);
210 return m_InstanceIdentifier;
216 return m_MembershipSample->GetClassLabel(m_InstanceIdentifier);
225 : m_Sample(memberSample->GetSample())
226 , m_MembershipSample(memberSample)
227 , m_InstanceIdentifier(iid)
252 this->ConstIterator::operator=(iter);
288 Iterator iter(
this, m_Sample->Size());
323 std::vector<ClassSamplePointer> m_ClassSamples{};
325 unsigned int m_NumberOfClasses{};
330#ifndef ITK_MANUAL_INSTANTIATION
331# include "itkMembershipSample.hxx"
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Base class for most ITK classes.
bool operator==(const ConstIterator &it) const
ConstIterator & operator=(const ConstIterator &iter)
AbsoluteFrequencyType GetFrequency() const
const MembershipSample * m_MembershipSample
ConstIterator & operator++()
const MeasurementVectorType & GetMeasurementVector() const
ConstIterator(const ConstIterator &iter)
InstanceIdentifier m_InstanceIdentifier
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ConstIterator)
ConstIterator(const Self *memberSample, InstanceIdentifier iid)
ConstIterator(const Self *sample)
InstanceIdentifier GetInstanceIdentifier() const
unsigned int GetClassLabel() const
ConstIterator & operator=(const ConstIterator &it)
Iterator(const Self *sample)
Iterator & operator=(const Iterator &iter)
Iterator(const Iterator &iter)
Iterator(const ConstIterator &it)
Iterator(Self *memberSample, InstanceIdentifier iid)
Container for storing the instance-identifiers of other sample with their associated class labels.
typename SampleType::ConstPointer SampleConstPointer
typename ClassSampleType::Pointer ClassSamplePointer
TotalAbsoluteFrequencyType GetTotalFrequency() const
typename SampleType::MeasurementType MeasurementType
const MeasurementVectorType & GetMeasurementVector(const InstanceIdentifier &id) const
~MembershipSample() override=default
void Graft(const DataObject *thatObject) override
unsigned int GetClassLabel(const InstanceIdentifier &id) const
typename SampleType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
ConstIterator End() const
const ClassSampleType * GetClassSample(const ClassLabelType &classLabel) const
typename SampleType::AbsoluteFrequencyType AbsoluteFrequencyType
IdentifierType ClassLabelType
std::vector< ClassLabelType > UniqueClassLabelsType
typename ClassSampleType::ConstPointer ClassSampleConstPointer
typename SampleType::MeasurementVectorType MeasurementVectorType
std::unordered_map< InstanceIdentifier, ClassLabelType > ClassLabelHolderType
ConstIterator Begin() const
typename SampleType::InstanceIdentifier InstanceIdentifier
void PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfClasses(unsigned int numberOfClasses)
const ClassLabelHolderType GetClassLabelHolder() const
MeasurementType GetMeasurement(const InstanceIdentifier &id, const unsigned int dimension)
void AddInstance(const ClassLabelType &classLabel, const InstanceIdentifier &id)
int GetInternalClassLabel(const ClassLabelType classLabel) const
AbsoluteFrequencyType GetFrequency(const InstanceIdentifier &id) const
A collection of measurements for statistical analysis.
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT DataObject
SizeValueType IdentifierType