ITK  6.0.0
Insight Toolkit
itkSampleClassifierFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSampleClassifierFilter_h
19#define itkSampleClassifierFilter_h
20
21#include <vector>
22
23#include "itkMembershipSample.h"
25#include "itkDecisionRule.h"
26#include "itkProcessObject.h"
28
29namespace itk
30{
31namespace Statistics
32{
44template <typename TSample>
45class ITK_TEMPLATE_EXPORT SampleClassifierFilter : public ProcessObject
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(SampleClassifierFilter);
49
55
57 itkOverrideGetNameOfClassMacro(SampleClassifierFilter);
58 itkNewMacro(Self);
62 using SampleType = TSample;
63
67
69 using MeasurementType = typename SampleType::MeasurementType;
70 using MeasurementVectorType = typename SampleType::MeasurementVectorType;
71
75 using MembershipFunctionVectorType = std::vector<MembershipFunctionPointer>;
78
81
84
86 using ClassLabelVectorType = std::vector<ClassLabelType>;
89
93
95 using Superclass::SetInput;
96 void
97 SetInput(const SampleType * sample);
98
99 const SampleType *
100 GetInput() const;
101
104 GetOutput() const;
105
109 itkSetMacro(NumberOfClasses, unsigned int);
110 itkGetConstMacro(NumberOfClasses, unsigned int);
114 itkSetConstObjectMacro(DecisionRule, DecisionRuleType);
115 itkGetConstObjectMacro(DecisionRule, DecisionRuleType);
121 void
123
127 void
129
131 void
133
134protected:
136 ~SampleClassifierFilter() override = default;
137 void
138 PrintSelf(std::ostream & os, Indent indent) const override;
139
141 void
142 GenerateData() override;
143
151 using Superclass::MakeOutput;
156private:
157 unsigned int m_NumberOfClasses{};
158
160 DecisionRulePointer m_DecisionRule{};
161}; // end of class
162} // end of namespace Statistics
163} // end of namespace itk
164
165#ifndef ITK_MANUAL_INSTANTIATION
166# include "itkSampleClassifierFilter.hxx"
167#endif
168
169#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Base class for decision rules that return a class label based on a set of discriminant scores.
MembershipFunctionBase defines common interfaces for membership functions.
Container for storing the instance-identifiers of other sample with their associated class labels.
typename SampleType::MeasurementType MeasurementType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
void SetMembershipFunctionsWeightsArray(const MembershipFunctionsWeightsArrayObjectType *weightsArray)
typename MembershipFunctionType::ConstPointer MembershipFunctionPointer
void SetInput(const SampleType *sample)
typename MembershipFunctionVectorObjectType::Pointer MembershipFunctionVectorObjectPointer
typename MembershipSampleType::Pointer MembershipSampleObjectPointer
std::vector< MembershipFunctionPointer > MembershipFunctionVectorType
std::vector< ClassLabelType > ClassLabelVectorType
const MembershipSampleType * GetOutput() const
const SampleType * GetInput() const
void SetMembershipFunctions(const MembershipFunctionVectorObjectType *membershipFunctions)
void PrintSelf(std::ostream &os, Indent indent) const override
void SetClassLabels(const ClassLabelVectorObjectType *classLabels)
typename MembershipFunctionsWeightsArrayObjectType::Pointer MembershipFunctionsWeightsArrayPointer
typename SampleType::MeasurementVectorType MeasurementVectorType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
SizeValueType IdentifierType
Definition: itkIntTypes.h:90