Loading...
Searching...
No Matches
itkImageRandomSamplerBase.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkImageRandomSamplerBase_h
#define itkImageRandomSamplerBase_h
#include "itkImageSamplerBase.h"
#include <itkMersenneTwisterRandomVariateGenerator.h>
#include <optional>
namespace itk
{
template <class TInputImage>
class ITK_TEMPLATE_EXPORT ImageRandomSamplerBase : public ImageSamplerBase<TInputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomSamplerBase);
using Self = ImageRandomSamplerBase;
using Superclass = ImageSamplerBase<TInputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ImageRandomSamplerBase, ImageSamplerBase);
using typename Superclass::DataObjectPointer;
using typename Superclass::OutputVectorContainerType;
using typename Superclass::OutputVectorContainerPointer;
using typename Superclass::InputImageType;
using typename Superclass::InputImagePointer;
using typename Superclass::InputImageConstPointer;
using typename Superclass::InputImageRegionType;
using typename Superclass::InputImagePixelType;
using typename Superclass::ImageSampleType;
using typename Superclass::ImageSampleContainerType;
using typename Superclass::ImageSampleContainerPointer;
using typename Superclass::MaskType;
using SeedIntegerType = Statistics::MersenneTwisterRandomVariateGenerator::IntegerType;
void
SetOptionalSeed(const std::optional<SeedIntegerType> arg)
{
if (arg != m_OptionalSeed)
{
m_OptionalSeed = arg;
this->Modified();
}
}
void
SetSeed(const SeedIntegerType arg)
{
SetOptionalSeed(std::make_optional(arg));
}
[[nodiscard]] std::optional<SeedIntegerType>
GetOptionalSeed() const
{
return m_OptionalSeed;
}
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
protected:
ImageRandomSamplerBase();
~ImageRandomSamplerBase() override = default;
void
GenerateRandomNumberList();
void
PrintSelf(std::ostream & os, Indent indent) const override;
std::vector<double> m_RandomNumberList{};
private:
std::optional<SeedIntegerType> m_OptionalSeed{};
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkImageRandomSamplerBase.hxx"
#endif
#endif // end #ifndef itkImageRandomSamplerBase_h
itk::ImageRandomSamplerBase::Pointer
SmartPointer< Self > Pointer
Definition itkImageRandomSamplerBase.h:46
itk::ImageRandomSamplerBase::GenerateRandomNumberList
void GenerateRandomNumberList()
itk::ImageRandomSamplerBase::Self
ImageRandomSamplerBase Self
Definition itkImageRandomSamplerBase.h:44
itk::ImageRandomSamplerBase::Superclass
ImageSamplerBase< TInputImage > Superclass
Definition itkImageRandomSamplerBase.h:45
itk::ImageRandomSamplerBase::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::ImageRandomSamplerBase::~ImageRandomSamplerBase
~ImageRandomSamplerBase() override=default
itk::ImageRandomSamplerBase::GetOptionalSeed
std::optional< SeedIntegerType > GetOptionalSeed() const
Definition itkImageRandomSamplerBase.h:92
itk::ImageRandomSamplerBase::SeedIntegerType
Statistics::MersenneTwisterRandomVariateGenerator::IntegerType SeedIntegerType
Definition itkImageRandomSamplerBase.h:69
itk::ImageRandomSamplerBase::itkStaticConstMacro
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
itk::ImageRandomSamplerBase::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkImageRandomSamplerBase.h:47
itk::ImageRandomSamplerBase::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomSamplerBase)
itk::ImageRandomSamplerBase::SetSeed
void SetSeed(const SeedIntegerType arg)
Definition itkImageRandomSamplerBase.h:85
itk::ImageRandomSamplerBase::ImageRandomSamplerBase
ImageRandomSamplerBase()
itk::ImageRandomSamplerBase< FixedImageType >::m_OptionalSeed
std::optional< SeedIntegerType > m_OptionalSeed
Definition itkImageRandomSamplerBase.h:119
itk::ImageRandomSamplerBase< FixedImageType >::m_RandomNumberList
std::vector< double > m_RandomNumberList
Definition itkImageRandomSamplerBase.h:116
itk::ImageRandomSamplerBase::SetOptionalSeed
void SetOptionalSeed(const std::optional< SeedIntegerType > arg)
Definition itkImageRandomSamplerBase.h:74
itk::ImageSamplerBase< FixedImageType >::OutputVectorContainerPointer
typename OutputVectorContainerType::Pointer OutputVectorContainerPointer
itk::ImageSamplerBase< FixedImageType >::OutputVectorContainerType
VectorDataContainer< std::vcl_size_t, ImageSample< FixedImageType > > OutputVectorContainerType
itk::ImageSamplerBase< FixedImageType >::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition itkImageSamplerBase.h:68
itk::ImageSamplerBase< FixedImageType >::ImageSampleType
ImageSample< InputImageType > ImageSampleType
Definition itkImageSamplerBase.h:76
itk::ImageSamplerBase< FixedImageType >::ImageSampleContainerType
VectorDataContainer< std::vcl_size_t, ImageSampleType > ImageSampleContainerType
Definition itkImageSamplerBase.h:77
itk::ImageSamplerBase< FixedImageType >::InputImageType
FixedImageType InputImageType
Definition itkImageSamplerBase.h:66
itk::ImageSamplerBase< FixedImageType >::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition itkImageSamplerBase.h:69
itk::ImageSamplerBase::ImageSamplerBase
ImageSamplerBase()
itk::ImageSamplerBase< FixedImageType >::ImageSampleContainerPointer
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
Definition itkImageSamplerBase.h:78
itk::ImageSamplerBase< FixedImageType >::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition itkImageSamplerBase.h:67
itk::ImageSamplerBase< FixedImageType >::MaskType
ImageMaskSpatialObject< Self::InputImageDimension > MaskType
Definition itkImageSamplerBase.h:84
itk::ImageSamplerBase< FixedImageType >::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition itkImageSamplerBase.h:70
itkImageSamplerBase.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |