ITK  4.9.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 
86  { m_UpperThreshold = f; }
88  { return m_UpperThreshold; }
90  { m_LowerThreshold = f; }
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 
109  {
110  m_EdgeWeight = p;
111  }
112 
114  {
115  return m_EdgeWeight;
116  }
117 
122  {
124  }
125 
127  {
128  return m_SmoothingConductance;
129  }
130 
134  void SetSmoothingIterations(const int p)
135  {
137  }
138 
140  {
141  return m_SmoothingIterations;
142  }
143 
148  {
150  }
151 
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 
193 };
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 #include "itkThresholdSegmentationLevelSetFunction.hxx"
198 #endif
199 
200 #endif
void PrintSelf(std::ostream &s, Indent indent) const override
Light weight base class for most itk classes.
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
virtual void SetPropagationWeight(const ScalarValueType p)
static T max(const T &)
void PrintSelf(std::ostream &os, Indent indent) const override
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)
This function is used in ThresholdSegmentationLevelSetImageFilter to segment structures in images bas...