ITK  4.6.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 >
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 
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 
130 
131 protected:
134  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
135 
136  SampleClassifierFilter(const Self &); //purposely not implemented
137  void operator=(const Self &); //purposely not implemented
138 
140  virtual void GenerateData() ITK_OVERRIDE;
141 
149  using Superclass::MakeOutput;
150  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
152 
153 private:
154 
155  unsigned int m_NumberOfClasses;
156 
159 }; // end of class
160 } // end of namespace Statistics
161 } // end of namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkSampleClassifierFilter.hxx"
165 #endif
166 
167 #endif
void SetMembershipFunctionsWeightsArray(const MembershipFunctionsWeightsArrayObjectType *weightsArray)
virtual void GenerateData() ITK_OVERRIDE
ClassLabelVectorObjectType::Pointer ClassLabelVectorObjectPointer
Light weight base class for most itk classes.
SimpleDataObjectDecorator< MembershipFunctionsWeightsArrayType > MembershipFunctionsWeightsArrayObjectType
void SetMembershipFunctions(const MembershipFunctionVectorObjectType *membershipFunctions)
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
const MembershipSampleType * GetOutput() const
void SetClassLabels(const ClassLabelVectorObjectType *classLabels)
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
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
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.
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
SampleType::MeasurementVectorType MeasurementVectorType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
std::vector< ClassLabelType > ClassLabelVectorType
const SampleType * GetInput() const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetInput(const SampleType *sample)
MembershipFunctionVectorObjectType::Pointer MembershipFunctionVectorObjectPointer
MembershipSampleType::Pointer MembershipSampleObjectPointer
MembershipFunctionBase< MeasurementVectorType > MembershipFunctionType
SimpleDataObjectDecorator< ClassLabelVectorType > ClassLabelVectorObjectType