ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
ImageFunction
include
itkMahalanobisDistanceThresholdImageFunction.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 __itkMahalanobisDistanceThresholdImageFunction_h
19
#define __itkMahalanobisDistanceThresholdImageFunction_h
20
21
#include "
itkImageFunction.h
"
22
#include "
itkMahalanobisDistanceMembershipFunction.h
"
23
24
namespace
itk
25
{
48
template
<
class
TInputImage,
class
TCoordRep =
float
>
49
class
ITK_EXPORT
MahalanobisDistanceThresholdImageFunction
:
50
public
ImageFunction
< TInputImage, bool, TCoordRep >
51
{
52
public
:
54
typedef
MahalanobisDistanceThresholdImageFunction
Self
;
55
typedef
ImageFunction< TInputImage, bool, TCoordRep >
Superclass
;
56
typedef
SmartPointer< Self >
Pointer
;
57
typedef
SmartPointer< const Self >
ConstPointer
;
58
60
itkTypeMacro(
MahalanobisDistanceThresholdImageFunction
,
ImageFunction
);
61
63
itkNewMacro(
Self
);
64
66
typedef
typename
Superclass::InputImageType
InputImageType
;
67
69
typedef
typename
TInputImage::PixelType
PixelType
;
70
72
itkStaticConstMacro(ImageDimension,
unsigned
int
, Superclass::ImageDimension);
73
75
typedef
typename
Superclass::PointType
PointType
;
76
78
typedef
typename
Superclass::IndexType
IndexType
;
79
81
typedef
typename
Superclass::ContinuousIndexType
ContinuousIndexType
;
82
84
typedef
vnl_matrix< double >
CovarianceMatrixType
;
85
87
typedef
vnl_vector< double >
MeanVectorType
;
88
97
virtual
bool
Evaluate(
const
PointType
& point)
const
;
98
107
virtual
bool
EvaluateAtContinuousIndex(
108
const
ContinuousIndexType
& index)
const
;
109
118
virtual
bool
EvaluateAtIndex(
const
IndexType
& index)
const
;
119
126
virtual
double
EvaluateDistance(
const
PointType
& point)
const
;
127
134
virtual
double
EvaluateDistanceAtIndex(
const
IndexType
& index)
const
;
135
137
itkGetConstReferenceMacro(Threshold,
double
);
138
itkSetMacro(Threshold,
double
);
140
142
void
SetMean(
const
MeanVectorType
& mean);
143
145
const
MeanVectorType
& GetMean()
const
;
146
149
void
SetCovariance(
const
CovarianceMatrixType
& cov);
150
152
const
CovarianceMatrixType
& GetCovariance()
const
;
153
154
protected
:
155
MahalanobisDistanceThresholdImageFunction
();
156
~MahalanobisDistanceThresholdImageFunction
(){}
157
void
PrintSelf(std::ostream & os,
Indent
indent)
const
;
158
159
private
:
160
MahalanobisDistanceThresholdImageFunction
(
const
Self &);
//purposely not
161
// implemented
162
void
operator=(
const
Self &);
//purposely not
163
164
// implemented
165
166
double
m_Threshold
;
167
168
// This is intended only for Image of Vector pixel type.
169
typedef
Statistics::MahalanobisDistanceMembershipFunction
<
170
PixelType
171
>
MahalanobisDistanceFunctionType
;
172
173
typedef
typename
MahalanobisDistanceFunctionType::Pointer
MahalanobisDistanceFunctionPointer
;
174
MahalanobisDistanceFunctionPointer
m_MahalanobisDistanceMembershipFunction
;
175
176
// Cached versions of the mean and covariance to manage the
177
// difference in vector/matrix types between this class and the
178
// membership function used internally.
179
MeanVectorType
m_Mean
;
180
CovarianceMatrixType
m_Covariance
;
181
};
182
}
// end namespace itk
183
184
#ifndef ITK_MANUAL_INSTANTIATION
185
#include "itkMahalanobisDistanceThresholdImageFunction.hxx"
186
#endif
187
188
#endif
189
Generated on Mon May 13 2013 01:00:16 for ITK by
1.8.3.1