00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLevelSetFunctionWithRefitTerm_h_
00018 #define __itkLevelSetFunctionWithRefitTerm_h_
00019
00020 #include "itkLevelSetFunction.h"
00021 #include "itkSparseImage.h"
00022 #include "itkNumericTraits.h"
00023
00024 namespace itk {
00025
00049 template <class TImageType, class TSparseImageType>
00050 class ITK_EXPORT LevelSetFunctionWithRefitTerm
00051 : public LevelSetFunction<TImageType>
00052 {
00053 public:
00054
00056 typedef LevelSetFunctionWithRefitTerm Self;
00057 typedef LevelSetFunction<TImageType> Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkTypeMacro( LevelSetFunctionWithRefitTerm, LevelSetFunction );
00063
00065 itkNewMacro (Self);
00066
00068 typedef typename Superclass::ImageType ImageType;
00069 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00070 typedef typename Superclass::ScalarValueType ScalarValueType;
00071 typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
00072 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00073 typedef typename Superclass::TimeStepType TimeStepType;
00074
00076 typedef typename ImageType::IndexType IndexType;
00077
00079 typedef TSparseImageType SparseImageType;
00080
00082 typedef typename SparseImageType::NodeType NodeType;
00083
00085 typedef typename NodeType::NodeDataType NormalVectorType;
00086
00088 void SetRefitWeight( const ScalarValueType w )
00089 {
00090 m_RefitWeight = w;
00091 }
00092
00095 void SetOtherPropagationWeight( const ScalarValueType w )
00096 {
00097 m_OtherPropagationWeight = w;
00098 }
00099
00102 void SetSparseTargetImage( SparseImageType *im )
00103 { m_SparseTargetImage = im; }
00104
00106 SparseImageType* GetSparseTargetImage() const
00107 { return m_SparseTargetImage; }
00108
00113 virtual TimeStepType ComputeGlobalTimeStep( void *GlobalData ) const;
00114
00115 protected:
00117 ScalarValueType m_RefitWeight;
00118
00121 ScalarValueType m_OtherPropagationWeight;
00122
00123 LevelSetFunctionWithRefitTerm ();
00124 void PrintSelf(std::ostream& os, Indent indent) const;
00125
00128 ScalarValueType ComputeCurvature( const NeighborhoodType & ) const;
00129
00133 virtual ScalarValueType PropagationSpeed(const NeighborhoodType& ,
00134 const FloatOffsetType &,
00135 GlobalDataStruct * = 0 ) const;
00136
00140 virtual ScalarValueType OtherPropagationSpeed(const NeighborhoodType& ,
00141 const FloatOffsetType &,
00142 GlobalDataStruct * = 0) const
00143 {
00144 return NumericTraits<ScalarValueType>::Zero;
00145 }
00146
00147 private:
00149 typename SparseImageType::Pointer m_SparseTargetImage;
00150
00152 ScalarValueType m_MinVectorNorm;
00153
00155 static const unsigned long m_NumVertex;
00156 static const ScalarValueType m_DimConst;
00157 };
00158
00159 }
00160
00161 #ifndef ITK_MANUAL_INSTANTIATION
00162 #include "itkLevelSetFunctionWithRefitTerm.txx"
00163 #endif
00164
00165 #endif
00166