ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGridImageSource.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
56 template< typename TOutputImage >
57 class ITK_TEMPLATE_EXPORT GridImageSource
58  :public GenerateImageSource< TOutputImage >
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_ASSIGN(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 
91  using ArrayType =
93  using BoolArrayType =
95  using PixelArrayType = vnl_vector< RealType >;
97 
99  itkSetObjectMacro(KernelFunction, KernelFunctionType);
100  itkGetConstReferenceObjectMacro(KernelFunction, KernelFunctionType);
102 
105  itkSetMacro(Sigma, ArrayType);
106  itkGetConstReferenceMacro(Sigma, ArrayType);
108 
110  itkSetMacro(GridSpacing, ArrayType);
111  itkGetConstReferenceMacro(GridSpacing, ArrayType);
113 
115  itkSetMacro(GridOffset, ArrayType);
116  itkGetConstReferenceMacro(GridOffset, ArrayType);
118 
120  itkSetMacro(WhichDimensions, BoolArrayType);
121  itkGetConstReferenceMacro(WhichDimensions, BoolArrayType);
123 
125  itkSetMacro(Scale, RealType);
126  itkGetConstReferenceMacro(Scale, RealType);
128 
129 protected:
130  GridImageSource();
131  ~GridImageSource() override = default;
132  void PrintSelf(std::ostream & os, Indent indent) const override;
133 
134  void DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override;
135 
136 
137  void BeforeThreadedGenerateData() override;
138 
139 private:
142 
144 
146 
148 
150 
152 
153  RealType m_Scale{ 255.0 };
154 };
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkGridImageSource.hxx"
159 #endif
160 
161 #endif
KernelFunctionType::Pointer m_KernelFunction
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
vnl_vector< RealType > PixelArrayType
Base class for all process objects that output image data.
typename TOutputImage::PointType OriginType
BoolArrayType m_WhichDimensions
a Base class for image sources which need to have image size, and other meta-data set...
typename TOutputImage::RegionType ImageRegionType
PixelArrayContainerType::Pointer m_PixelArrays
typename OutputImageType::DirectionType DirectionType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
typename OutputImageType::PixelType PixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TOutputImage::SizeType SizeType
typename OutputImageType::SpacingType SpacingType
Generate an n-dimensional image of a grid.