ITK  4.13.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:
66 
68  itkTypeMacro(GridImageSource, GenerateImageSource);
69 
71  itkNewMacro(Self);
72 
73  typedef double RealType;
74 
76  itkStaticConstMacro(ImageDimension, unsigned int,
77  TOutputImage::ImageDimension);
78 
80  typedef TOutputImage ImageType;
81  typedef typename TOutputImage::RegionType ImageRegionType;
82  typedef typename TOutputImage::PixelType PixelType;
83  typedef typename TOutputImage::SpacingType SpacingType;
86  typedef typename TOutputImage::SizeType SizeType;
87 
94  typedef vnl_vector< RealType > PixelArrayType;
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(){} default implementation ok
132  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
133 
134  virtual void
135  ThreadedGenerateData(const ImageRegionType &
136  outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
137 
138  virtual void BeforeThreadedGenerateData() ITK_OVERRIDE;
139 
140 private:
141  ITK_DISALLOW_COPY_AND_ASSIGN(GridImageSource);
142 
144  typename PixelArrayContainerType::Pointer m_PixelArrays;
145 
146  typename KernelFunctionType::Pointer m_KernelFunction;
147 
148  ArrayType m_Sigma;
149 
150  ArrayType m_GridSpacing;
151 
152  ArrayType m_GridOffset;
153 
154  BoolArrayType m_WhichDimensions;
155 
156  RealType m_Scale;
157 };
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkGridImageSource.hxx"
162 #endif
163 
164 #endif
TOutputImage::RegionType ImageRegionType
TOutputImage::SpacingType SpacingType
Base class for all process objects that output image data.
FixedArray< bool, itkGetStaticConstMacro(ImageDimension) > BoolArrayType
SmartPointer< Self > Pointer
KernelFunction is for backward compatibility with ITKv3.
a Base class for image sources which need to have image size, and other meta-data set...
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
GenerateImageSource< TOutputImage > Superclass
TOutputImage::PointType OriginType
FixedArray< RealType, itkGetStaticConstMacro(ImageDimension) > ArrayType
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< const Self > ConstPointer
TOutputImage::SizeType SizeType
KernelFunctionBase< double > KernelFunctionType
TOutputImage::DirectionType DirectionType
Generate an n-dimensional image of a grid.
vnl_vector< RealType > PixelArrayType
VectorContainer< SizeValueType, PixelArrayType > PixelArrayContainerType
TOutputImage::PixelType PixelType