ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLevelSetEvolutionBase.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 
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_ASSIGN(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 SetTimeStep( const LevelSetOutputRealType& iDt );
103 
105  itkSetObjectMacro( EquationContainer, EquationContainerType );
106  itkGetModifiableObjectMacro( EquationContainer, EquationContainerType );
108 
110  itkSetObjectMacro( StoppingCriterion, StoppingCriterionType );
111  itkGetModifiableObjectMacro( StoppingCriterion, StoppingCriterionType );
113 
115  itkGetConstMacro( NumberOfIterations, IdentifierType );
116 
120  void Update();
121 
122 protected:
124 
125  ~LevelSetEvolutionBase() override = default;
126 
127  void CheckSetUp();
128 
130  void InitializeIteration();
131 
136  void Evolve();
137 
140  virtual void AllocateUpdateBuffer();
141 
144  virtual void ComputeIteration();
145 
147  virtual void ComputeTimeStepForNextIteration();
148 
149  virtual void UpdateLevelSets() = 0;
150 
151  virtual void UpdateEquations() = 0;
152 
154 
156  typename LevelSetContainerType::Pointer m_LevelSetContainer;
157 
163 
165  typename LevelSetContainerType::Iterator m_LevelSetContainerIteratorToProcessWhenThreading;
166  typename LevelSetContainerType::Iterator m_LevelSetUpdateContainerIteratorToProcessWhenThreading;
167 };
168 }
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkLevelSetEvolutionBase.hxx"
172 #endif
173 
174 #endif // itkLevelSetEvolutionBase_h
Light weight base class for most itk classes.
Define numeric traits for std::vector.
Derived class for the shi representation of level-set function.
typename Superclass::InputType InputType
LevelSetContainerType::Pointer m_LevelSetContainer
LevelSetContainerType::Iterator m_LevelSetUpdateContainerIteratorToProcessWhenThreading
typename Superclass::LevelSetDataType LevelSetDataType
EquationContainerPointer m_EquationContainer
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
StoppingCriterionPointer m_StoppingCriterion
LevelSetOutputRealType m_RMSChangeAccumulator
LevelSetContainerType::Iterator m_LevelSetContainerIteratorToProcessWhenThreading
Container of Level-Sets.
typename Superclass::OutputType OutputType
typename Superclass::OutputRealType OutputRealType
Base class for most ITK classes.
Definition: itkObject.h:60
Class for iterating and evolving the dense level-set function.