ITK  6.0.0
Insight Toolkit
itkGenerateImageSource.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
24namespace itk
25{
26
40template <typename TOutputImage>
41class ITK_TEMPLATE_EXPORT GenerateImageSource : public ImageSource<TOutputImage>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(GenerateImageSource);
45
50
52 using OutputImageType = TOutputImage;
54 using PixelType = typename OutputImageType::PixelType;
56 using SpacingType = typename OutputImageType::SpacingType;
60
63
66
68 static constexpr unsigned int NDimensions = TOutputImage::ImageDimension;
69
71 itkOverrideGetNameOfClassMacro(GenerateImageSource);
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);
88 itkSetMacro(Spacing, SpacingType);
89 itkGetConstReferenceMacro(Spacing, SpacingType);
90 itkSetVectorMacro(Spacing, const float, NDimensions);
97 itkSetMacro(Origin, PointType);
98 itkGetConstReferenceMacro(Origin, PointType);
99 itkSetVectorMacro(Origin, const float, NDimensions);
106 itkSetMacro(Direction, DirectionType);
107 itkGetConstReferenceMacro(Direction, DirectionType);
114 itkSetMacro(StartIndex, IndexType);
115 itkGetConstReferenceMacro(StartIndex, IndexType);
119 void
121
129
132
133protected:
135 ~GenerateImageSource() override = default;
136 void
137 PrintSelf(std::ostream & os, Indent indent) const override;
138
139 void
141
142private:
143 SizeType m_Size{}; // size of the output image
144 SpacingType m_Spacing{};
145 PointType m_Origin{};
146 DirectionType m_Direction{};
147 IndexType m_StartIndex{};
148 bool m_UseReferenceImage{ false };
149};
150
151} // namespace itk
152
153#ifndef ITK_MANUAL_INSTANTIATION
154# include "itkGenerateImageSource.hxx"
155#endif
156
157#endif // itkGenerateImageSource_h
a Base class for image sources which need to have image size, and other meta-data set.
void SetOutputParametersFromImage(const ReferenceImageBaseType *image)
typename TOutputImage::SizeType SizeType
itkSetInputMacro(ReferenceImage, ReferenceImageBaseType)
typename OutputImageType::PointType PointType
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateOutputInformation() override
typename OutputImageType::RegionType RegionType
~GenerateImageSource() override=default
typename OutputImageType::IndexType IndexType
typename OutputImageType::PixelType PixelType
typename TOutputImage::SizeValueType SizeValueType
itkGetInputMacro(ReferenceImage, ReferenceImageBaseType)
typename OutputImageType::DirectionType DirectionType
typename OutputImageType::SpacingType SpacingType
Base class for templated image classes.
Definition: itkImageBase.h:115
Base class for all process objects that output image data.
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:70