Loading...
Searching...
No Matches
itkImageRandomSamplerSparseMask.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 itkImageRandomSamplerSparseMask_h
#define itkImageRandomSamplerSparseMask_h
#include "itkImageRandomSamplerBase.h"
#include "itkMersenneTwisterRandomVariateGenerator.h"
#include "itkImageFullSampler.h"
namespace itk
{
template <class TInputImage>
class ITK_TEMPLATE_EXPORT ImageRandomSamplerSparseMask : public ImageRandomSamplerBase<TInputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomSamplerSparseMask);
using Self = ImageRandomSamplerSparseMask;
using Superclass = ImageRandomSamplerBase<TInputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ImageRandomSamplerSparseMask, ImageRandomSamplerBase);
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;
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
using InputImageIndexType = typename InputImageType::IndexType;
using InputImagePointType = typename InputImageType::PointType;
using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;
using RandomGeneratorPointer = typename RandomGeneratorType::Pointer;
protected:
using InternalFullSamplerType = itk::ImageFullSampler<InputImageType>;
using InternalFullSamplerPointer = typename InternalFullSamplerType::Pointer;
ImageRandomSamplerSparseMask() = default;
~ImageRandomSamplerSparseMask() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
void
GenerateData() override;
RandomGeneratorPointer m_RandomGenerator{ RandomGeneratorType::GetInstance() };
InternalFullSamplerPointer m_InternalFullSampler{ InternalFullSamplerType::New() };
private:
struct UserData
{
ITK_DISALLOW_COPY_AND_MOVE(UserData);
const std::vector<ImageSampleType> & m_AllValidSamples;
const std::vector<size_t> & m_RandomIndices;
std::vector<ImageSampleType> & m_Samples;
};
std::vector<size_t> m_RandomIndices{};
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
ThreaderCallback(void * arg);
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkImageRandomSamplerSparseMask.hxx"
#endif
#endif // end #ifndef itkImageRandomSamplerSparseMask_h
itk::ImageFullSampler
Samples all voxels in the InputImageRegion.
Definition itkImageFullSampler.h:39
itk::ImageFullSampler< InputImageType >::Pointer
SmartPointer< Self > Pointer
Definition itkImageFullSampler.h:46
itk::ImageFullSampler< InputImageType >::New
static Pointer New()
itk::ImageRandomSamplerBase::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition itkImageSamplerBase.h:68
itk::ImageRandomSamplerBase::ImageSampleType
ImageSample< InputImageType > ImageSampleType
Definition itkImageSamplerBase.h:76
itk::ImageRandomSamplerBase::ImageSampleContainerType
VectorDataContainer< std::vcl_size_t, ImageSampleType > ImageSampleContainerType
Definition itkImageSamplerBase.h:77
itk::ImageRandomSamplerBase::InputImageType
TInputImage InputImageType
Definition itkImageSamplerBase.h:66
itk::ImageRandomSamplerBase::ImageRandomSamplerBase
ImageRandomSamplerBase()
itk::ImageRandomSamplerBase::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition itkImageSamplerBase.h:69
itk::ImageRandomSamplerBase::ImageSampleContainerPointer
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
Definition itkImageSamplerBase.h:78
itk::ImageRandomSamplerBase::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition itkImageSamplerBase.h:67
itk::ImageRandomSamplerBase::MaskType
ImageMaskSpatialObject< Self::InputImageDimension > MaskType
Definition itkImageSamplerBase.h:84
itk::ImageRandomSamplerBase::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition itkImageSamplerBase.h:70
itk::ImageRandomSamplerSparseMask::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkImageRandomSamplerSparseMask.h:47
itk::ImageRandomSamplerSparseMask::RandomGeneratorPointer
typename RandomGeneratorType::Pointer RandomGeneratorPointer
Definition itkImageRandomSamplerSparseMask.h:78
itk::ImageRandomSamplerSparseMask::RandomGeneratorType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
Definition itkImageRandomSamplerSparseMask.h:77
itk::ImageRandomSamplerSparseMask::Self
ImageRandomSamplerSparseMask Self
Definition itkImageRandomSamplerSparseMask.h:44
itk::ImageRandomSamplerSparseMask::InputImagePointType
typename InputImageType::PointType InputImagePointType
Definition itkImageRandomSamplerSparseMask.h:74
itk::ImageRandomSamplerSparseMask::Pointer
SmartPointer< Self > Pointer
Definition itkImageRandomSamplerSparseMask.h:46
itk::ImageRandomSamplerSparseMask< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_InternalFullSampler
InternalFullSamplerPointer m_InternalFullSampler
Definition itkImageRandomSamplerSparseMask.h:98
itk::ImageRandomSamplerSparseMask::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::ImageRandomSamplerSparseMask::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomSamplerSparseMask)
itk::ImageRandomSamplerSparseMask::Superclass
ImageRandomSamplerBase< TInputImage > Superclass
Definition itkImageRandomSamplerSparseMask.h:45
itk::ImageRandomSamplerSparseMask::InternalFullSamplerType
itk::ImageFullSampler< InputImageType > InternalFullSamplerType
Definition itkImageRandomSamplerSparseMask.h:81
itk::ImageRandomSamplerSparseMask< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_RandomIndices
std::vector< vcl_size_t > m_RandomIndices
Definition itkImageRandomSamplerSparseMask.h:110
itk::ImageRandomSamplerSparseMask::~ImageRandomSamplerSparseMask
~ImageRandomSamplerSparseMask() override=default
itk::ImageRandomSamplerSparseMask::GenerateData
void GenerateData() override
itk::ImageRandomSamplerSparseMask::InternalFullSamplerPointer
typename InternalFullSamplerType::Pointer InternalFullSamplerPointer
Definition itkImageRandomSamplerSparseMask.h:82
itk::ImageRandomSamplerSparseMask::InputImageIndexType
typename InputImageType::IndexType InputImageIndexType
Definition itkImageRandomSamplerSparseMask.h:73
itk::ImageRandomSamplerSparseMask::ImageRandomSamplerSparseMask
ImageRandomSamplerSparseMask()=default
itk::ImageRandomSamplerSparseMask< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_RandomGenerator
RandomGeneratorPointer m_RandomGenerator
Definition itkImageRandomSamplerSparseMask.h:97
itk::ImageRandomSamplerSparseMask::itkStaticConstMacro
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
itk::ImageRandomSamplerSparseMask::ThreaderCallback
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg)
itk::VectorContainerSource< VectorDataContainer< std::vcl_size_t, ImageSample< TInputImage > > >::OutputVectorContainerType
VectorDataContainer< std::vcl_size_t, ImageSample< TInputImage > > OutputVectorContainerType
Definition itkVectorContainerSource.h:51
itk::VectorContainerSource< VectorDataContainer< std::vcl_size_t, ImageSample< TInputImage > > >::OutputVectorContainerPointer
typename OutputVectorContainerType::Pointer OutputVectorContainerPointer
Definition itkVectorContainerSource.h:52
itkImageFullSampler.h
itkImageRandomSamplerBase.h
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::ImageRandomSamplerSparseMask::UserData
Definition itkImageRandomSamplerSparseMask.h:102
itk::ImageRandomSamplerSparseMask::UserData::m_AllValidSamples
const std::vector< ImageSampleType > & m_AllValidSamples
Definition itkImageRandomSamplerSparseMask.h:105
itk::ImageRandomSamplerSparseMask::UserData::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(UserData)
itk::ImageRandomSamplerSparseMask::UserData::m_RandomIndices
const std::vector< vcl_size_t > & m_RandomIndices
Definition itkImageRandomSamplerSparseMask.h:106
itk::ImageRandomSamplerSparseMask::UserData::m_Samples
std::vector< ImageSampleType > & m_Samples
Definition itkImageRandomSamplerSparseMask.h:107

Generated on 1768596610 for elastix by 1.15.0 |