ITK  4.3.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< class TInputImage, // Input image
48  class TLevelSetContainer >
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  itkGetObjectMacro( Input, InputImageType );
94 
95  itkSetMacro( Coefficient, LevelSetOutputRealType );
96  itkGetMacro( Coefficient, LevelSetOutputRealType );
97 
98  itkSetMacro( CurrentLevelSetId, LevelSetIdentifierType );
99  itkGetMacro( CurrentLevelSetId, LevelSetIdentifierType );
100 
101  itkGetObjectMacro( CurrentLevelSetPointer, LevelSetType );
102 
103  virtual void SetLevelSetContainer( LevelSetContainerType*ptr );
104  itkGetObjectMacro( LevelSetContainer, LevelSetContainerType );
105 
110 
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();
146 
147  void SetUp();
148 
153  virtual LevelSetOutputRealType Value( const LevelSetInputIndexType& iP ) = 0;
154 
156  const LevelSetDataType& iData ) = 0;
157 
160 
163 
166 
168 
171 
176 
181 
185  std::string m_TermName;
186 
188 
189 private:
190  LevelSetEquationTermBase( const Self& ); // purposely not implemented
191  void operator = ( const Self& ); // purposely not implemented
192 };
193 }
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkLevelSetEquationTermBase.hxx"
197 #endif
198 
199 #endif
200