ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkConstantImageSource.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK 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 * 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 rtkConstantImageSource_h
20#define rtkConstantImageSource_h
21
22#include "rtkConfiguration.h"
23#include "rtkMacro.h"
24
25#include <itkImageSource.h>
26#include <itkNumericTraits.h>
28#include <itkVectorImage.h>
29
30namespace rtk
31{
50template <typename TOutputImage>
51class ITK_TEMPLATE_EXPORT ConstantImageSource : public itk::ImageSource<TOutputImage>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(ConstantImageSource);
55
61
63 using OutputImageType = TOutputImage;
64
66 using OutputImagePixelType = typename TOutputImage::PixelType;
67
69 using OutputImageRegionType = typename TOutputImage::RegionType;
70
72 itkOverrideGetNameOfClassMacro(ConstantImageSource);
73
75 itkNewMacro(Self);
76
78 using SizeType = typename TOutputImage::SizeType;
79 using IndexType = typename TOutputImage::IndexType;
80 using SpacingType = typename TOutputImage::SpacingType;
81 using PointType = typename TOutputImage::PointType;
82 using SizeValueType = typename SizeType::SizeValueType;
83 typedef SizeValueType SizeValueArrayType[TOutputImage::ImageDimension];
84 using SpacingValueType = typename TOutputImage::SpacingValueType;
85 typedef SpacingValueType SpacingValueArrayType[TOutputImage::ImageDimension];
86 using PointValueType = typename TOutputImage::PointValueType;
87 typedef PointValueType PointValueArrayType[TOutputImage::ImageDimension];
88 using DirectionType = typename TOutputImage::DirectionType;
89
92 itkGetMacro(Size, SizeType);
93 virtual void
95 virtual const SizeValueType *
96 GetSize() const;
97
100 itkGetMacro(Spacing, SpacingType);
101
104 itkGetMacro(Origin, PointType);
105
108 itkGetMacro(Direction, DirectionType);
109
112 itkGetMacro(Index, IndexType);
113
116 itkGetConstMacro(Constant, OutputImagePixelType);
117
119 void
121
122protected:
125 void
126 PrintSelf(std::ostream & os, itk::Indent indent) const override;
127
128 void
129 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
130
131 void
133
139
141};
142
143} // end namespace rtk
144
146
147#if defined(RTK_USE_CUDA) && defined(RTK_EXTERN_TEMPLATES)
148ITK_GCC_PRAGMA_DIAG_PUSH()
149ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
150extern template class RTK_EXPORT_EXPLICIT rtk::ConstantImageSource<itk::CudaImage<float, 3>>;
151ITK_GCC_PRAGMA_DIAG_POP()
152#endif
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "rtkConstantImageSource.hxx"
156#endif
157
158#endif
Base class for templated image classes.
Base class for all process objects that output image data.
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
typename SizeType::SizeValueType SizeValueType
~ConstantImageSource() override
typename TWeightsImage::PointType PointType
typename TWeightsImage::RegionType OutputImageRegionType
typename TWeightsImage::SizeType SizeType
typename TWeightsImage::SpacingValueType SpacingValueType
typename TWeightsImage::DirectionType DirectionType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
SpacingValueType SpacingValueArrayType[TWeightsImage::ImageDimension]
void GenerateOutputInformation() override
SizeValueType SizeValueArrayType[TWeightsImage::ImageDimension]
typename TWeightsImage::IndexType IndexType
typename TWeightsImage::PointValueType PointValueType
typename TWeightsImage::PixelType OutputImagePixelType
virtual void SetSize(SizeValueArrayType sizeArray)
itk::ImageSource< TWeightsImage > Superclass
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
virtual const SizeValueType * GetSize() const
void SetInformationFromImage(const itk::ImageBase< TOutputImage::ImageDimension > *image)
typename TWeightsImage::SpacingType SpacingType
itk::SmartPointer< const Self > ConstPointer
PointValueType PointValueArrayType[TWeightsImage::ImageDimension]
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)
Represent a n-dimensional index in a n-dimensional image.
Definition itkIndex.h:69
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition itkSize.h:70