ITK  5.4.0
Insight Toolkit
itkWhitakerSparseLevelSetImage.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
23#include "itkLabelObject.h"
24#include "itkLabelMap.h"
25
26namespace itk
27{
40template <typename TOutput, unsigned int VDimension>
41class ITK_TEMPLATE_EXPORT WhitakerSparseLevelSetImage : public LevelSetSparseImage<TOutput, VDimension>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(WhitakerSparseLevelSetImage);
45
50
52 itkNewMacro(Self);
53
55 itkOverrideGetNameOfClassMacro(WhitakerSparseLevelSetImage);
56
57 static constexpr unsigned int Dimension = VDimension;
58
59 using typename Superclass::InputType;
60 using typename Superclass::OutputType;
61 using typename Superclass::OutputRealType;
62 using typename Superclass::GradientType;
63 using typename Superclass::HessianType;
64 using typename Superclass::LevelSetDataType;
65
66 using typename Superclass::LayerIdType;
67 using typename Superclass::LabelObjectType;
68 using typename Superclass::LabelObjectPointer;
69 using typename Superclass::LabelObjectLengthType;
70 using typename Superclass::LabelObjectLineType;
71
72 using typename Superclass::LabelMapType;
73 using typename Superclass::LabelMapPointer;
74 using typename Superclass::LabelMapConstPointer;
75 using typename Superclass::RegionType;
76
77 using typename Superclass::LayerType;
78 using typename Superclass::LayerIterator;
79 using typename Superclass::LayerConstIterator;
80
81 using typename Superclass::LayerMapType;
82 using typename Superclass::LayerMapIterator;
83 using typename Superclass::LayerMapConstIterator;
84
86 using Superclass::Evaluate;
88 Evaluate(const InputType & inputIndex) const override;
89
90#ifdef ITK_USE_CONCEPT_CHECKING
91 // Begin concept checking
92
94
95 // End concept checking
96#endif // ITK_USE_CONCEPT_CHECKING
97
98 static inline LayerIdType
100 {
101 return -3;
102 }
103 static inline LayerIdType
105 {
106 return -2;
107 }
108 static inline LayerIdType
110 {
111 return -1;
112 }
113 static inline LayerIdType
115 {
116 return 0;
117 }
118 static inline LayerIdType
120 {
121 return 1;
122 }
123 static inline LayerIdType
125 {
126 return 2;
127 }
128 static inline LayerIdType
130 {
131 return 3;
132 }
133
135 template <typename TLabel>
138 {
139 using OutputLabelObjectType = LabelObject<TLabel, Dimension>;
140 auto object = OutputLabelObjectType::New();
143 for (LayerIdType status = this->MinusThreeLayer(); status < this->PlusOneLayer(); ++status)
144 {
145 LabelObjectPointer labelObject = this->m_LabelMap->GetLabelObject(status);
146
147 for (SizeValueType i = 0; i < labelObject->GetNumberOfLines(); ++i)
148 {
149 object->AddLine(labelObject->GetLine(i));
150 }
151 }
152 object->Optimize();
153
154 return object;
155 }
156
157protected:
159 ~WhitakerSparseLevelSetImage() override = default;
160
162 void
164
165 void
167};
168} // namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkWhitakerSparseLevelSetImage.hxx"
172#endif
173
174#endif // itkWhitakerSparseLevelSetImage_h
Base class for all data objects in ITK.
The base class for the representation of a labeled binary object in an image.
Base class for the sparse representation of a level-set function on one Image.
typename LabelObjectType::Pointer LabelObjectPointer
Base class for most ITK classes.
Definition: itkObject.h:62
Derived class for the sparse-field representation of level-set function.
LabelObject< TLabel, Dimension >::Pointer GetAsLabelObject()
void InitializeInternalLabelList() override
OutputType Evaluate(const InputType &inputIndex) const override
~WhitakerSparseLevelSetImage() override=default
static Pointer New()
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:83