ITK  5.2.0
Insight Toolkit
itkGridImageSource.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  * 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 itkGridImageSource_h
19 #define itkGridImageSource_h
20 
21 #include "itkGenerateImageSource.h"
22 #include "itkFixedArray.h"
23 #include "itkKernelFunctionBase.h"
24 #include "itkVectorContainer.h"
25 
26 #include "vnl/vnl_vector.h"
27 
28 namespace itk
29 {
57 template <typename TOutputImage>
58 class ITK_TEMPLATE_EXPORT GridImageSource : public GenerateImageSource<TOutputImage>
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_MOVE(GridImageSource);
62 
68 
70  itkTypeMacro(GridImageSource, GenerateImageSource);
71 
73  itkNewMacro(Self);
74 
75  using RealType = double;
76 
78  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
79 
81  using ImageType = TOutputImage;
83  using PixelType = typename TOutputImage::PixelType;
84  using SpacingType = typename TOutputImage::SpacingType;
87  using SizeType = typename TOutputImage::SizeType;
88 
93  using PixelArrayType = vnl_vector<RealType>;
95 
97  itkSetObjectMacro(KernelFunction, KernelFunctionType);
98  itkGetConstReferenceObjectMacro(KernelFunction, KernelFunctionType);
100 
103  itkSetMacro(Sigma, ArrayType);
104  itkGetConstReferenceMacro(Sigma, ArrayType);
106 
108  itkSetMacro(GridSpacing, ArrayType);
109  itkGetConstReferenceMacro(GridSpacing, ArrayType);
111 
113  itkSetMacro(GridOffset, ArrayType);
114  itkGetConstReferenceMacro(GridOffset, ArrayType);
116 
118  itkSetMacro(WhichDimensions, BoolArrayType);
119  itkGetConstReferenceMacro(WhichDimensions, BoolArrayType);
121 
123  itkSetMacro(Scale, RealType);
124  itkGetConstReferenceMacro(Scale, RealType);
126 
127 protected:
128  GridImageSource();
129  ~GridImageSource() override = default;
130  void
131  PrintSelf(std::ostream & os, Indent indent) const override;
132 
133  void
134  DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override;
135 
136 
137  void
138  BeforeThreadedGenerateData() override;
139 
140 private:
143 
145 
147 
149 
151 
153 
154  RealType m_Scale{ 255.0 };
155 };
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 # include "itkGridImageSource.hxx"
160 #endif
161 
162 #endif
itk::GridImageSource::m_GridSpacing
ArrayType m_GridSpacing
Definition: itkGridImageSource.h:148
itk::GridImageSource::m_PixelArrays
PixelArrayContainerType::Pointer m_PixelArrays
Definition: itkGridImageSource.h:142
itk::GenerateImageSource::PixelType
typename OutputImageType::PixelType PixelType
Definition: itkGenerateImageSource.h:54
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::GridImageSource::PixelArrayType
vnl_vector< RealType > PixelArrayType
Definition: itkGridImageSource.h:93
itk::GridImageSource::OriginType
typename TOutputImage::PointType OriginType
Definition: itkGridImageSource.h:85
itk::GenerateImageSource
a Base class for image sources which need to have image size, and other meta-data set.
Definition: itkGenerateImageSource.h:41
itk::GridImageSource
Generate an n-dimensional image of a grid.
Definition: itkGridImageSource.h:58
itk::GridImageSource::m_KernelFunction
KernelFunctionType::Pointer m_KernelFunction
Definition: itkGridImageSource.h:144
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GridImageSource::ImageRegionType
typename TOutputImage::RegionType ImageRegionType
Definition: itkGridImageSource.h:82
itk::KernelFunctionBase< double >
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itkKernelFunctionBase.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GridImageSource::RealType
double RealType
Definition: itkGridImageSource.h:75
itk::GridImageSource::ImageType
TOutputImage ImageType
Definition: itkGridImageSource.h:81
itk::GenerateImageSource::SizeType
typename TOutputImage::SizeType SizeType
Definition: itkGenerateImageSource.h:64
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkFixedArray.h
itk::GridImageSource::m_WhichDimensions
BoolArrayType m_WhichDimensions
Definition: itkGridImageSource.h:152
itk::GridImageSource::m_Sigma
ArrayType m_Sigma
Definition: itkGridImageSource.h:146
itk::GridImageSource::m_GridOffset
ArrayType m_GridOffset
Definition: itkGridImageSource.h:150
itk::FixedArray< RealType, Self::ImageDimension >
itkVectorContainer.h
itkGenerateImageSource.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::GenerateImageSource::SpacingType
typename OutputImageType::SpacingType SpacingType
Definition: itkGenerateImageSource.h:56
itk::GenerateImageSource::DirectionType
typename OutputImageType::DirectionType DirectionType
Definition: itkGenerateImageSource.h:58
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48