ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Numerics
Statistics
include
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
"
24
#include "
itkMembershipFunctionBase.h
"
25
#include "
itkDecisionRule.h
"
26
#include "
itkProcessObject.h
"
27
#include "
itkSimpleDataObjectDecorator.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
:
49
typedef
SampleClassifierFilter
Self
;
50
typedef
ProcessObject
Superclass
;
51
typedef
SmartPointer< Self >
Pointer
;
52
typedef
SmartPointer< const Self >
ConstPointer
;
53
55
itkTypeMacro(
SampleClassifierFilter
,
ProcessObject
);
56
itkNewMacro(
Self
);
58
60
typedef
TSample
SampleType
;
61
63
typedef
MembershipSample< SampleType >
MembershipSampleType
;
64
typedef
typename
MembershipSampleType::Pointer
MembershipSampleObjectPointer
;
65
67
typedef
typename
SampleType::MeasurementType
MeasurementType
;
68
typedef
typename
SampleType::MeasurementVectorType
MeasurementVectorType
;
69
71
typedef
MembershipFunctionBase< MeasurementVectorType >
MembershipFunctionType
;
72
typedef
typename
MembershipFunctionType::ConstPointer
MembershipFunctionPointer
;
73
typedef
std::vector< MembershipFunctionPointer >
MembershipFunctionVectorType
;
74
typedef
SimpleDataObjectDecorator
<
75
MembershipFunctionVectorType
>
MembershipFunctionVectorObjectType
;
76
typedef
typename
77
MembershipFunctionVectorObjectType::Pointer
MembershipFunctionVectorObjectPointer
;
78
80
typedef
Array< double >
MembershipFunctionsWeightsArrayType
;
81
82
typedef
SimpleDataObjectDecorator
<
83
MembershipFunctionsWeightsArrayType
>
MembershipFunctionsWeightsArrayObjectType
;
84
typedef
typename
85
MembershipFunctionsWeightsArrayObjectType::Pointer
MembershipFunctionsWeightsArrayPointer
;
86
87
typedef
IdentifierType
ClassLabelType
;
88
typedef
std::vector< ClassLabelType >
ClassLabelVectorType
;
89
typedef
SimpleDataObjectDecorator
<
90
ClassLabelVectorType
>
ClassLabelVectorObjectType
;
91
typedef
ClassLabelVectorObjectType::Pointer
ClassLabelVectorObjectPointer
;
92
94
typedef
DecisionRule
DecisionRuleType
;
95
typedef
DecisionRuleType::ConstPointer
DecisionRulePointer
;
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
:
132
SampleClassifierFilter
();
133
virtual
~SampleClassifierFilter
() {}
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
148
typedef
ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArraySizeType
;
149
using
Superclass::MakeOutput;
150
virtual
DataObjectPointer
MakeOutput(
DataObjectPointerArraySizeType
idx);
152
153
private
:
154
155
unsigned
int
m_NumberOfClasses
;
156
158
DecisionRulePointer
m_DecisionRule
;
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
Generated on Sun Dec 9 2012 01:25:01 for ITK by
1.8.2