Orfeo Toolbox  4.0
itkNormalVectorDiffusionFunction.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 __itkNormalVectorDiffusionFunction_h
19 #define __itkNormalVectorDiffusionFunction_h
20 
22 #include "itkNumericTraits.h"
23 #include <cmath>
24 
25 namespace itk
26 {
59 template< typename TSparseImageType >
61  public NormalVectorFunctionBase< TSparseImageType >
62 {
63 public:
69 
72 
74  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
75 
77  itkNewMacro(Self);
78 
80  typedef typename Superclass::TimeStepType TimeStepType;
85  typedef typename Superclass::IndexType IndexType;
87  typedef typename Superclass::NodeType NodeType;
90 
95  void SetNormalProcessType(int npt)
96  { m_NormalProcessType = npt; }
97 
100  { return m_NormalProcessType; }
101 
108  {
109  m_ConductanceParameter = cp + static_cast< NodeValueType >( 0.001 );
110  // we add a minimum conductance to avoid divide by zero
111  // can make this a parameter.
112  m_FluxStopConstant = static_cast< NodeValueType >
114  }
115 
118  { return m_ConductanceParameter; }
119 
122  { return m_FluxStopConstant; }
123 
128  virtual void PrecomputeSparseUpdate(NeighborhoodType & it) const;
129 
132  void *globalData,
133  const FloatOffsetType & offset) const;
134 
135 protected:
138  void PrintSelf(std::ostream & os, Indent indent) const;
139 
143  {
144  // the slow exp function could be replaced with a lookup table
145  if ( v <= 0.0 ) { return NumericTraits< NodeValueType >::One; }
146  else { return static_cast< NodeValueType >( vcl_exp(m_FluxStopConstant * v) ); }
147  }
148 
149 private:
152 
156 
159 
160  NormalVectorDiffusionFunction(const Self &); //purposely not implemented
161  void operator=(const Self &); //purposely not implemented
162 };
163 } // end namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
167 #endif
168 
169 #endif

Generated at Sat Mar 8 2014 15:18:40 for Orfeo Toolbox with doxygen 1.8.3.1