ITK  5.0.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:
44  ITK_DISALLOW_COPY_AND_ASSIGN(GenerateImageSource);
45 
50 
52  using OutputImageType = TOutputImage;
60 
63 
64  using SizeType = typename TOutputImage::SizeType;
66 
68  static constexpr unsigned int NDimensions = TOutputImage::ImageDimension;
69 
71  itkTypeMacro(GenerateImageSource, ImageSource);
72 
73  itkSetMacro(UseReferenceImage, bool);
74  itkBooleanMacro(UseReferenceImage);
75  itkGetConstMacro(UseReferenceImage, bool);
76 
80  itkSetMacro(Size, SizeType);
81  itkGetConstReferenceMacro(Size, SizeType);
82  itkSetVectorMacro(Size, SizeValueType, NDimensions);
84 
88  itkSetMacro(Spacing, SpacingType);
89  itkGetConstReferenceMacro(Spacing, SpacingType);
90  itkSetVectorMacro(Spacing, const float, NDimensions);
92 
93 
97  itkSetMacro(Origin, PointType);
98  itkGetConstReferenceMacro(Origin, PointType);
99  itkSetVectorMacro(Origin, const float, NDimensions);
101 
106  itkSetMacro(Direction, DirectionType);
107  itkGetConstReferenceMacro(Direction, DirectionType);
109 
114  itkSetMacro(StartIndex, IndexType);
115  itkGetConstReferenceMacro(StartIndex, IndexType);
117 
119  void SetOutputParametersFromImage(const ReferenceImageBaseType *image);
120 
127  itkSetInputMacro(ReferenceImage, ReferenceImageBaseType);
128 
130  itkGetInputMacro(ReferenceImage, ReferenceImageBaseType);
131 
132 protected:
134  ~GenerateImageSource() override = default;
135  void PrintSelf(std::ostream & os, Indent indent) const override;
136 
137  void GenerateOutputInformation() override;
138 
139 private:
140  SizeType m_Size; //size of the output image
145  bool m_UseReferenceImage{ false };
146 
147 };
148 
149 }
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkGenerateImageSource.hxx"
153 #endif
154 
155 #endif //itkGenerateImageSource_h
Light weight base class for most itk classes.
Represent a symmetric tensor of second rank.
unsigned long SizeValueType
Definition: itkIntTypes.h:83
Base class for all process objects that output image data.
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
a Base class for image sources which need to have image size, and other meta-data set...
typename Image< SymmetricSecondRankTensor< TOutputValueType, TTransform::InputSpaceDimension >, TTransform::InputSpaceDimension >::SizeValueType SizeValueType
Base class for templated image classes.
Definition: itkImageBase.h:105
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Image< SymmetricSecondRankTensor< TOutputValueType, TTransform::InputSpaceDimension >, TTransform::InputSpaceDimension >::SizeType SizeType