ITK
4.2.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Filtering
GPUAnisotropicSmoothing
include
itkGPUGradientAnisotropicDiffusionImageFilter.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 __itkGPUGradientAnisotropicDiffusionImageFilter_h
19
#define __itkGPUGradientAnisotropicDiffusionImageFilter_h
20
21
#include "
itkOpenCLUtil.h
"
22
#include "
itkGradientAnisotropicDiffusionImageFilter.h
"
23
#include "
itkGPUAnisotropicDiffusionImageFilter.h
"
24
#include "
itkGPUGradientNDAnisotropicDiffusionFunction.h
"
25
26
namespace
itk
27
{
46
template
<
class
TInputImage,
class
TOutputImage,
class
TParentImageFilter
=
47
GradientAnisotropicDiffusionImageFilter< TInputImage, TOutputImage > >
48
class
ITK_EXPORT
GPUGradientAnisotropicDiffusionImageFilter
:
49
public
GPUAnisotropicDiffusionImageFilter
< TInputImage, TOutputImage, TParentImageFilter >
50
{
51
public
:
53
typedef
GPUGradientAnisotropicDiffusionImageFilter
Self
;
54
typedef
GPUAnisotropicDiffusionImageFilter< TInputImage, TOutputImage, TParentImageFilter >
GPUSuperclass
;
55
typedef
SmartPointer< Self >
Pointer
;
56
typedef
SmartPointer< const Self >
ConstPointer
;
57
59
itkNewMacro(
Self
);
60
62
itkTypeMacro(
GPUGradientAnisotropicDiffusionImageFilter
,
63
GPUAnisotropicDiffusionImageFilter
);
64
66
typedef
typename
GPUSuperclass::UpdateBufferType
UpdateBufferType
;
67
69
itkStaticConstMacro(ImageDimension,
unsigned
int
, GPUSuperclass::ImageDimension);
70
71
#ifdef ITK_USE_CONCEPT_CHECKING
72
73
itkConceptMacro
( UpdateBufferHasNumericTraitsCheck,
74
(
Concept::HasNumericTraits< typename UpdateBufferType::PixelType >
) );
75
77
#endif
78
protected
:
79
GPUGradientAnisotropicDiffusionImageFilter
()
80
{
81
// Set DiffusionFunction
82
typename
GPUGradientNDAnisotropicDiffusionFunction< UpdateBufferType >::Pointer
p =
83
GPUGradientNDAnisotropicDiffusionFunction< UpdateBufferType >::New
();
84
this->SetDifferenceFunction(p);
85
}
87
88
~GPUGradientAnisotropicDiffusionImageFilter
() {
89
}
90
private
:
91
GPUGradientAnisotropicDiffusionImageFilter
(
const
Self &);
//purposely not
92
// implemented
93
void
operator=(
const
Self &);
//purposely not
94
95
// implemented
96
};
97
100
class
GPUGradientAnisotropicDiffusionImageFilterFactory
:
public
ObjectFactoryBase
101
{
102
public
:
103
typedef
GPUGradientAnisotropicDiffusionImageFilterFactory
Self
;
104
typedef
ObjectFactoryBase
Superclass
;
105
typedef
SmartPointer<Self>
Pointer
;
106
typedef
SmartPointer<const Self>
ConstPointer
;
107
109
virtual
const
char
*
GetITKSourceVersion
()
const
{
110
return
ITK_SOURCE_VERSION
;
111
}
112
const
char
*
GetDescription
()
const
{
113
return
"A Factory for GPUGradientAnisotropicDiffusionImageFilter"
;
114
}
116
118
itkFactorylessNewMacro(
Self
);
119
121
itkTypeMacro(
GPUGradientAnisotropicDiffusionImageFilterFactory
,
itk::ObjectFactoryBase
);
122
124
static
void
RegisterOneFactory
(
void
)
125
{
126
GPUGradientAnisotropicDiffusionImageFilterFactory::Pointer
factory =
127
GPUGradientAnisotropicDiffusionImageFilterFactory::New
();
128
129
itk::ObjectFactoryBase::RegisterFactory
(factory);
130
}
131
132
private
:
133
GPUGradientAnisotropicDiffusionImageFilterFactory
(
const
Self
&);
//purposely
134
// not
135
// implemented
136
void
operator=
(
const
Self
&);
//purposely
137
// not
138
// implemented
139
140
#define GradientAnisotropicDiffusionImageFilterTypeMacro(ipt,opt,dm) \
141
{ \
142
typedef itk::Image<ipt,dm> InputImageType; \
143
typedef itk::Image<opt,dm> OutputImageType; \
144
this->RegisterOverride( \
145
typeid(itk::GradientAnisotropicDiffusionImageFilter<InputImageType,OutputImageType>).name(), \
146
typeid(itk::GPUGradientAnisotropicDiffusionImageFilter<InputImageType,OutputImageType>).name(), \
147
"GPU GradientAnisotropicDiffusionImageFilter Override", \
148
true, \
149
itk::CreateObjectFunction<GPUGradientAnisotropicDiffusionImageFilter<InputImageType,OutputImageType> >::New() ); \
150
}
151
152
GPUGradientAnisotropicDiffusionImageFilterFactory
()
153
{
154
if
(
IsGPUAvailable
() )
155
{
156
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
char
,
unsigned
char
, 1);
157
GradientAnisotropicDiffusionImageFilterTypeMacro
(
char
,
char
, 1);
158
GradientAnisotropicDiffusionImageFilterTypeMacro
(
float
,
float
,1);
159
GradientAnisotropicDiffusionImageFilterTypeMacro
(
int
,
int
,1);
160
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
int
,
unsigned
int
,1);
161
GradientAnisotropicDiffusionImageFilterTypeMacro
(
double
,
double
,1);
162
163
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
char
,
unsigned
char
, 2);
164
GradientAnisotropicDiffusionImageFilterTypeMacro
(
char
,
char
, 2);
165
GradientAnisotropicDiffusionImageFilterTypeMacro
(
float
,
float
,2);
166
GradientAnisotropicDiffusionImageFilterTypeMacro
(
int
,
int
,2);
167
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
int
,
unsigned
int
,2);
168
GradientAnisotropicDiffusionImageFilterTypeMacro
(
double
,
double
,2);
169
170
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
char
,
unsigned
char
, 3);
171
GradientAnisotropicDiffusionImageFilterTypeMacro
(
char
,
char
, 3);
172
GradientAnisotropicDiffusionImageFilterTypeMacro
(
float
,
float
,3);
173
GradientAnisotropicDiffusionImageFilterTypeMacro
(
int
,
int
,3);
174
GradientAnisotropicDiffusionImageFilterTypeMacro
(
unsigned
int
,
unsigned
int
,3);
175
GradientAnisotropicDiffusionImageFilterTypeMacro
(
double
,
double
,3);
176
}
177
}
178
179
};
180
181
}
// end namspace itk
182
183
#endif
184
Generated on Tue Jul 10 2012 23:26:40 for ITK by
1.8.1