ITK  4.13.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 >
40 class ITK_TEMPLATE_EXPORT GenerateImageSource
41  : public ImageSource< TOutputImage >
42 {
43 public:
48 
50  typedef TOutputImage OutputImageType;
58 
61 
62  typedef typename TOutputImage::SizeType SizeType;
64 
66  itkStaticConstMacro(NDimensions, unsigned int, TOutputImage::ImageDimension);
67 
69  itkTypeMacro(GenerateImageSource, ImageSource);
70 
71  itkSetMacro(UseReferenceImage, bool);
72  itkBooleanMacro(UseReferenceImage);
73  itkGetConstMacro(UseReferenceImage, bool);
74 
78  itkSetMacro(Size, SizeType);
79  itkGetConstReferenceMacro(Size, SizeType);
80  itkSetVectorMacro(Size, SizeValueType, NDimensions);
82 
86  itkSetMacro(Spacing, SpacingType);
87  itkGetConstReferenceMacro(Spacing, SpacingType);
88  itkSetVectorMacro(Spacing, const float, NDimensions);
90 
91 
95  itkSetMacro(Origin, PointType);
96  itkGetConstReferenceMacro(Origin, PointType);
97  itkSetVectorMacro(Origin, const float, NDimensions);
99 
104  itkSetMacro(Direction, DirectionType);
105  itkGetConstReferenceMacro(Direction, DirectionType);
107 
112  itkSetMacro(StartIndex, IndexType);
113  itkGetConstReferenceMacro(StartIndex, IndexType);
115 
117  void SetOutputParametersFromImage(const ReferenceImageBaseType *image);
118 
125  itkSetInputMacro(ReferenceImage, ReferenceImageBaseType);
126 
128  itkGetInputMacro(ReferenceImage, ReferenceImageBaseType);
129 
130 protected:
132  // virtual ~GenerateImageSource() default implementation ok
133  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
134 
135  virtual void GenerateOutputInformation() ITK_OVERRIDE;
136 
137 private:
138  ITK_DISALLOW_COPY_AND_ASSIGN(GenerateImageSource);
139 
140  SizeType m_Size; //size of the output image
141  SpacingType m_Spacing;
142  PointType m_Origin;
143  DirectionType m_Direction;
144  IndexType m_StartIndex;
145  bool m_UseReferenceImage;
146 
147 };
148 
149 }
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkGenerateImageSource.hxx"
153 #endif
154 
155 #endif //itkGenerateImageSource_h
OutputImageType::RegionType RegionType
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
Represent a symmetric tensor of second rank.
TOutputImage::SizeType SizeType
OutputImageType::PixelType PixelType
OutputImageType::DirectionType DirectionType
Base class for all process objects that output image data.
OutputImageType::Pointer OutputImagePointer
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
Base class for templated image classes.
Definition: itkImageBase.h:114
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ImageSource< TOutputImage > Superclass
SmartPointer< const Self > ConstPointer
TOutputImage::SizeValueType SizeValueType
ImageBase< TOutputImage::ImageDimension > ReferenceImageBaseType
OutputImageType::IndexType IndexType
OutputImageType::PointType PointType