ITK  6.0.0
Insight Toolkit
itkGaussianImageSource.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 itkGaussianImageSource_h
19 #define itkGaussianImageSource_h
20 
22 #include "itkFixedArray.h"
23 #include "itkSize.h"
24 
25 namespace itk
26 {
44 template <typename TOutputImage>
45 class ITK_TEMPLATE_EXPORT GaussianImageSource : public ParametricImageSource<TOutputImage>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(GaussianImageSource);
49 
55 
57  using OutputImageType = TOutputImage;
58 
60  using OutputImagePixelType = typename TOutputImage::PixelType;
61 
64 
67  using SpacingType = typename TOutputImage::SpacingType;
68 
72 
76 
78  static constexpr unsigned int NDimensions = TOutputImage::ImageDimension;
79 
82 
84  using SizeType = typename TOutputImage::SizeType;
86 
88  using typename Superclass::ParametersValueType;
89  using typename Superclass::ParametersType;
90 
92  itkOverrideGetNameOfClassMacro(GaussianImageSource);
93 
95  itkNewMacro(Self);
96 
100  itkSetMacro(Scale, double);
101  itkGetConstReferenceMacro(Scale, double);
105  itkSetMacro(Normalized, bool);
106  itkGetConstReferenceMacro(Normalized, bool);
107  itkBooleanMacro(Normalized);
111  itkSetMacro(Sigma, ArrayType);
112  itkGetConstReferenceMacro(Sigma, ArrayType);
116  itkSetMacro(Mean, ArrayType);
117  itkGetConstReferenceMacro(Mean, ArrayType);
125  void
126  SetParameters(const ParametersType & parameters) override;
128  GetParameters() const override;
134  unsigned int
135  GetNumberOfParameters() const override;
136 
137 protected:
139  ~GaussianImageSource() override = default;
140  void
141  PrintSelf(std::ostream & os, Indent indent) const override;
142 
143  void
144  GenerateData() override;
145 
146 private:
147  ArrayType m_Sigma{};
148 
149  ArrayType m_Mean{};
150 
151  double m_Scale{ 255.0 };
152 
153  bool m_Normalized{ false };
154 };
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 # include "itkGaussianImageSource.hxx"
159 #endif
160 
161 #endif
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GaussianImageSource::DirectionType
typename TOutputImage::DirectionType DirectionType
Definition: itkGaussianImageSource.h:75
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GaussianImageSource::SizeType
typename TOutputImage::SizeType SizeType
Definition: itkGaussianImageSource.h:84
itk::GaussianImageSource::PointType
typename TOutputImage::PointType PointType
Definition: itkGaussianImageSource.h:71
itk::ParametricImageSource
Base class for all parametric image sources.
Definition: itkParametricImageSource.h:45
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkFixedArray.h
itk::GaussianImageSource::SizeValueType
typename TOutputImage::SizeValueType SizeValueType
Definition: itkGaussianImageSource.h:85
itk::GaussianImageSource
Generate an n-dimensional image of a Gaussian.
Definition: itkGaussianImageSource.h:45
itk::FixedArray< double, Self::NDimensions >
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itkParametricImageSource.h
itk::GaussianImageSource::SpacingType
typename TOutputImage::SpacingType SpacingType
Definition: itkGaussianImageSource.h:67
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itkSize.h