ITK  5.4.0
Insight Toolkit
itkGaussianSpatialObject.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 itkGaussianSpatialObject_h
19 #define itkGaussianSpatialObject_h
20 
22 
23 namespace itk
24 {
43 template <unsigned int TDimension = 3>
44 class ITK_TEMPLATE_EXPORT GaussianSpatialObject : public SpatialObject<TDimension>
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(GaussianSpatialObject);
48 
50  using ScalarType = double;
55  using typename Superclass::PointType;
56  using typename Superclass::TransformType;
57  using typename Superclass::BoundingBoxType;
58 
59  static constexpr unsigned int ObjectDimensions = TDimension;
60 
61  itkNewMacro(Self);
62  itkOverrideGetNameOfClassMacro(GaussianSpatialObject);
63 
66  void
67  Clear() override;
68 
72  itkSetMacro(RadiusInObjectSpace, ScalarType);
73  itkGetConstReferenceMacro(RadiusInObjectSpace, ScalarType);
78  itkSetMacro(SigmaInObjectSpace, ScalarType);
79  itkGetConstReferenceMacro(SigmaInObjectSpace, ScalarType);
82  itkSetMacro(CenterInObjectSpace, PointType);
83  itkGetConstReferenceMacro(CenterInObjectSpace, PointType);
84 
87  itkSetMacro(Maximum, ScalarType);
88  itkGetConstReferenceMacro(Maximum, ScalarType);
96  SquaredZScoreInObjectSpace(const PointType & point) const;
97 
102  ScalarType
103  SquaredZScoreInWorldSpace(const PointType & point) const;
104 
110  bool
111  IsInsideInObjectSpace(const PointType & point) const override;
112 
113  /* Avoid hiding the overload that supports depth and name arguments */
114  using Superclass::IsInsideInObjectSpace;
115 
117  bool
118  ValueAtInObjectSpace(const PointType & point,
119  double & value,
120  unsigned int depth = 0,
121  const std::string & name = "") const override;
122 
126  GetEllipsoid() const;
127 
128 #if !defined(ITK_LEGACY_REMOVE)
129  itkLegacyMacro(void SetSigma(double sigma)) { return this->SetSigmaInObjectSpace(sigma); }
130 
131  itkLegacyMacro(double GetSigma() const) { return this->GetSigmaInObjectSpace(); }
132 #endif
133 protected:
136  void
137  ComputeMyBoundingBox() override;
138 
139  GaussianSpatialObject();
140  ~GaussianSpatialObject() override = default;
141 
142  void
143  PrintSelf(std::ostream & os, Indent indent) const override;
144 
145  typename LightObject::Pointer
146  InternalClone() const override;
147 
148 private:
149  ScalarType m_Maximum{};
150  ScalarType m_RadiusInObjectSpace{};
151  ScalarType m_SigmaInObjectSpace{};
152  PointType m_CenterInObjectSpace{};
153 };
154 } // end namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 # include "itkGaussianSpatialObject.hxx"
158 #endif
159 
160 #endif // itkGaussianSpatialObject_h
itk::GaussianSpatialObject
Represents a multivariate Gaussian function.
Definition: itkGaussianSpatialObject.h:44
itkEllipseSpatialObject.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::LightObject::Pointer
SmartPointer< Self > Pointer
Definition: itkLightObject.h:62
itk::SmartPointer< Self >
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::GaussianSpatialObject::ScalarType
double ScalarType
Definition: itkGaussianSpatialObject.h:50
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293