18 #ifndef itkMembershipSample_h
19 #define itkMembershipSample_h
21 #include "itksys/hash_map.hxx"
55 template<
typename TSample >
104 void SetNumberOfClasses(
unsigned int numberOfClasses);
107 itkGetConstMacro(NumberOfClasses,
unsigned int);
134 const unsigned int & dimension);
143 void Graft(
const DataObject *thatObject)
override;
155 *
this = sample->Begin();
185 ++m_InstanceIdentifier;
191 return m_Sample->GetFrequency(m_InstanceIdentifier);
196 return m_Sample->GetMeasurementVector(m_InstanceIdentifier);
201 return m_InstanceIdentifier;
206 return m_MembershipSample->GetClassLabel(m_InstanceIdentifier);
216 m_Sample( memberSample->GetSample() ), m_MembershipSample(memberSample), m_InstanceIdentifier(iid)
239 this->ConstIterator::operator=(iter);
273 Iterator iter(
this, m_Sample->Size() );
295 void PrintSelf(std::ostream & os,
Indent indent)
const override;
300 int GetInternalClassLabel(
const ClassLabelType classLabel)
const;
311 #ifndef ITK_MANUAL_INSTANTIATION
312 #include "itkMembershipSample.hxx"
IdentifierType ClassLabelType
typename ClassSampleType::ConstPointer ClassSampleConstPointer
ConstIterator & operator++()
typename SampleType::ConstPointer SampleConstPointer
InstanceIdentifier GetInstanceIdentifier() const
itksys::hash_map< InstanceIdentifier, ClassLabelType > ClassLabelHolderType
typename SampleType::InstanceIdentifier InstanceIdentifier
std::vector< ClassSamplePointer > m_ClassSamples
InstanceIdentifier m_InstanceIdentifier
typename SampleType::AbsoluteFrequencyType AbsoluteFrequencyType
typename SampleType::MeasurementVectorType MeasurementVectorType
ConstIterator(const Self *sample)
unsigned int m_NumberOfClasses
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Container for storing the instance-identifiers of other sample with their associated class labels...
class ITK_FORWARD_EXPORT DataObject
UniqueClassLabelsType m_UniqueClassLabels
Iterator & operator=(const Iterator &iter)
const MembershipSample * m_MembershipSample
ConstIterator & operator=(const ConstIterator &iter)
typename SampleType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
std::vector< ClassLabelType > UniqueClassLabelsType
SizeValueType IdentifierType
ConstIterator(const ConstIterator &iter)
Iterator(Self *memberSample, InstanceIdentifier iid)
AbsoluteFrequencyType GetFrequency() const
ClassLabelHolderType m_ClassLabelHolder
typename SampleType::MeasurementType MeasurementType
unsigned int GetClassLabel() const
SampleConstPointer m_Sample
bool operator==(const ConstIterator &it)
ConstIterator(const Self *memberSample, InstanceIdentifier iid)
Iterator(const Iterator &iter)
typename ClassSampleType::Pointer ClassSamplePointer
A collection of measurements for statistical analysis.
Control indentation during Print() invocation.
bool operator!=(const ConstIterator &it)
const MeasurementVectorType & GetMeasurementVector() const
ConstIterator End() const
Base class for most ITK classes.
ConstIterator Begin() const
Base class for all data objects in ITK.