ITK  4.13.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:
53 
56  itkNewMacro(Self);
58 
60  typedef TSample SampleType;
61 
65 
67  typedef typename SampleType::MeasurementType MeasurementType;
68  typedef typename SampleType::MeasurementVectorType MeasurementVectorType;
69 
73  typedef std::vector< MembershipFunctionPointer > MembershipFunctionVectorType;
76  typedef typename
78 
81 
84  typedef typename
86 
88  typedef std::vector< ClassLabelType > ClassLabelVectorType;
92 
96 
98  using Superclass::SetInput;
99  void SetInput(const SampleType *sample);
100 
101  const SampleType * GetInput() const;
102 
104  const MembershipSampleType * GetOutput() const;
105 
109  itkSetMacro(NumberOfClasses, unsigned int);
110  itkGetConstMacro(NumberOfClasses, unsigned int);
112 
114  itkSetConstObjectMacro(DecisionRule, DecisionRuleType);
115  itkGetConstObjectMacro(DecisionRule, DecisionRuleType);
117 
121  void SetClassLabels(const ClassLabelVectorObjectType *classLabels);
122 
126  void SetMembershipFunctions(const MembershipFunctionVectorObjectType *membershipFunctions);
127 
129  void SetMembershipFunctionsWeightsArray(const MembershipFunctionsWeightsArrayObjectType *weightsArray);
130 
131 protected:
133  virtual ~SampleClassifierFilter() ITK_OVERRIDE {}
134  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
135 
136  ITK_DISALLOW_COPY_AND_ASSIGN(SampleClassifierFilter);
137 
139  virtual void GenerateData() ITK_OVERRIDE;
140 
148  using Superclass::MakeOutput;
149  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
151 
152 private:
153 
154  unsigned int m_NumberOfClasses;
155 
157  DecisionRulePointer m_DecisionRule;
158 }; // end of class
159 } // end of namespace Statistics
160 } // end of namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 #include "itkSampleClassifierFilter.hxx"
164 #endif
165 
166 #endif
ClassLabelVectorObjectType::Pointer ClassLabelVectorObjectPointer
Light weight base class for most itk classes.
SimpleDataObjectDecorator< MembershipFunctionsWeightsArrayType > MembershipFunctionsWeightsArrayObjectType
MembershipFunctionsWeightsArrayObjectType::Pointer MembershipFunctionsWeightsArrayPointer
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...
MembershipFunctionType::ConstPointer MembershipFunctionPointer
SimpleDataObjectDecorator< MembershipFunctionVectorType > MembershipFunctionVectorObjectType
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Base class for decision rules that return a class label based on a set of discriminant scores...
DecisionRuleType::ConstPointer DecisionRulePointer
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
std::vector< MembershipFunctionPointer > MembershipFunctionVectorType
MembershipSample< SampleType > MembershipSampleType
MembershipFunctionBase defines common interfaces for membership functions.
SampleType::MeasurementVectorType MeasurementVectorType
std::vector< ClassLabelType > ClassLabelVectorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
MembershipFunctionVectorObjectType::Pointer MembershipFunctionVectorObjectPointer
MembershipSampleType::Pointer MembershipSampleObjectPointer
MembershipFunctionBase< MeasurementVectorType > MembershipFunctionType
SimpleDataObjectDecorator< ClassLabelVectorType > ClassLabelVectorObjectType