ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkVectorThresholdSegmentationLevelSetFunction.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 itkVectorThresholdSegmentationLevelSetFunction_h
19#define itkVectorThresholdSegmentationLevelSetFunction_h
20
22#include "itkNumericTraits.h"
24namespace itk
25{
57template <typename TImageType, typename TFeatureImageType>
59 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
60{
61public:
62 ITK_DISALLOW_COPY_AND_MOVE(VectorThresholdSegmentationLevelSetFunction);
63
69 using FeatureImageType = TFeatureImageType;
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(VectorThresholdSegmentationLevelSetFunction);
76
78 using typename Superclass::ImageType;
79 using typename Superclass::ScalarValueType;
80 using typename Superclass::FeatureScalarType;
81 using typename Superclass::RadiusType;
82
84 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
85
87 using FeatureImagePixelType = typename FeatureImageType::PixelType;
88 static constexpr unsigned int NumberOfComponents = FeatureImagePixelType::Dimension;
89
94
96 void
97 SetMean(const MeanVectorType & mean)
98 {
99 m_Mahalanobis->SetMean(mean);
100 }
101 const MeanVectorType &
102 GetMean() const
103 {
104 return m_Mahalanobis->GetMean();
105 }
106
107
108 void
110 {
111 m_Mahalanobis->SetCovariance(cov);
112 }
113 const CovarianceMatrixType &
115 {
116 return m_Mahalanobis->GetCovariance();
117 }
118
120 void
122 {
123 m_Threshold = thr;
124 }
125
126 ScalarValueType
128 {
129 return m_Threshold;
130 }
131
132 void
134
135 void
144
145protected:
147 {
150
151 mean.Fill(typename FeatureScalarType::ValueType{});
152 covariance.Fill(typename FeatureScalarType::ValueType{});
153
155 m_Mahalanobis->SetMean(mean);
156 m_Mahalanobis->SetCovariance(covariance);
157
158 this->SetAdvectionWeight(0.0);
159 this->SetPropagationWeight(1.0);
160 this->SetThreshold(1.8);
161 }
162
164
165 void
166 PrintSelf(std::ostream & os, Indent indent) const override
167 {
168 Superclass::PrintSelf(os, indent);
169 os << indent << "MahalanobisFunction: " << m_Mahalanobis << std::endl;
170 os << indent << "ThresholdValue: " << m_Threshold << std::endl;
171 }
172
175};
176} // end namespace itk
177
178#ifndef ITK_MANUAL_INSTANTIATION
179# include "itkVectorThresholdSegmentationLevelSetFunction.hxx"
180#endif
181
182#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void SetAdvectionWeight(const ScalarValueType a)
virtual void SetPropagationWeight(const ScalarValueType p)
virtual void SetCurvatureWeight(const ScalarValueType c)
virtual void PrintSelf(std::ostream &os, Indent indent) const
typename ConstNeighborhoodIterator< OutputImageType >::RadiusType RadiusType
Implements transparent reference counting.
MahalanobisDistanceMembershipFunction models class membership using Mahalanobis distance.
Statistics::MahalanobisDistanceMembershipFunction< FeatureScalarType > MahalanobisFunctionType
typename MahalanobisFunctionType::CovarianceMatrixType CovarianceMatrixType
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
typename ConstNeighborhoodIterator< OutputImageType >::RadiusType RadiusType
~VectorThresholdSegmentationLevelSetFunction() override=default
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....