ITK  4.3.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< class TSample >
44 class ITK_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:
134  void PrintSelf(std::ostream & os, Indent indent) const;
135 
136  SampleClassifierFilter(const Self &); //purposely not implemented
137  void operator=(const Self &); //purposely not implemented
138 
140  void GenerateData();
141 
149  using Superclass::MakeOutput;
150  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
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
168