ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLevelSetEvolution.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#ifndef itkLevelSetEvolution_h
19#define itkLevelSetEvolution_h
20
23
26
29
32
35
38
39
40namespace itk
41{
51template <typename TEquationContainer, typename TLevelSet>
52class ITK_TEMPLATE_EXPORT LevelSetEvolution{};
53
54template <typename TEquationContainer, typename TImage>
55class ITK_TEMPLATE_EXPORT LevelSetEvolution<TEquationContainer, LevelSetDenseImage<TImage>>
56 : public LevelSetEvolutionBase<TEquationContainer, LevelSetDenseImage<TImage>>
57{
58public:
59 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolution);
60
62
67
69 itkNewMacro(Self);
70
72 itkOverrideGetNameOfClassMacro(LevelSetEvolution);
73
76 using typename Superclass::TermContainerType;
78
79 using typename Superclass::TermType;
80 using typename Superclass::TermPointer;
81
82 using typename Superclass::InputImageType;
86 using typename Superclass::InputPixelRealType;
87
88 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
89
91
93
95
96 using typename Superclass::LevelSetOutputType;
98 using typename Superclass::LevelSetDataType;
99
100 using typename Superclass::IdListType;
101 using typename Superclass::IdListIterator;
102 using typename Superclass::IdListConstIterator;
103 using typename Superclass::IdListImageType;
104 using typename Superclass::CacheImageType;
106
109
112
115
117
119
121
123 void
124 SetNumberOfWorkUnits(const ThreadIdType numberOfThreads);
126 [[nodiscard]] ThreadIdType
128
129 ~LevelSetEvolution() override = default;
130
131protected:
133
136 void
138
140 void
142
144 void
146
148 void
149 UpdateLevelSets() override;
150
152 void
153 UpdateEquations() override;
154
156 void
158
159 typename LevelSetContainerType::Pointer m_UpdateBuffer{};
160
161 friend class LevelSetEvolutionComputeIterationThreader<LevelSetType,
162 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
163 Self>;
166 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
167 Self>;
168 typename SplitLevelSetComputeIterationThreaderType::Pointer m_SplitLevelSetComputeIterationThreader{};
169
170 using DomainMapConstIteratorType = typename DomainMapImageFilterType::DomainMapType::const_iterator;
175 typename SplitDomainMapComputeIterationThreaderType::Pointer m_SplitDomainMapComputeIterationThreader{};
176
177 friend class LevelSetEvolutionUpdateLevelSetsThreader<LevelSetType,
178 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
179 Self>;
182 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
183 Self>;
184 typename SplitLevelSetUpdateLevelSetsThreaderType::Pointer m_SplitLevelSetUpdateLevelSetsThreader{};
185
188};
189
190
191template <typename TEquationContainer, typename TOutput, unsigned int VDimension>
192class ITK_TEMPLATE_EXPORT LevelSetEvolution<TEquationContainer, WhitakerSparseLevelSetImage<TOutput, VDimension>>
193 : public LevelSetEvolutionBase<TEquationContainer, WhitakerSparseLevelSetImage<TOutput, VDimension>>
194{
195public:
196 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolution);
197
199
204
206 itkNewMacro(Self);
207
209 itkOverrideGetNameOfClassMacro(LevelSetEvolution);
210
213 using typename Superclass::TermContainerType;
215
216 using typename Superclass::TermType;
217 using typename Superclass::TermPointer;
218
219 using typename Superclass::InputImageType;
220 using typename Superclass::InputImagePixelType;
223 using typename Superclass::InputPixelRealType;
224
225 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
226
229
230 using typename Superclass::LevelSetInputType;
231 using typename Superclass::LevelSetOutputType;
233 using typename Superclass::LevelSetDataType;
234
236
239
240
241 using typename Superclass::IdListType;
242 using typename Superclass::IdListIterator;
243 using typename Superclass::IdListImageType;
244 using typename Superclass::CacheImageType;
246
249
251
255
257 void
258 SetNumberOfWorkUnits(const ThreadIdType numberOfWorkUnits);
260 [[nodiscard]] ThreadIdType
262
263protected:
266
267 using NodePairType = std::pair<LevelSetInputType, LevelSetOutputType>;
268
269 // For sparse case, the update buffer needs to be the size of the active layer
270 std::map<IdentifierType, LevelSetLayerType *> m_UpdateBuffer{};
271
274 void
276
278 void
280
282 void
284
286 void
287 UpdateLevelSets() override;
288
290 void
291 UpdateEquations() override;
292
297 typename SplitLevelSetComputeIterationThreaderType::Pointer m_SplitLevelSetComputeIterationThreader{};
298};
299
300
301// Shi
302template <typename TEquationContainer, unsigned int VDimension>
303class ITK_TEMPLATE_EXPORT LevelSetEvolution<TEquationContainer, ShiSparseLevelSetImage<VDimension>>
304 : public LevelSetEvolutionBase<TEquationContainer, ShiSparseLevelSetImage<VDimension>>
305{
306public:
307 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolution);
308
310
315
317 itkNewMacro(Self);
318
320 itkOverrideGetNameOfClassMacro(LevelSetEvolution);
321
324 using typename Superclass::TermContainerType;
326
327 using typename Superclass::TermType;
328 using typename Superclass::TermPointer;
329
330 using typename Superclass::InputImageType;
331 using typename Superclass::InputImagePixelType;
334 using typename Superclass::InputPixelRealType;
335
336 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
337
340
341 using typename Superclass::LevelSetInputType;
342 using typename Superclass::LevelSetOutputType;
344 using typename Superclass::LevelSetDataType;
345
347
350
351
352 using typename Superclass::IdListType;
353 using typename Superclass::IdListIterator;
354 using typename Superclass::IdListImageType;
355 using typename Superclass::CacheImageType;
357
360
362
365
366 LevelSetEvolution() = default;
367 ~LevelSetEvolution() override = default;
368
369protected:
371 void
372 UpdateLevelSets() override;
373
375 void
376 UpdateEquations() override;
377};
378
379// Malcolm
380template <typename TEquationContainer, unsigned int VDimension>
381class ITK_TEMPLATE_EXPORT LevelSetEvolution<TEquationContainer, MalcolmSparseLevelSetImage<VDimension>>
382 : public LevelSetEvolutionBase<TEquationContainer, MalcolmSparseLevelSetImage<VDimension>>
383{
384public:
385 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolution);
386
388
393
395 itkNewMacro(Self);
396
398 itkOverrideGetNameOfClassMacro(LevelSetEvolution);
399
402 using typename Superclass::TermContainerType;
404
405 using typename Superclass::TermType;
406 using typename Superclass::TermPointer;
407
408 using typename Superclass::InputImageType;
409 using typename Superclass::InputImagePixelType;
412 using typename Superclass::InputPixelRealType;
413
414 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
415
418
419 using typename Superclass::LevelSetInputType;
420 using typename Superclass::LevelSetOutputType;
422 using typename Superclass::LevelSetDataType;
423
426
429
430
431 using typename Superclass::IdListType;
432 using typename Superclass::IdListIterator;
433 using typename Superclass::IdListImageType;
434 using typename Superclass::CacheImageType;
436
439
441
444
445 LevelSetEvolution() = default;
446 ~LevelSetEvolution() override = default;
447
448protected:
449 void
450 UpdateLevelSets() override;
451 void
452 UpdateEquations() override;
453};
454} // namespace itk
455
456#ifndef ITK_MANUAL_INSTANTIATION
457# include "itkLevelSetEvolution.hxx"
458#endif
459
460#endif // itkLevelSetEvolution_h
Binarize an input image by thresholding.
A multi-dimensional iterator templated over image type that walks an image region and is specialized ...
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Base class for the "dense" representation of a level-set function on one image.
typename TermContainerType::LevelSetContainerType LevelSetContainerType
typename LevelSetContainerType::IdListImageType IdListImageType
typename NumericTraits< InputImagePixelType >::RealType InputPixelRealType
typename LevelSetContainerType::CacheImageType CacheImageType
typename LevelSetContainerType::IdListConstIterator IdListConstIterator
typename LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType
typename LevelSetContainerType::IdListIterator IdListIterator
typename LevelSetContainerType::LevelSetIdentifierType LevelSetIdentifierType
typename EquationContainerType::TermContainerType TermContainerType
LevelSetEvolutionStoppingCriterion< LevelSetContainerType > StoppingCriterionType
LevelSetEvolutionUpdateLevelSetsThreader< LevelSetType, ThreadedImageRegionPartitioner< TImage::ImageDimension >, Self > SplitLevelSetUpdateLevelSetsThreaderType
LevelSetEvolutionComputeIterationThreader< LevelSetType, ThreadedDomainMapPartitionerType, Self > SplitDomainMapComputeIterationThreaderType
LevelSetEvolutionComputeIterationThreader< LevelSetType, ThreadedImageRegionPartitioner< TImage::ImageDimension >, Self > SplitLevelSetComputeIterationThreaderType
SplitLevelSetComputeIterationThreaderType::Pointer m_SplitLevelSetComputeIterationThreader
ImageRegionConstIteratorWithIndex< LevelSetImageType > LevelSetImageConstIteratorType
SignedMaurerDistanceMapImageFilter< LevelSetImageType, LevelSetImageType > MaurerType
ImageRegionConstIteratorWithIndex< InputImageType > InputImageConstIteratorType
SplitDomainMapComputeIterationThreaderType::Pointer m_SplitDomainMapComputeIterationThreader
ThreadedIteratorRangePartitioner< DomainMapConstIteratorType > ThreadedDomainMapPartitionerType
ImageRegionIteratorWithIndex< LevelSetImageType > LevelSetImageIteratorType
typename DomainMapImageFilterType::DomainMapType::const_iterator DomainMapConstIteratorType
SplitLevelSetUpdateLevelSetsThreaderType::Pointer m_SplitLevelSetUpdateLevelSetsThreader
BinaryThresholdImageFilter< LevelSetImageType, LevelSetImageType > ThresholdFilterType
LevelSetEvolutionBase< TEquationContainer, LevelSetType > Superclass
UpdateMalcolmSparseLevelSet< ImageDimension, EquationContainerType > UpdateLevelSetFilterType
UpdateShiSparseLevelSet< ImageDimension, EquationContainerType > UpdateLevelSetFilterType
ThreadedIteratorRangePartitioner< typename LevelSetType::LayerConstIterator > SplitLevelSetPartitionerType
UpdateWhitakerSparseLevelSet< ImageDimension, LevelSetOutputType, EquationContainerType > UpdateLevelSetFilterType
LevelSetEvolutionComputeIterationThreader< LevelSetType, SplitLevelSetPartitionerType, Self > SplitLevelSetComputeIterationThreaderType
Class for iterating and evolving the level-set function.
std::map< InputType, OutputType, Functor::LexicographicCompare > LayerType
Derived class for the Malcolm representation of level-set function.
Derived class for the shi representation of level-set function.
This filter calculates the Euclidean distance transform of a binary image in linear time for arbitrar...
Implements transparent reference counting.
Class for partitioning of an ImageRegion.
Partitions an iterator range for threading.
Base class for updating the Malcolm representation of level-set function.
Base class for updating the Shi representation of level-set function.
Base class for updating the level-set function.
Derived class for the sparse-field representation of level-set function.
std::map< InputType, OutputType, Functor::LexicographicCompare > LayerType
LabelMap< LabelObjectType > LabelMapType
typename LabelMapType::Pointer LabelMapPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType