ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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;
71
72 using typename Superclass::LabelMapType;
73 using typename Superclass::LabelMapPointer;
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;
84
88 Evaluate(const InputType & inputIndex) const override;
89
91
92 static inline LayerIdType
94 {
95 return -3;
96 }
97 static inline LayerIdType
99 {
100 return -2;
101 }
102 static inline LayerIdType
104 {
105 return -1;
106 }
107 static inline LayerIdType
109 {
110 return 0;
111 }
112 static inline LayerIdType
114 {
115 return 1;
116 }
117 static inline LayerIdType
119 {
120 return 2;
121 }
122 static inline LayerIdType
124 {
125 return 3;
126 }
127
129 template <typename TLabel>
132 {
133 using OutputLabelObjectType = LabelObject<TLabel, Dimension>;
134 auto object = OutputLabelObjectType::New();
136
137 for (LayerIdType status = this->MinusThreeLayer(); status < this->PlusOneLayer(); ++status)
138 {
139 const LabelObjectPointer labelObject = this->m_LabelMap->GetLabelObject(status);
140
141 for (SizeValueType i = 0; i < labelObject->GetNumberOfLines(); ++i)
142 {
143 object->AddLine(labelObject->GetLine(i));
144 }
145 }
146 object->Optimize();
147
148 return object;
149 }
150
151protected:
153 ~WhitakerSparseLevelSetImage() override = default;
154
156 void
158
159 void
161};
162} // namespace itk
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "itkWhitakerSparseLevelSetImage.hxx"
166#endif
167
168#endif // itkWhitakerSparseLevelSetImage_h
OutputType Evaluate(const InputType &inputIndex) const override=0
The base class for the representation of a labeled binary object in an image.
SmartPointer< Self > Pointer
typename LabelMapType::ConstPointer LabelMapConstPointer
typename LayerType::const_iterator LayerConstIterator
typename LabelObjectType::LineType LabelObjectLineType
std::map< LayerIdType, LayerType > LayerMapType
typename LabelObjectType::Pointer LabelObjectPointer
std::map< InputType, OutputType, Functor::LexicographicCompare > LayerType
LabelMap< LabelObjectType > LabelMapType
LabelObject< LayerIdType, VDimension > LabelObjectType
typename LayerType::iterator LayerIterator
typename LabelMapType::Pointer LabelMapPointer
typename LayerMapType::iterator LayerMapIterator
typename LayerMapType::const_iterator LayerMapConstIterator
typename LabelMapType::RegionType RegionType
typename LabelObjectType::LengthType LabelObjectLengthType
Implements transparent reference counting.
LabelObject< TLabel, Dimension >::Pointer GetAsLabelObject()
void InitializeInternalLabelList() override
OutputType Evaluate(const InputType &inputIndex) const override
~WhitakerSparseLevelSetImage() override=default
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86