go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkImageRandomSampler.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 itkImageRandomSampler_h
19#define itkImageRandomSampler_h
20
22
23namespace itk
24{
38template <class TInputImage>
39class ITK_TEMPLATE_EXPORT ImageRandomSampler : public ImageRandomSamplerBase<TInputImage>
40{
41public:
43
47 using Pointer = SmartPointer<Self>;
48 using ConstPointer = SmartPointer<const Self>;
49
51 itkNewMacro(Self);
52
55
57 using typename Superclass::DataObjectPointer;
60 using typename Superclass::InputImageType;
61 using typename Superclass::InputImagePointer;
65 using typename Superclass::ImageSampleType;
69 using typename Superclass::MaskType;
70 using typename Superclass::InputImageSizeType;
71
73 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
74
76 using InputImageIndexType = typename InputImageType::IndexType;
77 using InputImagePointType = typename InputImageType::PointType;
78
79protected:
81 ImageRandomSampler() = default;
83 ~ImageRandomSampler() override = default;
84
86 void
87 GenerateData() override;
88
89private:
90 struct UserData
91 {
93
94 const std::vector<double> & m_RandomNumberList;
96 InputImageIndexType m_RegionIndex{};
97 InputImageSizeType m_RegionSize{};
98 std::vector<ImageSampleType> & m_Samples;
99 };
100
101 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
102 ThreaderCallback(void * arg);
103};
104
105} // end namespace itk
106
107#ifndef ITK_MANUAL_INSTANTIATION
108# include "itkImageRandomSampler.hxx"
109#endif
110
111#endif // end #ifndef itkImageRandomSampler_h
This class is a base class for any image sampler that randomly picks samples.
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::RegionType InputImageRegionType
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
typename InputImageType::Pointer InputImagePointer
ImageMaskSpatialObject< Self::InputImageDimension > MaskType
typename InputImageType::PixelType InputImagePixelType
Samples randomly some voxels of an image.
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg)
~ImageRandomSampler() override=default
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
typename InputImageType::PointType InputImagePointType
SmartPointer< const Self > ConstPointer
typename InputImageType::IndexType InputImageIndexType
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomSampler)
void GenerateData() override
A class that defines an image sample, which is the coordinates of a point and its value.
typename InputImageType::SizeType InputImageSizeType
typename ImageSampleType::RealType ImageSampleValueType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
const std::vector< double > & m_RandomNumberList
std::vector< ImageSampleType > & m_Samples


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo