go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiInputImageRandomCoordinateSampler.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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#ifndef itkMultiInputImageRandomCoordinateSampler_h
19#define itkMultiInputImageRandomCoordinateSampler_h
20
22#include "itkInterpolateImageFunction.h"
23#include "itkBSplineInterpolateImageFunction.h"
24#include "itkMersenneTwisterRandomVariateGenerator.h"
25
26namespace itk
27{
28
38
39template <typename TInputImage>
40class ITK_TEMPLATE_EXPORT MultiInputImageRandomCoordinateSampler : public ImageRandomSamplerBase<TInputImage>
41{
42public:
44
48 using Pointer = SmartPointer<Self>;
49 using ConstPointer = SmartPointer<const Self>;
50
52 itkNewMacro(Self);
53
56
58 using typename Superclass::DataObjectPointer;
61 using typename Superclass::InputImageType;
62 using typename Superclass::InputImagePointer;
66 using typename Superclass::ImageSampleType;
68 using typename Superclass::MaskType;
69 using typename Superclass::InputImageSizeType;
70 using InputImageSpacingType = typename InputImageType::SpacingType;
75
77 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
78
83 using InterpolatorType = InterpolateImageFunction<InputImageType, CoordinateType>;
84 using InterpolatorPointer = typename InterpolatorType::Pointer;
85 using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordinateType, double>;
86
88 using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;
89 using RandomGeneratorPointer = typename RandomGeneratorType::Pointer;
90
92 itkSetObjectMacro(Interpolator, InterpolatorType);
94
98 itkSetMacro(SampleRegionSize, InputImageSpacingType);
99 itkGetConstReferenceMacro(SampleRegionSize, InputImageSpacingType);
100
103 itkGetConstMacro(UseRandomSampleRegion, bool);
104 itkSetMacro(UseRandomSampleRegion, bool);
105
106protected:
107 using InputImageContinuousIndexType = typename InterpolatorType::ContinuousIndexType;
108
111
114
116 void
117 PrintSelf(std::ostream & os, Indent indent) const override;
118
120 void
121 GenerateData() override;
122
125 virtual void
127 const InputImageContinuousIndexType & largestContIndex,
128 InputImageContinuousIndexType & randomContIndex);
129
131 const auto interpolator = DefaultInterpolatorType::New();
132 interpolator->SetSplineOrder(3);
133 return interpolator;
134 }();
135
136 InputImageSpacingType m_SampleRegionSize{ itk::MakeFilled<InputImageSpacingType>(1.0) };
137
139 virtual void
141 InputImageContinuousIndexType & largestContIndex);
142
143private:
145};
146
147} // end namespace itk
148
149#ifndef ITK_MANUAL_INSTANTIATION
150# include "itkMultiInputImageRandomCoordinateSampler.hxx"
151#endif
152
153#endif // end #ifndef itkMultiInputImageRandomCoordinateSampler_h
VectorDataContainer< ImageSampleType > ImageSampleContainerType
typename InputImageType::ConstPointer InputImageConstPointer
ImageSample< InputImageType > ImageSampleType
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::Pointer InputImagePointer
ImageMaskSpatialObject< Self::InputImageDimension > MaskType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::PointType InputImagePointType
typename InputImageType::SizeType InputImageSizeType
typename InputImagePointType::ValueType InputImagePointValueType
typename ImageSampleType::RealType ImageSampleValueType
typename InputImageType::IndexType InputImageIndexType
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
ITK_DISALLOW_COPY_AND_MOVE(MultiInputImageRandomCoordinateSampler)
virtual void GenerateSampleRegion(InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType
itkGetModifiableObjectMacro(Interpolator, InterpolatorType)
~MultiInputImageRandomCoordinateSampler() override=default
InterpolateImageFunction< InputImageType, CoordinateType > InterpolatorType
void PrintSelf(std::ostream &os, Indent indent) const override
BSplineInterpolateImageFunction< InputImageType, CoordinateType, double > DefaultInterpolatorType
itkOverrideGetNameOfClassMacro(MultiInputImageRandomCoordinateSampler)


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo