ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkVectorThresholdSegmentationLevelSetFunction.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 itkVectorThresholdSegmentationLevelSetFunction_h
19 #define itkVectorThresholdSegmentationLevelSetFunction_h
20 
22 #include "itkNumericTraits.h"
24 namespace itk
25 {
57 template< typename TImageType, typename TFeatureImageType >
59  public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
60 {
61 public:
68  typedef TFeatureImageType FeatureImageType;
69 
71  itkNewMacro(Self);
72 
75 
77  typedef typename Superclass::ImageType ImageType;
81 
83  itkStaticConstMacro(ImageDimension, unsigned int,
85 
87  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
88  itkStaticConstMacro(NumberOfComponents, unsigned int,
89  FeatureImagePixelType::Dimension);
90 
95 
97  void SetMean(const MeanVectorType & mean) { m_Mahalanobis->SetMean(mean); }
98  const MeanVectorType & GetMean() const { return m_Mahalanobis->GetMean(); }
100 
101  void SetCovariance(const CovarianceMatrixType & cov) { m_Mahalanobis->SetCovariance(cov); }
102  const CovarianceMatrixType & GetCovariance() const { return m_Mahalanobis->GetCovariance(); }
103 
106  {
107  m_Threshold = thr;
108  }
109 
111  {
112  return m_Threshold;
113  }
114 
115  virtual void CalculateSpeedImage() ITK_OVERRIDE;
116 
117  virtual void Initialize(const RadiusType & r) ITK_OVERRIDE
118  {
120 
124  }
125 
126 protected:
128  {
131 
134 
136  m_Mahalanobis->SetMean(mean);
137  m_Mahalanobis->SetCovariance(covariance);
138 
139  this->SetAdvectionWeight(0.0);
140  this->SetPropagationWeight(1.0);
141  this->SetThreshold(1.8);
142  }
143 
145 
146  VectorThresholdSegmentationLevelSetFunction(const Self &); //purposely not
147  // implemented
148  void operator=(const Self &); //purposely not
149 
150  // implemented
151 
152  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
153  {
154  Superclass::PrintSelf(os, indent);
155  os << indent << "MahalanobisFunction: " << m_Mahalanobis << std::endl;
156  os << indent << "ThresholdValue: " << m_Threshold << std::endl;
157  }
158 
161 };
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkVectorThresholdSegmentationLevelSetFunction.hxx"
166 #endif
167 
168 #endif
Statistics::MahalanobisDistanceMembershipFunction< FeatureScalarType > MahalanobisFunctionType
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
void PrintSelf(std::ostream &s, Indent indent) const override
Light weight base class for most itk classes.
MahalanobisDistanceMembershipFunction models class membership using Mahalanobis distance.
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
virtual void SetPropagationWeight(const ScalarValueType p)
This function is used in VectorThresholdSegmentationLevelSetImageFilter to segment structures in imag...
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