ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkGenerateImageSource.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 
19 #ifndef __itkGenerateImageSource_h
20 #define __itkGenerateImageSource_h
21 
22 #include "itkImageSource.h"
23 
24 namespace itk
25 {
26 
39 template< typename TOutputImage >
41  : public ImageSource< TOutputImage >
42 {
43 public:
48 
50  typedef TOutputImage OutputImageType;
51  typedef typename OutputImageType::PixelType PixelType;
52  typedef typename OutputImageType::RegionType RegionType;
53  typedef typename OutputImageType::SpacingType SpacingType;
54  typedef typename OutputImageType::PointType PointType;
55  typedef typename OutputImageType::DirectionType DirectionType;
56 
57 
58  typedef typename TOutputImage::SizeType SizeType;
60 
62  itkStaticConstMacro(NDimensions, unsigned int, TOutputImage::ImageDimension);
63 
65  itkTypeMacro(GeneratemageSource, ImageSource);
66 
70  itkSetMacro(Size, SizeType);
71  itkGetConstReferenceMacro(Size, SizeType);
72  itkSetVectorMacro(Size, SizeValueType, NDimensions);
74 
78  itkSetMacro(Spacing, SpacingType);
79  itkGetConstReferenceMacro(Spacing, SpacingType);
80  itkSetVectorMacro(Spacing, const float, NDimensions);
82 
83 
87  itkSetMacro(Origin, PointType);
88  itkGetConstReferenceMacro(Origin, PointType);
89  itkSetVectorMacro(Origin, const float, NDimensions);
91 
96  itkSetMacro(Direction, DirectionType);
97  itkGetConstReferenceMacro(Direction, DirectionType);
99 
100 protected:
102  // virtual ~GenerateImageSource() default implementation ok
103  void PrintSelf(std::ostream & os, Indent indent) const;
104 
105  virtual void GenerateOutputInformation();
106 
107 private:
108  GenerateImageSource( const GenerateImageSource &); //purposely not implemented
109  void operator=( const GenerateImageSource &); //purposely not implemented
110 
111  SizeType m_Size; //size of the output image
113  PointType m_Origin; //origin
115 
116 };
117 
118 }
119 
120 
121 #ifndef ITK_MANUAL_INSTANTIATION
122 #include "itkGenerateImageSource.hxx"
123 #endif
124 
125 
126 #endif //__itkGenerateImageSource_h
127