Loading...
Searching...
No Matches
itkMultiInputImageRandomCoordinateSampler.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 itkMultiInputImageRandomCoordinateSampler_h
#define itkMultiInputImageRandomCoordinateSampler_h
#include "itkImageRandomSamplerBase.h"
#include "itkInterpolateImageFunction.h"
#include "itkBSplineInterpolateImageFunction.h"
#include "itkMersenneTwisterRandomVariateGenerator.h"
namespace itk
{
template <class TInputImage>
class ITK_TEMPLATE_EXPORT MultiInputImageRandomCoordinateSampler : public ImageRandomSamplerBase<TInputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(MultiInputImageRandomCoordinateSampler);
using Self = MultiInputImageRandomCoordinateSampler;
using Superclass = ImageRandomSamplerBase<TInputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(MultiInputImageRandomCoordinateSampler, 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::MaskType;
using typename Superclass::InputImageSizeType;
using InputImageSpacingType = typename InputImageType::SpacingType;
using typename Superclass::InputImageIndexType;
using typename Superclass::InputImagePointType;
using typename Superclass::InputImagePointValueType;
using typename Superclass::ImageSampleValueType;
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
using CoordRepType = double;
using InterpolatorType = InterpolateImageFunction<InputImageType, CoordRepType>;
using InterpolatorPointer = typename InterpolatorType::Pointer;
using DefaultInterpolatorType = BSplineInterpolateImageFunction<InputImageType, CoordRepType, double>;
using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator;
using RandomGeneratorPointer = typename RandomGeneratorType::Pointer;
itkSetObjectMacro(Interpolator, InterpolatorType);
itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
itkSetMacro(SampleRegionSize, InputImageSpacingType);
itkGetConstReferenceMacro(SampleRegionSize, InputImageSpacingType);
itkGetConstMacro(UseRandomSampleRegion, bool);
itkSetMacro(UseRandomSampleRegion, bool);
protected:
using InputImageContinuousIndexType = typename InterpolatorType::ContinuousIndexType;
MultiInputImageRandomCoordinateSampler() = default;
~MultiInputImageRandomCoordinateSampler() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
void
GenerateData() override;
virtual void
GenerateRandomCoordinate(const InputImageContinuousIndexType & smallestContIndex,
const InputImageContinuousIndexType & largestContIndex,
InputImageContinuousIndexType & randomContIndex);
InterpolatorPointer m_Interpolator = [] {
const auto interpolator = DefaultInterpolatorType::New();
interpolator->SetSplineOrder(3);
return interpolator;
}();
RandomGeneratorPointer m_RandomGenerator{ RandomGeneratorType::GetInstance() };
InputImageSpacingType m_SampleRegionSize{ itk::MakeFilled<InputImageSpacingType>(1.0) };
virtual void
GenerateSampleRegion(InputImageContinuousIndexType & smallestContIndex,
InputImageContinuousIndexType & largestContIndex);
private:
bool m_UseRandomSampleRegion{ false };
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkMultiInputImageRandomCoordinateSampler.hxx"
#endif
#endif // end #ifndef itkMultiInputImageRandomCoordinateSampler_h
double
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::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::ImageSamplerBase::InputImagePointType
typename InputImageType::PointType InputImagePointType
Definition itkImageSamplerBase.h:81
itk::ImageSamplerBase::InputImageSizeType
typename InputImageType::SizeType InputImageSizeType
Definition itkImageSamplerBase.h:79
itk::ImageSamplerBase::InputImagePointValueType
typename InputImagePointType::ValueType InputImagePointValueType
Definition itkImageSamplerBase.h:82
itk::ImageSamplerBase::ImageSampleValueType
typename ImageSampleType::RealType ImageSampleValueType
Definition itkImageSamplerBase.h:83
itk::ImageSamplerBase::InputImageIndexType
typename InputImageType::IndexType InputImageIndexType
Definition itkImageSamplerBase.h:80
itk::MultiInputImageRandomCoordinateSampler::Pointer
SmartPointer< Self > Pointer
Definition itkMultiInputImageRandomCoordinateSampler.h:48
itk::MultiInputImageRandomCoordinateSampler::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition itkMultiInputImageRandomCoordinateSampler.h:84
itk::MultiInputImageRandomCoordinateSampler::GenerateRandomCoordinate
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
itk::MultiInputImageRandomCoordinateSampler::RandomGeneratorType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
Definition itkMultiInputImageRandomCoordinateSampler.h:88
itk::MultiInputImageRandomCoordinateSampler::itkStaticConstMacro
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
itk::MultiInputImageRandomCoordinateSampler< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_RandomGenerator
RandomGeneratorPointer m_RandomGenerator
Definition itkMultiInputImageRandomCoordinateSampler.h:136
itk::MultiInputImageRandomCoordinateSampler< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_SampleRegionSize
InputImageSpacingType m_SampleRegionSize
Definition itkMultiInputImageRandomCoordinateSampler.h:137
itk::MultiInputImageRandomCoordinateSampler< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_Interpolator
InterpolatorPointer m_Interpolator
Definition itkMultiInputImageRandomCoordinateSampler.h:130
itk::MultiInputImageRandomCoordinateSampler::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(MultiInputImageRandomCoordinateSampler)
itk::MultiInputImageRandomCoordinateSampler::MultiInputImageRandomCoordinateSampler
MultiInputImageRandomCoordinateSampler()=default
itk::MultiInputImageRandomCoordinateSampler::CoordRepType
double CoordRepType
Definition itkMultiInputImageRandomCoordinateSampler.h:82
itk::MultiInputImageRandomCoordinateSampler::Self
MultiInputImageRandomCoordinateSampler Self
Definition itkMultiInputImageRandomCoordinateSampler.h:46
itk::MultiInputImageRandomCoordinateSampler::GenerateSampleRegion
virtual void GenerateSampleRegion(InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
itk::MultiInputImageRandomCoordinateSampler::Superclass
ImageRandomSamplerBase< TInputImage > Superclass
Definition itkMultiInputImageRandomCoordinateSampler.h:47
itk::MultiInputImageRandomCoordinateSampler::InputImageContinuousIndexType
typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType
Definition itkMultiInputImageRandomCoordinateSampler.h:107
itk::MultiInputImageRandomCoordinateSampler::DefaultInterpolatorType
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
Definition itkMultiInputImageRandomCoordinateSampler.h:85
itk::MultiInputImageRandomCoordinateSampler::itkGetModifiableObjectMacro
itkGetModifiableObjectMacro(Interpolator, InterpolatorType)
itk::MultiInputImageRandomCoordinateSampler::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkMultiInputImageRandomCoordinateSampler.h:49
itk::MultiInputImageRandomCoordinateSampler::~MultiInputImageRandomCoordinateSampler
~MultiInputImageRandomCoordinateSampler() override=default
itk::MultiInputImageRandomCoordinateSampler::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::MultiInputImageRandomCoordinateSampler::InputImageSpacingType
typename InputImageType::SpacingType InputImageSpacingType
Definition itkMultiInputImageRandomCoordinateSampler.h:70
itk::MultiInputImageRandomCoordinateSampler::GenerateData
void GenerateData() override
itk::MultiInputImageRandomCoordinateSampler::RandomGeneratorPointer
typename RandomGeneratorType::Pointer RandomGeneratorPointer
Definition itkMultiInputImageRandomCoordinateSampler.h:89
itk::MultiInputImageRandomCoordinateSampler< typename elx::ImageSamplerBase< TElastix >::InputImageType >::m_UseRandomSampleRegion
bool m_UseRandomSampleRegion
Definition itkMultiInputImageRandomCoordinateSampler.h:145
itk::MultiInputImageRandomCoordinateSampler::InterpolatorType
InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType
Definition itkMultiInputImageRandomCoordinateSampler.h:83
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
itkImageRandomSamplerBase.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |