ITK  5.2.0
Insight Toolkit
Classes | Public Types | List of all members
itk::Statistics::MembershipSample< TSample > Class Template Reference

#include <itkMembershipSample.h>

+ Inheritance diagram for itk::Statistics::MembershipSample< TSample >:
+ Collaboration diagram for itk::Statistics::MembershipSample< TSample >:

Classes

class  ConstIterator
 
class  Iterator
 

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = MembershipSample
 
using Superclass = DataObject
 
- Public Types inherited from itk::DataObject
using ConstPointer = SmartPointer< const Self >
 
using DataObjectIdentifierType = std::string
 
using DataObjectPointerArraySizeType = std::vector< Pointer >::size_type
 
using Pointer = SmartPointer< Self >
 
using Self = DataObject
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 
using SampleType = TSample
 
using MeasurementVectorType = typename SampleType::MeasurementVectorType
 
using MeasurementType = typename SampleType::MeasurementType
 
using InstanceIdentifier = typename SampleType::InstanceIdentifier
 
using SampleConstPointer = typename SampleType::ConstPointer
 
using AbsoluteFrequencyType = typename SampleType::AbsoluteFrequencyType
 
using TotalAbsoluteFrequencyType = typename SampleType::TotalAbsoluteFrequencyType
 
using ClassLabelType = IdentifierType
 
using UniqueClassLabelsType = std::vector< ClassLabelType >
 
using ClassLabelHolderType = std::unordered_map< InstanceIdentifier, ClassLabelType >
 
using ClassSampleType = Subsample< SampleType >
 
using ClassSamplePointer = typename ClassSampleType::Pointer
 
using ClassSampleConstPointer = typename ClassSampleType::ConstPointer
 
UniqueClassLabelsType m_UniqueClassLabels
 
ClassLabelHolderType m_ClassLabelHolder
 
std::vector< ClassSamplePointerm_ClassSamples
 
SampleConstPointer m_Sample
 
unsigned int m_NumberOfClasses
 
virtual const char * GetNameOfClass () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual void SetSample (const SampleType *_arg)
 
virtual const SampleTypeGetSample () const
 
void SetNumberOfClasses (unsigned int numberOfClasses)
 
virtual unsigned int GetNumberOfClasses () const
 
void AddInstance (const ClassLabelType &classLabel, const InstanceIdentifier &id)
 
unsigned int GetClassLabel (const InstanceIdentifier &id) const
 
const ClassSampleTypeGetClassSample (const ClassLabelType &classLabel) const
 
const ClassLabelHolderType GetClassLabelHolder () const
 
const MeasurementVectorTypeGetMeasurementVector (const InstanceIdentifier &id) const
 
MeasurementType GetMeasurement (const InstanceIdentifier &id, const unsigned int &dimension)
 
AbsoluteFrequencyType GetFrequency (const InstanceIdentifier &id) const
 
TotalAbsoluteFrequencyType GetTotalFrequency () const
 
void Graft (const DataObject *thatObject) override
 
Iterator Begin ()
 
Iterator End ()
 
ConstIterator Begin () const
 
ConstIterator End () const
 
static Pointer New ()
 
 MembershipSample ()
 
 ~MembershipSample () override=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
int GetInternalClassLabel (const ClassLabelType classLabel) const
 

Additional Inherited Members

- Public Member Functions inherited from itk::DataObject
void DisconnectPipeline ()
 
bool GetDataReleased () const
 
virtual const bool & GetReleaseDataFlag () const
 
SmartPointer< ProcessObjectGetSource () const
 
DataObjectPointerArraySizeType GetSourceOutputIndex () const
 
const DataObjectIdentifierTypeGetSourceOutputName () const
 
virtual void Initialize ()
 
virtual void PropagateRequestedRegion ()
 
void ReleaseData ()
 
virtual void ReleaseDataFlagOff ()
 
virtual void ReleaseDataFlagOn ()
 
virtual void ResetPipeline ()
 
void SetReleaseDataFlag (bool flag)
 
bool ShouldIReleaseData () const
 
virtual void Update ()
 
virtual void UpdateOutputData ()
 
virtual void UpdateOutputInformation ()
 
void SetPipelineMTime (ModifiedTimeType time)
 
virtual const ModifiedTimeTypeGetPipelineMTime () const
 
virtual ModifiedTimeType GetUpdateMTime () const
 
virtual void SetRealTimeStamp (RealTimeStamp _arg)
 
virtual const RealTimeStampGetRealTimeStamp () const
 
virtual void PrepareForNewData ()
 
virtual void DataHasBeenGenerated ()
 
virtual void SetRequestedRegionToLargestPossibleRegion ()
 
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion ()
 
virtual bool VerifyRequestedRegion ()
 
virtual void CopyInformation (const DataObject *)
 
virtual void SetRequestedRegion (const DataObject *)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 
- Static Public Member Functions inherited from itk::DataObject
static bool GetGlobalReleaseDataFlag ()
 
static void GlobalReleaseDataFlagOff ()
 
static void GlobalReleaseDataFlagOn ()
 
static Pointer New ()
 
static void SetGlobalReleaseDataFlag (bool val)
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Member Functions inherited from itk::DataObject
 DataObject ()
 
 ~DataObject () override
 
virtual void PropagateResetPipeline ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

template<typename TSample>
class itk::Statistics::MembershipSample< TSample >

Container for storing the instance-identifiers of other sample with their associated class labels.

This class does not store any measurement data. In a sense, you can think it as an additional information to basic samples (such as Histogram, PointSetListSampleAdaptor, and ImageToListSampleAdaptor). The additional information is a class label for a measurement vector. Obviously without such basic types of sample, this one is meaningless. You can call any basic methods that has been defined in the Sample class such as GetMeasurementVector and GetFrequency. You can query the class label for an instance using an instance-identifier. Another new and important method is the GetClassSample method. With a given class label, it returns a pointer to the Subsample object that has all the instance-identifiers of instances that belong to the class.

This class is templated over the type of the basic sample. To use all the method, you should first plug in a basic type sample using the SetSample method

ITK Sphinx Examples:
Examples
Examples/Statistics/MembershipSample.cxx, Examples/Statistics/MembershipSampleGenerator.cxx, Examples/Statistics/SelectiveSubsampleGenerator.cxx, and SphinxExamples/src/Numerics/Statistics/CreateListOfSamplesWithIDs/Code.cxx.

Definition at line 57 of file itkMembershipSample.h.

Member Typedef Documentation

◆ AbsoluteFrequencyType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::AbsoluteFrequencyType = typename SampleType::AbsoluteFrequencyType

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 81 of file itkMembershipSample.h.

◆ ClassLabelHolderType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ClassLabelHolderType = std::unordered_map<InstanceIdentifier, ClassLabelType>

Typedef for the storage that holds a class label for each instance. The relationship between instances and class label is one-to-one

Definition at line 91 of file itkMembershipSample.h.

◆ ClassLabelType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ClassLabelType = IdentifierType

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 84 of file itkMembershipSample.h.

◆ ClassSampleConstPointer

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ClassSampleConstPointer = typename ClassSampleType::ConstPointer

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 97 of file itkMembershipSample.h.

◆ ClassSamplePointer

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ClassSamplePointer = typename ClassSampleType::Pointer

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 96 of file itkMembershipSample.h.

◆ ClassSampleType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ClassSampleType = Subsample<SampleType>

Typedef for each subsample that stores instance identifiers of instances that belong to a class

Definition at line 95 of file itkMembershipSample.h.

◆ ConstPointer

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::ConstPointer = SmartPointer<const Self>

Definition at line 66 of file itkMembershipSample.h.

◆ InstanceIdentifier

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::InstanceIdentifier = typename SampleType::InstanceIdentifier

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 78 of file itkMembershipSample.h.

◆ MeasurementType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::MeasurementType = typename SampleType::MeasurementType

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 77 of file itkMembershipSample.h.

◆ MeasurementVectorType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::MeasurementVectorType = typename SampleType::MeasurementVectorType

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 76 of file itkMembershipSample.h.

◆ Pointer

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::Pointer = SmartPointer<Self>

Definition at line 65 of file itkMembershipSample.h.

◆ SampleConstPointer

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::SampleConstPointer = typename SampleType::ConstPointer

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 79 of file itkMembershipSample.h.

◆ SampleType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::SampleType = TSample

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 75 of file itkMembershipSample.h.

◆ Self

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::Self = MembershipSample

Standard class type aliases.

Definition at line 63 of file itkMembershipSample.h.

◆ Superclass

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::Superclass = DataObject

Definition at line 64 of file itkMembershipSample.h.

◆ TotalAbsoluteFrequencyType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::TotalAbsoluteFrequencyType = typename SampleType::TotalAbsoluteFrequencyType

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 82 of file itkMembershipSample.h.

◆ UniqueClassLabelsType

template<typename TSample >
using itk::Statistics::MembershipSample< TSample >::UniqueClassLabelsType = std::vector<ClassLabelType>

vector of unique class labels that will be used for mapping internal continuous class label with real class labels

Definition at line 87 of file itkMembershipSample.h.

Constructor & Destructor Documentation

◆ MembershipSample()

template<typename TSample >
itk::Statistics::MembershipSample< TSample >::MembershipSample ( )
protected

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

◆ ~MembershipSample()

template<typename TSample >
itk::Statistics::MembershipSample< TSample >::~MembershipSample ( )
overrideprotecteddefault

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Member Function Documentation

◆ AddInstance()

template<typename TSample >
void itk::Statistics::MembershipSample< TSample >::AddInstance ( const ClassLabelType classLabel,
const InstanceIdentifier id 
)

Adds an instance from the source sample to this container. The first argument is the class label for that instance. The second argument is the instance identifier from the source identifier that is going to be included this container.

◆ Begin() [1/2]

template<typename TSample >
Iterator itk::Statistics::MembershipSample< TSample >::Begin ( )
inline

This method returns an iterator to the beginning of the measurement vectors

Definition at line 280 of file itkMembershipSample.h.

◆ Begin() [2/2]

template<typename TSample >
ConstIterator itk::Statistics::MembershipSample< TSample >::Begin ( ) const
inline

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 298 of file itkMembershipSample.h.

◆ CreateAnother()

template<typename TSample >
virtual::itk::LightObject::Pointer itk::Statistics::MembershipSample< TSample >::CreateAnother ( ) const
virtual

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Reimplemented from itk::Object.

◆ End() [1/2]

template<typename TSample >
Iterator itk::Statistics::MembershipSample< TSample >::End ( )
inline

This method returns an iterator to the beginning of the measurement vectors

Definition at line 290 of file itkMembershipSample.h.

◆ End() [2/2]

template<typename TSample >
ConstIterator itk::Statistics::MembershipSample< TSample >::End ( ) const
inline

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 306 of file itkMembershipSample.h.

◆ GetClassLabel()

template<typename TSample >
unsigned int itk::Statistics::MembershipSample< TSample >::GetClassLabel ( const InstanceIdentifier id) const

Gets the class label for the instance that has the instance identifier, id.

◆ GetClassLabelHolder()

template<typename TSample >
const ClassLabelHolderType itk::Statistics::MembershipSample< TSample >::GetClassLabelHolder ( ) const

Gets the class labels that corresponding to the each instance in this container.

◆ GetClassSample()

template<typename TSample >
const ClassSampleType* itk::Statistics::MembershipSample< TSample >::GetClassSample ( const ClassLabelType classLabel) const

Gets the Subsample that includes only the instances that belong to the classLabel. If classLabel does not exist, nullptr is returned.

◆ GetFrequency()

template<typename TSample >
AbsoluteFrequencyType itk::Statistics::MembershipSample< TSample >::GetFrequency ( const InstanceIdentifier id) const

returns the frequency of the instance which is identified by the 'id'

◆ GetInternalClassLabel()

template<typename TSample >
int itk::Statistics::MembershipSample< TSample >::GetInternalClassLabel ( const ClassLabelType  classLabel) const
private

Gets the internal continuous class label from the class labels that are used for AddInstance method.

◆ GetMeasurement()

template<typename TSample >
MeasurementType itk::Statistics::MembershipSample< TSample >::GetMeasurement ( const InstanceIdentifier id,
const unsigned int &  dimension 
)

returns the measurement element which is the 'n'-th element in the 'd' dimension of the measurement vector

◆ GetMeasurementVector()

template<typename TSample >
const MeasurementVectorType& itk::Statistics::MembershipSample< TSample >::GetMeasurementVector ( const InstanceIdentifier id) const

returns the measurement of the instance which is identified by the 'id'

◆ GetNameOfClass()

template<typename TSample >
virtual const char* itk::Statistics::MembershipSample< TSample >::GetNameOfClass ( ) const
virtual

Standard macros

Reimplemented from itk::DataObject.

◆ GetNumberOfClasses()

template<typename TSample >
virtual unsigned int itk::Statistics::MembershipSample< TSample >::GetNumberOfClasses ( ) const
virtual

Gets the number of classes (class labels)

◆ GetSample()

template<typename TSample >
virtual const SampleType* itk::Statistics::MembershipSample< TSample >::GetSample ( ) const
virtual

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

◆ GetTotalFrequency()

template<typename TSample >
TotalAbsoluteFrequencyType itk::Statistics::MembershipSample< TSample >::GetTotalFrequency ( ) const

returns the total frequency for the 'd' dimension

◆ Graft()

template<typename TSample >
void itk::Statistics::MembershipSample< TSample >::Graft ( const DataObject thatObject)
overridevirtual

Method to graft another sample

Reimplemented from itk::DataObject.

◆ New()

template<typename TSample >
static Pointer itk::Statistics::MembershipSample< TSample >::New ( )
static

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

◆ PrintSelf()

template<typename TSample >
void itk::Statistics::MembershipSample< TSample >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Reimplemented from itk::DataObject.

◆ SetNumberOfClasses()

template<typename TSample >
void itk::Statistics::MembershipSample< TSample >::SetNumberOfClasses ( unsigned int  numberOfClasses)

Sets the number of classes (class labels)

◆ SetSample()

template<typename TSample >
virtual void itk::Statistics::MembershipSample< TSample >::SetSample ( const SampleType _arg)
virtual

Set/Get the actual sample data

Member Data Documentation

◆ m_ClassLabelHolder

template<typename TSample >
ClassLabelHolderType itk::Statistics::MembershipSample< TSample >::m_ClassLabelHolder
private

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 326 of file itkMembershipSample.h.

◆ m_ClassSamples

template<typename TSample >
std::vector<ClassSamplePointer> itk::Statistics::MembershipSample< TSample >::m_ClassSamples
private

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 327 of file itkMembershipSample.h.

◆ m_NumberOfClasses

template<typename TSample >
unsigned int itk::Statistics::MembershipSample< TSample >::m_NumberOfClasses
private

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 329 of file itkMembershipSample.h.

◆ m_Sample

template<typename TSample >
SampleConstPointer itk::Statistics::MembershipSample< TSample >::m_Sample
private

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 328 of file itkMembershipSample.h.

◆ m_UniqueClassLabels

template<typename TSample >
UniqueClassLabelsType itk::Statistics::MembershipSample< TSample >::m_UniqueClassLabels
private

Typedefs for Measurement vector, measurement, Instance Identifier, frequency, size, size element value from the template argument TSample

Definition at line 325 of file itkMembershipSample.h.


The documentation for this class was generated from the following file: