ITK  6.0.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 * 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 itkGridImageSource_h
19#define itkGridImageSource_h
20
22#include "itkFixedArray.h"
24#include "itkVectorContainer.h"
25
26#include "vnl/vnl_vector.h"
27
28namespace itk
29{
57template <typename TOutputImage>
58class ITK_TEMPLATE_EXPORT GridImageSource : public GenerateImageSource<TOutputImage>
59{
60public:
61 ITK_DISALLOW_COPY_AND_MOVE(GridImageSource);
62
68
70 itkOverrideGetNameOfClassMacro(GridImageSource);
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;
88
93 using PixelArrayType = vnl_vector<RealType>;
95
97 itkSetObjectMacro(KernelFunction, KernelFunctionType);
98 itkGetConstReferenceObjectMacro(KernelFunction, KernelFunctionType);
103 itkSetMacro(Sigma, ArrayType);
104 itkGetConstReferenceMacro(Sigma, ArrayType);
108 itkSetMacro(GridSpacing, ArrayType);
109 itkGetConstReferenceMacro(GridSpacing, ArrayType);
113 itkSetMacro(GridOffset, ArrayType);
114 itkGetConstReferenceMacro(GridOffset, ArrayType);
118 itkSetMacro(WhichDimensions, BoolArrayType);
119 itkGetConstReferenceMacro(WhichDimensions, BoolArrayType);
123 itkSetMacro(Scale, RealType);
124 itkGetConstReferenceMacro(Scale, RealType);
127protected:
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
139
140private:
142 typename PixelArrayContainerType::Pointer m_PixelArrays{};
143
144 typename KernelFunctionType::Pointer m_KernelFunction{};
145
146 ArrayType m_Sigma{};
147
148 ArrayType m_GridSpacing{};
149
150 ArrayType m_GridOffset{};
151
152 BoolArrayType m_WhichDimensions{};
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
a Base class for image sources which need to have image size, and other meta-data set.
typename TOutputImage::SizeType SizeType
typename OutputImageType::PixelType PixelType
typename OutputImageType::DirectionType DirectionType
typename OutputImageType::SpacingType SpacingType
Generate an n-dimensional image of a grid.
void BeforeThreadedGenerateData() override
typename TOutputImage::PointType OriginType
void DynamicThreadedGenerateData(const ImageRegionType &outputRegionForThread) override
void PrintSelf(std::ostream &os, Indent indent) const override
~GridImageSource() override=default
typename TOutputImage::RegionType ImageRegionType
vnl_vector< RealType > PixelArrayType
Base class for all process objects that output image data.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....