ITK  5.4.0
Insight Toolkit
itkLevelSetFunctionWithRefitTerm.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 <typename TImageType, typename TSparseImageType>
52 class ITK_TEMPLATE_EXPORT LevelSetFunctionWithRefitTerm : public LevelSetFunction<TImageType>
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_MOVE(LevelSetFunctionWithRefitTerm);
56 
62 
64  itkOverrideGetNameOfClassMacro(LevelSetFunctionWithRefitTerm);
65 
67  itkNewMacro(Self);
68 
70  using typename Superclass::ImageType;
71  using typename Superclass::FloatOffsetType;
72  using typename Superclass::ScalarValueType;
73  using typename Superclass::GlobalDataStruct;
74  using typename Superclass::NeighborhoodType;
75  using typename Superclass::NeighborhoodScalesType;
76  using typename Superclass::TimeStepType;
77 
79 
81  using IndexType = typename ImageType::IndexType;
82 
84  using SparseImageType = TSparseImageType;
85 
87  using NodeType = typename SparseImageType::NodeType;
88 
90  using NormalVectorType = typename NodeType::NodeDataType;
91 
93  void
95  {
96  m_RefitWeight = w;
97  }
98 
101  void
103  {
104  m_OtherPropagationWeight = w;
105  }
106 
109  void
111  {
112  m_SparseTargetImage = im;
113  }
114 
116  SparseImageType *
118  {
119  return m_SparseTargetImage;
120  }
121 
126  TimeStepType
127  ComputeGlobalTimeStep(void * GlobalData) const override;
128 
129 protected:
131  ScalarValueType m_RefitWeight{};
132 
135  ScalarValueType m_OtherPropagationWeight{};
136 
138  void
139  PrintSelf(std::ostream & os, Indent indent) const override;
140 
143  ScalarValueType
144  ComputeCurvature(const NeighborhoodType &) const;
145 
149  ScalarValueType
150  PropagationSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct * = 0) const override;
151 
155  virtual ScalarValueType
157  {
158  return ScalarValueType{};
159  }
160 
161 private:
163  typename SparseImageType::Pointer m_SparseTargetImage{};
164 
166  ScalarValueType m_MinVectorNorm{};
167 
171 };
172 } // end namespace itk
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 # include "itkLevelSetFunctionWithRefitTerm.hxx"
176 #endif
177 
178 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkLevelSetFunction.h
itk::LevelSetFunctionWithRefitTerm::GetSparseTargetImage
SparseImageType * GetSparseTargetImage() const
Definition: itkLevelSetFunctionWithRefitTerm.h:117
itk::LevelSetFunctionWithRefitTerm::m_DimConst
static const ScalarValueType m_DimConst
Definition: itkLevelSetFunctionWithRefitTerm.h:170
itk::LevelSetFunctionWithRefitTerm::NormalVectorType
typename NodeType::NodeDataType NormalVectorType
Definition: itkLevelSetFunctionWithRefitTerm.h:90
itk::LevelSetFunctionWithRefitTerm::SetOtherPropagationWeight
void SetOtherPropagationWeight(const ScalarValueType w)
Definition: itkLevelSetFunctionWithRefitTerm.h:102
itk::LevelSetFunction::GlobalDataStruct
Definition: itkLevelSetFunction.h:106
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LevelSetFunctionWithRefitTerm::IndexType
typename ImageType::IndexType IndexType
Definition: itkLevelSetFunctionWithRefitTerm.h:81
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LevelSetFunctionWithRefitTerm
This class extends the LevelSetFunction class by adding a grow term based on a target curvature store...
Definition: itkLevelSetFunctionWithRefitTerm.h:52
itk::LevelSetFunctionWithRefitTerm::NodeType
typename SparseImageType::NodeType NodeType
Definition: itkLevelSetFunctionWithRefitTerm.h:87
itk::LevelSetFunctionWithRefitTerm::NeighborhoodSizeValueType
typename NeighborhoodType::SizeValueType NeighborhoodSizeValueType
Definition: itkLevelSetFunctionWithRefitTerm.h:78
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::LevelSetFunctionWithRefitTerm::SetSparseTargetImage
void SetSparseTargetImage(SparseImageType *im)
Definition: itkLevelSetFunctionWithRefitTerm.h:110
itk::LevelSetFunctionWithRefitTerm::SetRefitWeight
void SetRefitWeight(const ScalarValueType w)
Definition: itkLevelSetFunctionWithRefitTerm.h:94
itk::LevelSetFunction::ScalarValueType
PixelType ScalarValueType
Definition: itkLevelSetFunction.h:90
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LevelSetFunctionWithRefitTerm::SparseImageType
TSparseImageType SparseImageType
Definition: itkLevelSetFunctionWithRefitTerm.h:84
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itkNumericTraits.h
itk::LevelSetFunctionWithRefitTerm::m_NumVertex
static const NeighborhoodSizeValueType m_NumVertex
Definition: itkLevelSetFunctionWithRefitTerm.h:169
itk::LevelSetFunction
The LevelSetFunction class is a generic function object which can be used to create a level set metho...
Definition: itkLevelSetFunction.h:66
itkSparseImage.h
itk::LevelSetFunctionWithRefitTerm::OtherPropagationSpeed
virtual ScalarValueType OtherPropagationSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
Definition: itkLevelSetFunctionWithRefitTerm.h:156
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83