ITK  4.8.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  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
104 
105  virtual void GenerateOutputInformation() ITK_OVERRIDE;
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 #ifndef ITK_MANUAL_INSTANTIATION
121 #include "itkGenerateImageSource.hxx"
122 #endif
123 
124 #endif //itkGenerateImageSource_h
OutputImageType::RegionType RegionType
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
TOutputImage::SizeType SizeType
virtual void GenerateOutputInformation() override
OutputImageType::PixelType PixelType
OutputImageType::DirectionType DirectionType
Base class for all process objects that output image data.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
OutputImageType::SpacingType SpacingType
a Base class for image sources which need to have image size, and other meta-data set...
SmartPointer< Self > Pointer
static const unsigned int NDimensions
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ImageSource< TOutputImage > Superclass
SmartPointer< const Self > ConstPointer
TOutputImage::SizeValueType SizeValueType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
OutputImageType::PointType PointType