ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRandomImageSource.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 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkRandomImageSource_h
29#define itkRandomImageSource_h
30
31#include "itkImageSource.h"
32#include "itkNumericTraits.h"
33
34namespace itk
35{
54template <typename TOutputImage>
55class ITK_TEMPLATE_EXPORT RandomImageSource : public ImageSource<TOutputImage>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(RandomImageSource);
59
65
67 using OutputImagePixelType = typename TOutputImage::PixelType;
68
70 using OutputImageRegionType = typename TOutputImage::RegionType;
71
73 itkOverrideGetNameOfClassMacro(RandomImageSource);
74
76 itkNewMacro(Self);
77
79 using SizeType = typename TOutputImage::SizeType;
80 using IndexType = typename TOutputImage::IndexType;
81 using SpacingType = typename TOutputImage::SpacingType;
82 using DirectionType = typename TOutputImage::DirectionType;
83 using PointType = typename TOutputImage::PointType;
84 using SizeValueType = typename SizeType::SizeValueType;
85 using SizeValueArrayType = SizeValueType[TOutputImage::ImageDimension];
86 using SpacingValueType = typename TOutputImage::SpacingValueType;
87 using SpacingValueArrayType = SpacingValueType[TOutputImage::ImageDimension];
88 using PointValueType = typename TOutputImage::PointValueType;
89 using PointValueArrayType = PointValueType[TOutputImage::ImageDimension];
90
92 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
93
95 itkSetMacro(Size, SizeType);
96 virtual void
99
100 virtual const SizeValueType *
101 GetSize() const;
102
104 itkSetMacro(Spacing, SpacingType);
105 virtual void
108
109 virtual const SpacingValueType *
110 GetSpacing() const;
111
113 itkSetMacro(Origin, PointType);
114 virtual void
117
118 virtual const PointValueType *
119 GetOrigin() const;
120
121 itkSetMacro(Direction, DirectionType);
122 itkGetMacro(Direction, DirectionType);
123
126 itkSetClampMacro(Min,
130
132 itkGetConstMacro(Min, OutputImagePixelType);
133
136 itkSetClampMacro(Max,
140
142 itkGetConstMacro(Max, OutputImagePixelType);
143
144protected:
146 ~RandomImageSource() override = default;
147 void
148 PrintSelf(std::ostream & os, Indent indent) const override;
149
150 void
151 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
152
153 void
155
156private:
157 SizeType m_Size{}; // size of the output image
158 SpacingType m_Spacing{}; // spacing
159 PointType m_Origin{}; // origin
161
162 typename TOutputImage::PixelType m_Min{}; // minimum possible value
163 typename TOutputImage::PixelType m_Max{}; // maximum possible value
164
165 // The following variables are deprecated, and provided here just for
166 // backward compatibility. It use is discouraged.
169};
170} // end namespace itk
171
172#ifndef ITK_MANUAL_INSTANTIATION
173# include "itkRandomImageSource.hxx"
174#endif
175
176#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
TOutputImage::PixelType m_Min
SizeValueType[TOutputImage::ImageDimension] SizeValueArrayType
virtual const SpacingValueType * GetSpacing() const
SmartPointer< const Self > ConstPointer
typename TOutputImage::PointType PointType
SmartPointer< Self > Pointer
typename TOutputImage::PixelType OutputImagePixelType
virtual void SetSpacing(SpacingValueArrayType spacingArray)
typename TOutputImage::RegionType OutputImageRegionType
typename TOutputImage::SpacingValueType SpacingValueType
PointValueArrayType m_OriginArray
TOutputImage::PixelType m_Max
virtual void SetOrigin(PointValueArrayType originArray)
PointValueType[TOutputImage::ImageDimension] PointValueArrayType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename TOutputImage::SpacingType SpacingType
ImageSource< TOutputImage > Superclass
SpacingValueArrayType m_SpacingArray
~RandomImageSource() override=default
void GenerateOutputInformation() override
typename TOutputImage::DirectionType DirectionType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual const PointValueType * GetOrigin() const
typename TOutputImage::SizeType SizeType
virtual const SizeValueType * GetSize() const
typename TOutputImage::IndexType IndexType
SpacingValueType[TOutputImage::ImageDimension] SpacingValueArrayType
virtual void SetSize(SizeValueArrayType sizeArray)
static constexpr unsigned int OutputImageDimension
typename TOutputImage::PointValueType PointValueType
typename SizeType::SizeValueType SizeValueType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition itkSize.h:70