ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkLevelSetEquationTermBase.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 #ifndef itkLevelSetEquationTermBase_h
20 #define itkLevelSetEquationTermBase_h
21 
22 #include "itkObject.h"
24 #include "itksys/hash_set.hxx"
25 
26 namespace itk
27 {
47 template< typename TInputImage, // Input image
48  typename TLevelSetContainer >
49 class ITK_TEMPLATE_EXPORT LevelSetEquationTermBase : public Object
50 {
51 public:
55  typedef Object Superclass;
56 
58  itkTypeMacro( LevelSetEquationTermBase, Object );
59 
60  typedef TInputImage InputImageType;
61  typedef typename InputImageType::Pointer InputImagePointer;
62  typedef typename InputImageType::PixelType InputPixelType;
65 
67  typedef TLevelSetContainer LevelSetContainerType;
68  typedef typename LevelSetContainerType::LevelSetIdentifierType
70  typedef typename LevelSetContainerType::Pointer LevelSetContainerPointer;
71  typedef typename LevelSetContainerType::LevelSetType LevelSetType;
72  typedef typename LevelSetContainerType::LevelSetPointer LevelSetPointer;
73  typedef typename LevelSetContainerType::OutputType LevelSetOutputPixelType;
74  typedef typename LevelSetContainerType::OutputRealType LevelSetOutputRealType;
75  typedef typename LevelSetContainerType::InputIndexType LevelSetInputIndexType;
76  typedef typename LevelSetContainerType::GradientType LevelSetGradientType;
77  typedef typename LevelSetContainerType::HessianType LevelSetHessianType;
78  typedef typename LevelSetContainerType::LevelSetDataType
80 
81  typedef typename LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType;
82  typedef typename LevelSetContainerType::CacheImageType CacheImageType;
83 
87 // typedef typename HeavisideType::Pointer HeavisidePointer;
89 
91  itkSetObjectMacro( Input, InputImageType );
92  itkGetModifiableObjectMacro(Input, InputImageType );
94 
95  itkSetMacro( Coefficient, LevelSetOutputRealType );
96  itkGetMacro( Coefficient, LevelSetOutputRealType );
97 
98  itkSetMacro( CurrentLevelSetId, LevelSetIdentifierType );
99  itkGetMacro( CurrentLevelSetId, LevelSetIdentifierType );
100 
101  itkGetModifiableObjectMacro(CurrentLevelSetPointer, LevelSetType );
102 
103  virtual void SetLevelSetContainer( LevelSetContainerType*ptr );
104  itkGetModifiableObjectMacro(LevelSetContainer, LevelSetContainerType );
105 
109  virtual LevelSetOutputRealType Evaluate( const LevelSetInputIndexType& iP );
110 
111  virtual LevelSetOutputRealType Evaluate( const LevelSetInputIndexType& iP,
112  const LevelSetDataType& iData );
113 
115  virtual void Initialize( const LevelSetInputIndexType& iP ) = 0;
116 
118  virtual void InitializeParameters() = 0;
119 
121  virtual void UpdatePixel( const LevelSetInputIndexType& iP,
122  const LevelSetOutputRealType & oldValue,
123  const LevelSetOutputRealType & newValue ) = 0;
124 
126  itkGetConstMacro( CFLContribution, LevelSetOutputRealType );
127 
129  itkSetStringMacro( TermName );
130  itkGetStringMacro( TermName );
132 
134  virtual void Update() = 0;
135 
136  typedef itksys::hash_set< std::string > RequiredDataType;
137 
138  const RequiredDataType & GetRequiredData() const;
139 
140 protected:
143 
145  virtual ~LevelSetEquationTermBase() ITK_OVERRIDE;
146 
147  void SetUp();
148 
153  virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP ) = 0;
154 
155  virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP,
156  const LevelSetDataType& iData ) = 0;
157 
160 
162  LevelSetContainerPointer m_LevelSetContainer;
163 
165  LevelSetIdentifierType m_CurrentLevelSetId;
166 
167  LevelSetPointer m_CurrentLevelSetPointer;
168 
170  LevelSetOutputRealType m_Coefficient;
171 
175  LevelSetOutputRealType m_CFLContribution;
176 
181 
185  std::string m_TermName;
186 
187  RequiredDataType m_RequiredData;
188 
189 private:
190  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetEquationTermBase);
191 };
192 }
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkLevelSetEquationTermBase.hxx"
196 #endif
197 
198 #endif
LevelSetContainerType::CacheImageType CacheImageType
LevelSetContainerType::LevelSetDataType LevelSetDataType
HeavisideType::ConstPointer HeavisideConstPointer
LevelSetContainerType::DomainMapImageFilterType DomainMapImageFilterType
LevelSetContainerType::HessianType LevelSetHessianType
LevelSetContainerType::OutputType LevelSetOutputPixelType
itksys::hash_set< std::string > RequiredDataType
HeavisideStepFunctionBase< LevelSetOutputRealType, LevelSetOutputRealType > HeavisideType
NumericTraits< InputPixelType >::RealType InputPixelRealType
Abstract class to represents a term in the level-set evolution PDE.
LevelSetContainerType::InputIndexType LevelSetInputIndexType
InputImageType::PixelType InputPixelType
LevelSetContainerType::LevelSetPointer LevelSetPointer
Container of Level-Sets.
LevelSetContainerType::OutputRealType LevelSetOutputRealType
LevelSetContainerType::LevelSetIdentifierType LevelSetIdentifierType
LevelSetContainerType::LevelSetType LevelSetType
SmartPointer< const Self > ConstPointer
LevelSetContainerType::Pointer LevelSetContainerPointer
LevelSetContainerType::GradientType LevelSetGradientType
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:59
Base class of the Heaviside function.