ITK  4.10.0
Insight Segmentation and Registration Toolkit
itkThresholdSegmentationLevelSetFunction.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 itkThresholdSegmentationLevelSetFunction_h
19 #define itkThresholdSegmentationLevelSetFunction_h
20 
22 #include "itkNumericTraits.h"
23 namespace itk
24 {
55 template< typename TImageType, typename TFeatureImageType = TImageType >
57  public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
58 {
59 public:
66  typedef TFeatureImageType FeatureImageType;
67 
69  itkNewMacro(Self);
70 
73 
75  typedef typename Superclass::ImageType ImageType;
79 
81  itkStaticConstMacro(ImageDimension, unsigned int,
83 
85  void SetUpperThreshold(FeatureScalarType f)
86  { m_UpperThreshold = f; }
87  FeatureScalarType GetUpperThreshold() const
88  { return m_UpperThreshold; }
89  void SetLowerThreshold(FeatureScalarType f)
90  { m_LowerThreshold = f; }
91  FeatureScalarType GetLowerThreshold() const
92  { return m_LowerThreshold; }
94 
95  virtual void CalculateSpeedImage() ITK_OVERRIDE;
96 
97  virtual void Initialize(const RadiusType & r) ITK_OVERRIDE
98  {
100 
104  }
105 
108  void SetEdgeWeight(const ScalarValueType p)
109  {
110  m_EdgeWeight = p;
111  }
112 
113  ScalarValueType GetEdgeWeight() const
114  {
115  return m_EdgeWeight;
116  }
117 
121  void SetSmoothingConductance(const ScalarValueType p)
122  {
124  }
125 
126  ScalarValueType GetSmoothingConductance() const
127  {
128  return m_SmoothingConductance;
129  }
130 
134  void SetSmoothingIterations(const int p)
135  {
137  }
138 
140  {
141  return m_SmoothingIterations;
142  }
143 
147  void SetSmoothingTimeStep(const ScalarValueType i)
148  {
150  }
151 
152  ScalarValueType GetSmoothingTimeStep() const
153  {
154  return m_SmoothingTimeStep;
155  }
156 
157 protected:
159  {
162  this->SetAdvectionWeight(0.0);
163  this->SetPropagationWeight(1.0);
164  this->SetCurvatureWeight(1.0);
165  this->SetSmoothingIterations(5);
166  this->SetSmoothingConductance(0.8);
167  this->SetSmoothingTimeStep(0.1);
168  this->SetEdgeWeight(0.0);
169  }
170 
172 
173  ThresholdSegmentationLevelSetFunction(const Self &) ITK_DELETE_FUNCTION;
174  void operator=(const Self &) ITK_DELETE_FUNCTION;
175 
176  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
177  {
178  Superclass::PrintSelf(os, indent);
179  os << indent << "UpperThreshold: " << m_UpperThreshold << std::endl;
180  os << indent << "LowerThreshold: " << m_LowerThreshold << std::endl;
181  os << indent << "EdgeWeight: " << m_EdgeWeight << std::endl;
182  os << indent << "SmoothingTimeStep: " << m_SmoothingTimeStep << std::endl;
183  os << indent << "SmoothingIterations: " << m_SmoothingIterations << std::endl;
184  os << indent << "SmoothingConductance: " << m_SmoothingConductance << std::endl;
185  }
186 
187  FeatureScalarType m_UpperThreshold;
188  FeatureScalarType m_LowerThreshold;
189  ScalarValueType m_EdgeWeight;
190  ScalarValueType m_SmoothingConductance;
192  ScalarValueType m_SmoothingTimeStep;
193 };
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 #include "itkThresholdSegmentationLevelSetFunction.hxx"
198 #endif
199 
200 #endif
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Definition: itkArray.h:30
void PrintSelf(std::ostream &s, Indent indent) const override
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
static ITK_CONSTEXPR_FUNC T max(const T &)
virtual void SetPropagationWeight(const ScalarValueType p)
void operator=(const Self &) ITK_DELETE_FUNCTION
static ITK_CONSTEXPR_FUNC T NonpositiveMin()
virtual void CalculateSpeedImage() override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void Initialize(const RadiusType &r) override
Define additional traits for native types such as int or float.
virtual void SetCurvatureWeight(const ScalarValueType c)
virtual void SetAdvectionWeight(const ScalarValueType a)
void PrintSelf(std::ostream &os, Indent indent) const override
This function is used in ThresholdSegmentationLevelSetImageFilter to segment structures in images bas...