ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSampleClassifierFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
29 namespace itk
30 {
31 namespace Statistics
32 {
43 template< typename TSample >
44 class ITK_TEMPLATE_EXPORT SampleClassifierFilter:
45  public ProcessObject
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(SampleClassifierFilter);
49 
55 
58  itkNewMacro(Self);
60 
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 SetInput(const SampleType *sample);
97 
98  const SampleType * GetInput() const;
99 
101  const MembershipSampleType * GetOutput() const;
102 
106  itkSetMacro(NumberOfClasses, unsigned int);
107  itkGetConstMacro(NumberOfClasses, unsigned int);
109 
111  itkSetConstObjectMacro(DecisionRule, DecisionRuleType);
112  itkGetConstObjectMacro(DecisionRule, DecisionRuleType);
114 
118  void SetClassLabels(const ClassLabelVectorObjectType *classLabels);
119 
123  void SetMembershipFunctions(const MembershipFunctionVectorObjectType *membershipFunctions);
124 
126  void SetMembershipFunctionsWeightsArray(const MembershipFunctionsWeightsArrayObjectType *weightsArray);
127 
128 protected:
130  ~SampleClassifierFilter() override = default;
131  void PrintSelf(std::ostream & os, Indent indent) const override;
132 
134  void GenerateData() override;
135 
143  using Superclass::MakeOutput;
144  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
146 
147 private:
148 
149  unsigned int m_NumberOfClasses;
150 
153 }; // end of class
154 } // end of namespace Statistics
155 } // end of namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkSampleClassifierFilter.hxx"
159 #endif
160 
161 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
std::vector< ClassLabelType > ClassLabelVectorType
typename SampleType::MeasurementType MeasurementType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Container for storing the instance-identifiers of other sample with their associated class labels...
typename MembershipFunctionsWeightsArrayObjectType::Pointer MembershipFunctionsWeightsArrayPointer
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
Base class for decision rules that return a class label based on a set of discriminant scores...
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
MembershipFunctionBase defines common interfaces for membership functions.
typename MembershipFunctionType::ConstPointer MembershipFunctionPointer
std::vector< MembershipFunctionPointer > MembershipFunctionVectorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename MembershipFunctionVectorObjectType::Pointer MembershipFunctionVectorObjectPointer
typename SampleType::MeasurementVectorType MeasurementVectorType
typename MembershipSampleType::Pointer MembershipSampleObjectPointer