ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkLevelSetFunctionWithRefitTerm.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 #ifndef __itkLevelSetFunctionWithRefitTerm_h
19 #define __itkLevelSetFunctionWithRefitTerm_h
20 
21 #include "itkLevelSetFunction.h"
22 #include "itkSparseImage.h"
23 #include "itkNumericTraits.h"
24 
25 namespace itk
26 {
51 template< class TImageType, class TSparseImageType >
53  public LevelSetFunction< TImageType >
54 {
55 public:
56 
62 
65 
67  itkNewMacro (Self);
68 
70  typedef typename Superclass::ImageType ImageType;
71  typedef typename Superclass::FloatOffsetType FloatOffsetType;
73  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
74  typedef typename Superclass::NeighborhoodType NeighborhoodType;
75  typedef typename Superclass::NeighborhoodScalesType NeighborhoodScalesType;
76  typedef typename Superclass::TimeStepType TimeStepType;
77 
79 
81  typedef typename ImageType::IndexType IndexType;
82 
84  typedef TSparseImageType SparseImageType;
85 
87  typedef typename SparseImageType::NodeType NodeType;
88 
90  typedef typename NodeType::NodeDataType NormalVectorType;
91 
93  void SetRefitWeight(const ScalarValueType w)
94  {
95  m_RefitWeight = w;
96  }
97 
100  void SetOtherPropagationWeight(const ScalarValueType w)
101  {
102  m_OtherPropagationWeight = w;
103  }
104 
107  void SetSparseTargetImage(SparseImageType *im)
108  { m_SparseTargetImage = im; }
109 
111  SparseImageType * GetSparseTargetImage() const
112  { return m_SparseTargetImage; }
113 
118  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
119 
120 protected:
123 
127 
129  void PrintSelf(std::ostream & os, Indent indent) const;
130 
133  ScalarValueType ComputeCurvature(const NeighborhoodType &) const;
134 
138  virtual ScalarValueType PropagationSpeed(const NeighborhoodType &,
139  const FloatOffsetType &,
140  GlobalDataStruct * = 0) const;
141 
145  virtual ScalarValueType OtherPropagationSpeed(const NeighborhoodType &,
146  const FloatOffsetType &,
147  GlobalDataStruct * = 0) const
148  {
150  }
151 
152 private:
153  LevelSetFunctionWithRefitTerm(const Self &); //purposely not implemented
154  void operator=(const Self &); //purposely not implemented
155 
157  typename SparseImageType::Pointer m_SparseTargetImage;
158 
161 
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkLevelSetFunctionWithRefitTerm.hxx"
170 #endif
171 
172 #endif
173