ITK  4.6.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();
96 
97  virtual void Initialize(const RadiusType & r)
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 &); //purposely not
174  // implemented
175  void operator=(const Self &); //purposely not
176  // implemented
177 
178  void PrintSelf(std::ostream & os, Indent indent) const
179  {
180  Superclass::PrintSelf(os, indent);
181  os << indent << "UpperThreshold: " << m_UpperThreshold << std::endl;
182  os << indent << "LowerThreshold: " << m_LowerThreshold << std::endl;
183  os << indent << "EdgeWeight: " << m_EdgeWeight << std::endl;
184  os << indent << "SmoothingTimeStep: " << m_SmoothingTimeStep << std::endl;
185  os << indent << "SmoothingIterations: " << m_SmoothingIterations << std::endl;
186  os << indent << "SmoothingConductance: " << m_SmoothingConductance << std::endl;
187  }
188 
195 };
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkThresholdSegmentationLevelSetFunction.hxx"
200 #endif
201 
202 #endif
void PrintSelf(std::ostream &os, Indent indent) const
void PrintSelf(std::ostream &s, Indent indent) const
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 &)
virtual void Initialize(const RadiusType &r)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
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...