ITK  5.3.0
Insight Toolkit
itkLevelSetEvolutionBase.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  * 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 
20 #ifndef itkLevelSetEvolutionBase_h
21 #define itkLevelSetEvolutionBase_h
22 
23 #include <list>
24 
25 #include "itkImage.h"
30 #include "itkNumericTraits.h"
32 
33 namespace itk
34 {
42 template <typename TEquationContainer, typename TLevelSet>
43 class ITK_TEMPLATE_EXPORT LevelSetEvolutionBase : public Object
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionBase);
47 
51  using Superclass = Object;
52 
54  itkTypeMacro(LevelSetEvolutionBase, Object);
55 
56  using EquationContainerType = TEquationContainer;
57  using EquationContainerPointer = typename EquationContainerType::Pointer;
58  using TermContainerType = typename EquationContainerType::TermContainerType;
59  using TermContainerPointer = typename TermContainerType::Pointer;
60 
61  using TermType = typename TermContainerType::TermType;
62  using TermPointer = typename TermType::Pointer;
63 
64  using InputImageType = typename TermContainerType::InputImageType;
65  using InputImagePixelType = typename InputImageType::PixelType;
66  using InputImageConstPointer = typename InputImageType::ConstPointer;
69 
70  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
71 
72  using LevelSetContainerType = typename TermContainerType::LevelSetContainerType;
73 
74  using LevelSetIdentifierType = typename LevelSetContainerType::LevelSetIdentifierType;
75 
76  using LevelSetType = TLevelSet;
81 
82  using IdListType = typename LevelSetContainerType::IdListType;
83  using IdListIterator = typename LevelSetContainerType::IdListIterator;
84  using IdListConstIterator = typename LevelSetContainerType::IdListConstIterator;
85  using IdListImageType = typename LevelSetContainerType::IdListImageType;
86  using CacheImageType = typename LevelSetContainerType::CacheImageType;
87 
88  using DomainMapImageFilterType = typename LevelSetContainerType::DomainMapImageFilterType;
89 
92 
93  itkSetObjectMacro(LevelSetContainer, LevelSetContainerType);
94  itkGetModifiableObjectMacro(LevelSetContainer, LevelSetContainerType);
95 
97  itkSetMacro(Alpha, LevelSetOutputRealType);
98  itkGetMacro(Alpha, LevelSetOutputRealType);
100 
102  void
103  SetTimeStep(const LevelSetOutputRealType & iDt);
104 
106  itkSetObjectMacro(EquationContainer, EquationContainerType);
107  itkGetModifiableObjectMacro(EquationContainer, EquationContainerType);
109 
111  itkSetObjectMacro(StoppingCriterion, StoppingCriterionType);
112  itkGetModifiableObjectMacro(StoppingCriterion, StoppingCriterionType);
114 
116  itkGetConstMacro(NumberOfIterations, IdentifierType);
117 
121  void
122  Update();
123 
124 protected:
126 
127  ~LevelSetEvolutionBase() override = default;
128 
129  void
130  CheckSetUp();
131 
133  void
134  InitializeIteration();
135 
140  void
141  Evolve();
142 
145  virtual void
146  AllocateUpdateBuffer();
147 
150  virtual void
151  ComputeIteration();
152 
154  virtual void
155  ComputeTimeStepForNextIteration();
156 
157  virtual void
158  UpdateLevelSets() = 0;
159 
160  virtual void
161  UpdateEquations() = 0;
162 
164 
166  typename LevelSetContainerType::Pointer m_LevelSetContainer;
167 
173 
175  typename LevelSetContainerType::Iterator m_LevelSetContainerIteratorToProcessWhenThreading;
176  typename LevelSetContainerType::Iterator m_LevelSetUpdateContainerIteratorToProcessWhenThreading;
177 };
178 } // namespace itk
179 
180 #ifndef ITK_MANUAL_INSTANTIATION
181 # include "itkLevelSetEvolutionBase.hxx"
182 #endif
183 
184 #endif // itkLevelSetEvolutionBase_h
itk::LevelSetEvolutionBase::m_NumberOfIterations
IdentifierType m_NumberOfIterations
Definition: itkLevelSetEvolutionBase.h:172
itkLevelSetEvolutionStoppingCriterion.h
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::IdListIterator
typename LevelSetContainerType::IdListIterator IdListIterator
Definition: itkLevelSetEvolutionBase.h:83
itk::LevelSetEvolutionBase::m_StoppingCriterion
StoppingCriterionPointer m_StoppingCriterion
Definition: itkLevelSetEvolutionBase.h:163
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::IdListType
typename LevelSetContainerType::IdListType IdListType
Definition: itkLevelSetEvolutionBase.h:82
itk::LevelSetEvolutionBase::m_EquationContainer
EquationContainerPointer m_EquationContainer
Definition: itkLevelSetEvolutionBase.h:165
itk::LevelSetEvolutionBase::m_UserGloballyDefinedTimeStep
bool m_UserGloballyDefinedTimeStep
Definition: itkLevelSetEvolutionBase.h:171
itk::ShiSparseLevelSetImage::InputType
typename Superclass::InputType InputType
Definition: itkShiSparseLevelSetImage.h:55
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::CacheImageType
typename LevelSetContainerType::CacheImageType CacheImageType
Definition: itkLevelSetEvolutionBase.h:86
itkDiscreteLevelSetImage.h
itkImage.h
itk::LevelSetEvolutionBase
Class for iterating and evolving the dense level-set function.
Definition: itkLevelSetEvolutionBase.h:43
itk::SmartPointer< Self >
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::TermContainerType
typename EquationContainerType::TermContainerType TermContainerType
Definition: itkLevelSetEvolutionBase.h:58
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkLevelSetEvolutionBase.h:65
itkImageRegionIteratorWithIndex.h
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::TermContainerPointer
typename TermContainerType::Pointer TermContainerPointer
Definition: itkLevelSetEvolutionBase.h:59
itk::LevelSetEvolutionBase::m_LevelSetContainerIteratorToProcessWhenThreading
LevelSetContainerType::Iterator m_LevelSetContainerIteratorToProcessWhenThreading
Definition: itkLevelSetEvolutionBase.h:175
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkLevelSetEvolutionBase.h:67
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::IdListImageType
typename LevelSetContainerType::IdListImageType IdListImageType
Definition: itkLevelSetEvolutionBase.h:85
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetInputType
typename LevelSetType::InputType LevelSetInputType
Definition: itkLevelSetEvolutionBase.h:77
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::DomainMapImageFilterType
typename LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType
Definition: itkLevelSetEvolutionBase.h:88
itk::LevelSetEvolutionBase::m_Alpha
LevelSetOutputRealType m_Alpha
Definition: itkLevelSetEvolutionBase.h:168
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetDataType
typename LevelSetType::LevelSetDataType LevelSetDataType
Definition: itkLevelSetEvolutionBase.h:80
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::TermType
typename TermContainerType::TermType TermType
Definition: itkLevelSetEvolutionBase.h:61
itk::ShiSparseLevelSetImage::OutputRealType
typename Superclass::OutputRealType OutputRealType
Definition: itkShiSparseLevelSetImage.h:57
itkSignedMaurerDistanceMapImageFilter.h
itk::LevelSetContainer
Container of Level-Sets.
Definition: itkLevelSetContainer.h:39
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkLevelSetEvolutionBase.h:66
itk::LevelSetEvolutionBase::m_LevelSetContainer
LevelSetContainerType::Pointer m_LevelSetContainer
Definition: itkLevelSetEvolutionBase.h:166
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetOutputRealType
typename LevelSetType::OutputRealType LevelSetOutputRealType
Definition: itkLevelSetEvolutionBase.h:79
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::InputImageType
typename TermContainerType::InputImageType InputImageType
Definition: itkLevelSetEvolutionBase.h:64
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::IdListConstIterator
typename LevelSetContainerType::IdListConstIterator IdListConstIterator
Definition: itkLevelSetEvolutionBase.h:84
itk::ShiSparseLevelSetImage
Derived class for the shi representation of level-set function.
Definition: itkShiSparseLevelSetImage.h:37
itk::LevelSetEvolutionBase::m_Dt
LevelSetOutputRealType m_Dt
Definition: itkLevelSetEvolutionBase.h:169
itk::LevelSetEvolutionBase::m_LevelSetUpdateContainerIteratorToProcessWhenThreading
LevelSetContainerType::Iterator m_LevelSetUpdateContainerIteratorToProcessWhenThreading
Definition: itkLevelSetEvolutionBase.h:176
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetContainerType
typename TermContainerType::LevelSetContainerType LevelSetContainerType
Definition: itkLevelSetEvolutionBase.h:72
itk::ShiSparseLevelSetImage::OutputType
typename Superclass::OutputType OutputType
Definition: itkShiSparseLevelSetImage.h:56
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::StoppingCriterionPointer
typename StoppingCriterionType::Pointer StoppingCriterionPointer
Definition: itkLevelSetEvolutionBase.h:91
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetOutputType
typename LevelSetType::OutputType LevelSetOutputType
Definition: itkLevelSetEvolutionBase.h:78
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itkNumericTraits.h
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::InputPixelRealType
typename NumericTraits< InputImagePixelType >::RealType InputPixelRealType
Definition: itkLevelSetEvolutionBase.h:68
itkBinaryThresholdImageFilter.h
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::EquationContainerPointer
typename EquationContainerType::Pointer EquationContainerPointer
Definition: itkLevelSetEvolutionBase.h:57
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::EquationContainerType
TEquationContainer EquationContainerType
Definition: itkLevelSetEvolutionBase.h:56
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::TermPointer
typename TermType::Pointer TermPointer
Definition: itkLevelSetEvolutionBase.h:62
itk::ShiSparseLevelSetImage::LevelSetDataType
typename Superclass::LevelSetDataType LevelSetDataType
Definition: itkShiSparseLevelSetImage.h:60
itk::LevelSetEvolutionBase< TEquationContainer, ShiSparseLevelSetImage< VDimension > >::LevelSetIdentifierType
typename LevelSetContainerType::LevelSetIdentifierType LevelSetIdentifierType
Definition: itkLevelSetEvolutionBase.h:74
itk::LevelSetEvolutionStoppingCriterion
Definition: itkLevelSetEvolutionStoppingCriterion.h:33
itk::IdentifierType
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
itk::LevelSetEvolutionBase::m_RMSChangeAccumulator
LevelSetOutputRealType m_RMSChangeAccumulator
Definition: itkLevelSetEvolutionBase.h:170