ITK  5.1.0
Insight 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 : public GenerateImageSource<TOutputImage>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_ASSIGN(GridImageSource);
61 
67 
69  itkTypeMacro(GridImageSource, GenerateImageSource);
70 
72  itkNewMacro(Self);
73 
74  using RealType = double;
75 
77  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
78 
80  using ImageType = TOutputImage;
82  using PixelType = typename TOutputImage::PixelType;
83  using SpacingType = typename TOutputImage::SpacingType;
86  using SizeType = typename TOutputImage::SizeType;
87 
92  using PixelArrayType = vnl_vector<RealType>;
94 
96  itkSetObjectMacro(KernelFunction, KernelFunctionType);
97  itkGetConstReferenceObjectMacro(KernelFunction, KernelFunctionType);
99 
102  itkSetMacro(Sigma, ArrayType);
103  itkGetConstReferenceMacro(Sigma, ArrayType);
105 
107  itkSetMacro(GridSpacing, ArrayType);
108  itkGetConstReferenceMacro(GridSpacing, ArrayType);
110 
112  itkSetMacro(GridOffset, ArrayType);
113  itkGetConstReferenceMacro(GridOffset, ArrayType);
115 
117  itkSetMacro(WhichDimensions, BoolArrayType);
118  itkGetConstReferenceMacro(WhichDimensions, BoolArrayType);
120 
122  itkSetMacro(Scale, RealType);
123  itkGetConstReferenceMacro(Scale, RealType);
125 
126 protected:
127  GridImageSource();
128  ~GridImageSource() override = default;
129  void
130  PrintSelf(std::ostream & os, Indent indent) const override;
131 
132  void
133  DynamicThreadedGenerateData(const ImageRegionType & outputRegionForThread) override;
134 
135 
136  void
137  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
itk::GridImageSource::m_GridSpacing
ArrayType m_GridSpacing
Definition: itkGridImageSource.h:147
itk::GridImageSource::m_PixelArrays
PixelArrayContainerType::Pointer m_PixelArrays
Definition: itkGridImageSource.h:141
itk::GenerateImageSource::PixelType
typename OutputImageType::PixelType PixelType
Definition: itkGenerateImageSource.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::GridImageSource::PixelArrayType
vnl_vector< RealType > PixelArrayType
Definition: itkGridImageSource.h:92
itk::GridImageSource::OriginType
typename TOutputImage::PointType OriginType
Definition: itkGridImageSource.h:84
itk::GenerateImageSource
a Base class for image sources which need to have image size, and other meta-data set.
Definition: itkGenerateImageSource.h:40
itk::GridImageSource
Generate an n-dimensional image of a grid.
Definition: itkGridImageSource.h:57
itk::GridImageSource::m_KernelFunction
KernelFunctionType::Pointer m_KernelFunction
Definition: itkGridImageSource.h:143
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GridImageSource::ImageRegionType
typename TOutputImage::RegionType ImageRegionType
Definition: itkGridImageSource.h:81
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:74
itk::GridImageSource::ImageType
TOutputImage ImageType
Definition: itkGridImageSource.h:80
itk::GenerateImageSource::SizeType
typename TOutputImage::SizeType SizeType
Definition: itkGenerateImageSource.h:63
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkFixedArray.h
itk::GridImageSource::m_WhichDimensions
BoolArrayType m_WhichDimensions
Definition: itkGridImageSource.h:151
itk::GridImageSource::m_Sigma
ArrayType m_Sigma
Definition: itkGridImageSource.h:145
itk::GridImageSource::m_GridOffset
ArrayType m_GridOffset
Definition: itkGridImageSource.h:149
itk::FixedArray< RealType, Self::ImageDimension >
itkVectorContainer.h
itkGenerateImageSource.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:135
itk::GenerateImageSource::SpacingType
typename OutputImageType::SpacingType SpacingType
Definition: itkGenerateImageSource.h:55
itk::GenerateImageSource::DirectionType
typename OutputImageType::DirectionType DirectionType
Definition: itkGenerateImageSource.h:57
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48