ITK  4.2.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_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;
84  typedef typename TOutputImage::PointType OriginType;
85  typedef typename TOutputImage::DirectionType DirectionType;
86  typedef typename TOutputImage::SizeType SizeType;
87 
97 
99  itkSetObjectMacro(KernelFunction, KernelFunctionType);
100  itkGetConstReferenceObjectMacro(KernelFunction, KernelFunctionType);
102 
103  itkSetMacro(Sigma, ArrayType);
104  itkGetConstReferenceMacro(Sigma, ArrayType);
105 
106  itkSetMacro(GridSpacing, ArrayType);
107  itkGetConstReferenceMacro(GridSpacing, ArrayType);
108 
109  itkSetMacro(GridOffset, ArrayType);
110  itkGetConstReferenceMacro(GridOffset, ArrayType);
111 
112  itkSetMacro(WhichDimensions, BoolArrayType);
113  itkGetConstReferenceMacro(WhichDimensions, BoolArrayType);
114 
115  itkSetMacro(Scale, RealType);
116  itkGetConstReferenceMacro(Scale, RealType);
117 protected:
118  GridImageSource();
119  // ~GridImageSource(){} default implementation ok
120  void PrintSelf(std::ostream & os, Indent indent) const;
121 
122  virtual void
123  ThreadedGenerateData(const ImageRegionType &
124  outputRegionForThread, ThreadIdType threadId);
125 
126  virtual void BeforeThreadedGenerateData();
127 
128 private:
129  GridImageSource(const GridImageSource &); //purposely not implemented
130  void operator=(const GridImageSource &); //purposely not implemented
131 
136 
139 
143 
146 
149 
152 
155 };
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkGridImageSource.hxx"
160 #endif
161 
162 #endif
163