ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Segmentation
LevelSetsv4
include
itkWhitakerSparseLevelSetImage.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
19
#ifndef __itkWhitakerSparseLevelSetImage_h
20
#define __itkWhitakerSparseLevelSetImage_h
21
22
#include "
itkLevelSetSparseImage.h
"
23
#include "
itkLabelObject.h
"
24
#include "
itkLabelMap.h
"
25
26
namespace
itk
27
{
40
template
<
typename
TOutput,
unsigned
int
VDimension >
41
class
WhitakerSparseLevelSetImage
:
42
public
LevelSetSparseImage
< TOutput, VDimension >
43
{
44
public
:
45
typedef
WhitakerSparseLevelSetImage
Self
;
46
typedef
SmartPointer< Self >
Pointer
;
47
typedef
SmartPointer< const Self >
ConstPointer
;
48
typedef
LevelSetSparseImage< TOutput, VDimension >
Superclass
;
49
51
itkNewMacro(
Self
);
52
54
itkTypeMacro(
WhitakerSparseLevelSetImage
,
LevelSetSparseImage
);
55
56
itkStaticConstMacro (
Dimension
,
unsigned
int
, VDimension );
57
58
typedef
typename
Superclass::InputType
InputType
;
59
typedef
typename
Superclass::OutputType
OutputType
;
60
typedef
typename
Superclass::OutputRealType
OutputRealType
;
61
typedef
typename
Superclass::GradientType
GradientType
;
62
typedef
typename
Superclass::HessianType
HessianType
;
63
typedef
typename
Superclass::LevelSetDataType
LevelSetDataType
;
64
65
typedef
typename
Superclass::LayerIdType
LayerIdType
;
66
typedef
typename
Superclass::LabelObjectType
LabelObjectType
;
67
typedef
typename
Superclass::LabelObjectPointer
LabelObjectPointer
;
68
typedef
typename
Superclass::LabelObjectLengthType
LabelObjectLengthType
;
69
typedef
typename
Superclass::LabelObjectLineType
LabelObjectLineType
;
70
71
typedef
typename
Superclass::LabelMapType
LabelMapType
;
72
typedef
typename
Superclass::LabelMapPointer
LabelMapPointer
;
73
typedef
typename
Superclass::RegionType
RegionType
;
74
75
typedef
typename
Superclass::LayerType
LayerType
;
76
typedef
typename
Superclass::LayerIterator
LayerIterator
;
77
typedef
typename
Superclass::LayerConstIterator
LayerConstIterator
;
78
79
typedef
typename
Superclass::LayerMapType
LayerMapType
;
80
typedef
typename
Superclass::LayerMapIterator
LayerMapIterator
;
81
typedef
typename
Superclass::LayerMapConstIterator
LayerMapConstIterator
;
82
84
using
Superclass::Evaluate
;
85
virtual
OutputType
Evaluate
(
const
InputType
& iP )
const
;
86
87
#ifdef ITK_USE_CONCEPT_CHECKING
88
90
itkConceptMacro
( DoubleConvertible,
91
(
Concept::Convertible< OutputRealType, OutputType >
) );
92
94
#endif // ITK_USE_CONCEPT_CHECKING
95
96
static
inline
LayerIdType
MinusThreeLayer
() {
return
-3; }
97
static
inline
LayerIdType
MinusTwoLayer
() {
return
-2; }
98
static
inline
LayerIdType
MinusOneLayer
() {
return
-1; }
99
static
inline
LayerIdType
ZeroLayer
() {
return
0; }
100
static
inline
LayerIdType
PlusOneLayer
() {
return
1; }
101
static
inline
LayerIdType
PlusTwoLayer
() {
return
2; }
102
static
inline
LayerIdType
PlusThreeLayer
() {
return
3; }
103
105
template
<
class
TLabel >
106
typename
LabelObject< TLabel, Dimension >::Pointer
107
GetAsLabelObject
()
108
{
109
typedef
LabelObject< TLabel, Dimension >
OutputLabelObjectType;
110
typename
OutputLabelObjectType::Pointer
object
= OutputLabelObjectType::New();
112
113
for
(
LayerIdType
status = this->
MinusThreeLayer
(); status < this->
PlusOneLayer
(); status++ )
114
{
115
LabelObjectPointer
labelObject = this->
m_LabelMap
->GetLabelObject( status );
116
117
for
(
SizeValueType
i = 0; i < labelObject->GetNumberOfLines(); i++ )
118
{
119
object
->AddLine( labelObject->GetLine( i ) );
120
}
121
}
122
object
->Optimize();
123
124
return
object;
125
}
126
127
protected
:
128
129
WhitakerSparseLevelSetImage
();
130
virtual
~WhitakerSparseLevelSetImage
();
131
133
virtual
void
InitializeLayers
();
134
135
virtual
void
InitializeInternalLabelList
();
136
137
private
:
138
139
WhitakerSparseLevelSetImage
(
const
Self
& );
// purposely not implemented
140
void
operator =
(
const
Self
& );
// purposely not implemented
141
};
142
}
143
144
#ifndef ITK_MANUAL_INSTANTIATION
145
#include "itkWhitakerSparseLevelSetImage.hxx"
146
#endif
147
148
#endif // __itkWhitakerSparseLevelSetImage_h
149
Generated on Sun Dec 9 2012 01:31:57 for ITK by
1.8.2