Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <elxRandomCoordinateSampler.h>
An interpolator based on the itk::ImageRandomCoordinateSampler.
This image sampler randomly samples 'NumberOfSamples' coordinates in the InputImageRegion. If a mask is given, the sampler tries to find samples within the mask. If the mask is very sparse, this may take some time. The RandomCoordinate sampler samples not only positions that correspond to voxels, but also positions between voxels. An interpolator for the fixed image is thus required. A B-spline interpolator is used, the order of which can be specified by the user. Typically, the RandomCoordinate gives a smoother cost function, because the so-called 'grid-effect' is avoided.
This sampler is suitable to used in combination with the NewSamplesEveryIteration parameter (defined in the elx::OptimizerBase).
The parameters used in this class are:
ImageSampler: Select this image sampler as follows:
(ImageSampler "RandomCoordinate")
NumberOfSpatialSamples: The number of image voxels used for computing the metric value and its derivative in each iteration. Must be given for each resolution.
example: (NumberOfSpatialSamples 2048 2048 4000)
The default is 5000.
UseRandomSampleRegion: Defines whether to randomly select a subregion of the image in each iteration. When set to "true", also specify the SampleRegionSize. By setting this option to "true", in combination with the NewSamplesEveryIteration parameter, a "localised" similarity measure is obtained. This can give better performance in case of the presence of large inhomogeneities in the image, for example.
example: (UseRandomSampleRegion "true")
Default: false.
SampleRegionSize: the size of the subregions that are selected when using the UseRandomSampleRegion option. The size should be specified in mm, for each dimension. As a rule of thumb, you may try a value ~1/3 of the image size.
example: (SampleRegionSize 50.0 50.0 50.0)
You can also specify one number, which will be used for all dimensions. Also, you can specify different values for each resolution:
example: (SampleRegionSize 50.0 50.0 50.0 30.0 30.0 30.0)
In this example, in the first resolution 50mm is used for each of the 3 dimensions, and in the second resolution 30mm.
Default: sampleRegionSize[i] = min ( fixedImageSize[i], max_i ( fixedImageSize[i]/3 ) ), with fixedImageSize in mm. So, approximately 1/3 of the fixed image size.
FixedImageBSplineInterpolationOrder: When using a RandomCoordinate sampler, the fixed image needs to be interpolated. This is done using a B-spline interpolator. With this option you can specify the order of interpolation.
example: (FixedImageBSplineInterpolationOrder 0 0 1)
Default value: 1. The parameter can be specified for each resolution.
Definition at line 78 of file elxRandomCoordinateSampler.h.
Public Member Functions | |
void | BeforeEachResolution (void) override |
elxClassNameMacro ("RandomCoordinate") | |
virtual const char * | GetClassName () const |
itkStaticConstMacro (InputImageDimension, unsigned int, Superclass1::InputImageDimension) | |
Public Member Functions inherited from itk::ImageRandomCoordinateSampler< elx::ImageSamplerBase< TElastix >::InputImageType > | |
virtual const char * | GetClassName () const |
virtual const InputImageSpacingType & | GetSampleRegionSize () |
virtual bool | GetUseRandomSampleRegion () const |
itkGetModifiableObjectMacro (Interpolator, InterpolatorType) | |
itkStaticConstMacro (InputImageDimension, unsigned int, Superclass::InputImageDimension) | |
virtual void | SetInterpolator (InterpolatorType *_arg) |
virtual void | SetSampleRegionSize (InputImageSpacingType _arg) |
virtual void | SetUseRandomSampleRegion (bool _arg) |
Public Member Functions inherited from itk::ImageRandomSamplerBase< elx::ImageSamplerBase< TElastix >::InputImageType > | |
virtual const char * | GetClassName () const |
itkStaticConstMacro (InputImageDimension, unsigned int, Superclass::InputImageDimension) | |
Public Member Functions inherited from itk::ImageSamplerBase< elx::ImageSamplerBase< TElastix >::InputImageType > | |
virtual const char * | GetClassName () const |
virtual const InputImageRegionType & | GetCroppedInputImageRegion () |
virtual const InputImageRegionType & | GetInputImageRegion (unsigned int pos) const |
virtual const InputImageRegionType & | GetInputImageRegion (void) const |
virtual const MaskType * | GetMask (unsigned int pos) const |
virtual const MaskType * | GetMask (void) const |
virtual unsigned int | GetNumberOfInputImageRegions () const |
virtual unsigned int | GetNumberOfMasks () const |
virtual unsigned long | GetNumberOfSamples () const |
itkStaticConstMacro (InputImageDimension, unsigned int, InputImageType::ImageDimension) | |
virtual bool | SelectingNewSamplesOnUpdateSupported (void) const |
virtual bool | SelectNewSamplesOnUpdate (void) |
virtual void | SetInputImageRegion (const InputImageRegionType _arg) |
virtual void | SetInputImageRegion (const InputImageRegionType _arg, unsigned int pos) |
virtual void | SetMask (const MaskType *_arg) |
virtual void | SetMask (const MaskType *_arg, unsigned int pos) |
virtual void | SetNumberOfInputImageRegions (const unsigned int _arg) |
virtual void | SetNumberOfMasks (const unsigned int _arg) |
virtual void | SetNumberOfSamples (unsigned long _arg) |
virtual void | SetUseMultiThread (bool _arg) |
Public Member Functions inherited from itk::ImageToVectorContainerFilter< elx::ImageSamplerBase< TElastix >::InputImageType, VectorDataContainer< std::vcl_size_t, ImageSample< elx::ImageSamplerBase< TElastix >::InputImageType > > > | |
virtual void | AfterThreadedGenerateData (void) |
virtual void | BeforeThreadedGenerateData (void) |
void | GenerateData (void) override |
virtual const char * | GetClassName () const |
const InputImageType * | GetInput (unsigned int idx) |
const InputImageType * | GetInput (void) |
OutputVectorContainerType * | GetOutput (void) |
DataObject::Pointer | MakeOutput (unsigned int idx) override |
void | SetInput (const InputImageType *input) |
void | SetInput (unsigned int idx, const InputImageType *input) |
virtual unsigned int | SplitRequestedRegion (const ThreadIdType &threadId, const ThreadIdType &numberOfSplits, InputImageRegionType &splitRegion) |
virtual void | ThreadedGenerateData (const InputImageRegionType &inputRegionForThread, ThreadIdType threadId) |
Public Member Functions inherited from itk::VectorContainerSource< VectorDataContainer< std::vcl_size_t, ImageSample< elx::ImageSamplerBase< TElastix >::InputImageType > > > | |
virtual const char * | GetClassName () const |
OutputVectorContainerType * | GetOutput (unsigned int idx) |
OutputVectorContainerType * | GetOutput (void) |
virtual void | GraftNthOutput (unsigned int idx, DataObject *output) |
virtual void | GraftOutput (DataObject *output) |
virtual DataObjectPointer | MakeOutput (unsigned int idx) |
Public Member Functions inherited from itk::ImageSamplerBase< TElastix > | |
virtual const char * | GetClassName () const |
virtual const InputImageRegionType & | GetCroppedInputImageRegion () |
virtual const InputImageRegionType & | GetInputImageRegion (unsigned int pos) const |
virtual const InputImageRegionType & | GetInputImageRegion (void) const |
virtual const MaskType * | GetMask (unsigned int pos) const |
virtual const MaskType * | GetMask (void) const |
virtual unsigned int | GetNumberOfInputImageRegions () const |
virtual unsigned int | GetNumberOfMasks () const |
virtual unsigned long | GetNumberOfSamples () const |
itkStaticConstMacro (InputImageDimension, unsigned int, InputImageType::ImageDimension) | |
virtual bool | SelectingNewSamplesOnUpdateSupported (void) const |
virtual bool | SelectNewSamplesOnUpdate (void) |
virtual void | SetInputImageRegion (const InputImageRegionType _arg) |
virtual void | SetInputImageRegion (const InputImageRegionType _arg, unsigned int pos) |
virtual void | SetMask (const MaskType *_arg) |
virtual void | SetMask (const MaskType *_arg, unsigned int pos) |
virtual void | SetNumberOfInputImageRegions (const unsigned int _arg) |
virtual void | SetNumberOfMasks (const unsigned int _arg) |
virtual void | SetNumberOfSamples (unsigned long _arg) |
virtual void | SetUseMultiThread (bool _arg) |
Public Member Functions inherited from itk::ImageToVectorContainerFilter< TElastix, VectorDataContainer< std::vcl_size_t, ImageSample< TElastix > > > | |
virtual void | AfterThreadedGenerateData (void) |
virtual void | BeforeThreadedGenerateData (void) |
void | GenerateData (void) override |
virtual const char * | GetClassName () const |
const InputImageType * | GetInput (unsigned int idx) |
const InputImageType * | GetInput (void) |
OutputVectorContainerType * | GetOutput (void) |
DataObject::Pointer | MakeOutput (unsigned int idx) override |
void | SetInput (const InputImageType *input) |
void | SetInput (unsigned int idx, const InputImageType *input) |
virtual unsigned int | SplitRequestedRegion (const ThreadIdType &threadId, const ThreadIdType &numberOfSplits, InputImageRegionType &splitRegion) |
virtual void | ThreadedGenerateData (const InputImageRegionType &inputRegionForThread, ThreadIdType threadId) |
Public Member Functions inherited from itk::VectorContainerSource< VectorDataContainer< std::vcl_size_t, ImageSample< TElastix > > > | |
virtual const char * | GetClassName () const |
OutputVectorContainerType * | GetOutput (unsigned int idx) |
OutputVectorContainerType * | GetOutput (void) |
virtual void | GraftNthOutput (unsigned int idx, DataObject *output) |
virtual void | GraftOutput (DataObject *output) |
virtual DataObjectPointer | MakeOutput (unsigned int idx) |
Private Member Functions | |
void | operator= (const Self &) |
RandomCoordinateSampler (const Self &) | |
typedef Superclass2::ConfigurationPointer elastix::RandomCoordinateSampler< TElastix >::ConfigurationPointer |
Definition at line 140 of file elxRandomCoordinateSampler.h.
typedef Superclass2::ConfigurationType elastix::RandomCoordinateSampler< TElastix >::ConfigurationType |
Definition at line 139 of file elxRandomCoordinateSampler.h.
typedef itk::SmartPointer< const Self > elastix::RandomCoordinateSampler< TElastix >::ConstPointer |
Definition at line 94 of file elxRandomCoordinateSampler.h.
typedef Superclass1::CoordRepType elastix::RandomCoordinateSampler< TElastix >::CoordRepType |
This image sampler samples the image on physical coordinates and thus needs an interpolator.
Definition at line 129 of file elxRandomCoordinateSampler.h.
typedef Superclass1::DataObjectPointer elastix::RandomCoordinateSampler< TElastix >::DataObjectPointer |
Typedefs inherited from the superclass.
Definition at line 109 of file elxRandomCoordinateSampler.h.
typedef Superclass1::DefaultInterpolatorType elastix::RandomCoordinateSampler< TElastix >::DefaultInterpolatorType |
Definition at line 131 of file elxRandomCoordinateSampler.h.
typedef Superclass2::ElastixPointer elastix::RandomCoordinateSampler< TElastix >::ElastixPointer |
Definition at line 138 of file elxRandomCoordinateSampler.h.
typedef Superclass2::ElastixType elastix::RandomCoordinateSampler< TElastix >::ElastixType |
Typedefs inherited from Elastix.
Definition at line 137 of file elxRandomCoordinateSampler.h.
typedef Superclass1::ImageSampleContainerType elastix::RandomCoordinateSampler< TElastix >::ImageSampleContainerType |
Definition at line 118 of file elxRandomCoordinateSampler.h.
typedef Superclass1::ImageSampleType elastix::RandomCoordinateSampler< TElastix >::ImageSampleType |
Definition at line 117 of file elxRandomCoordinateSampler.h.
typedef Superclass1::ImageSampleValueType elastix::RandomCoordinateSampler< TElastix >::ImageSampleValueType |
Definition at line 125 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageConstPointer elastix::RandomCoordinateSampler< TElastix >::InputImageConstPointer |
Definition at line 114 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageIndexType elastix::RandomCoordinateSampler< TElastix >::InputImageIndexType |
Definition at line 120 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImagePixelType elastix::RandomCoordinateSampler< TElastix >::InputImagePixelType |
Definition at line 116 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImagePointer elastix::RandomCoordinateSampler< TElastix >::InputImagePointer |
Definition at line 113 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImagePointType elastix::RandomCoordinateSampler< TElastix >::InputImagePointType |
Definition at line 121 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImagePointValueType elastix::RandomCoordinateSampler< TElastix >::InputImagePointValueType |
Definition at line 124 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageRegionType elastix::RandomCoordinateSampler< TElastix >::InputImageRegionType |
Definition at line 115 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageSizeType elastix::RandomCoordinateSampler< TElastix >::InputImageSizeType |
Definition at line 122 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageSpacingType elastix::RandomCoordinateSampler< TElastix >::InputImageSpacingType |
Definition at line 123 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InputImageType elastix::RandomCoordinateSampler< TElastix >::InputImageType |
Definition at line 112 of file elxRandomCoordinateSampler.h.
typedef Superclass1::InterpolatorType elastix::RandomCoordinateSampler< TElastix >::InterpolatorType |
Definition at line 130 of file elxRandomCoordinateSampler.h.
typedef Superclass2::ITKBaseType elastix::RandomCoordinateSampler< TElastix >::ITKBaseType |
Definition at line 143 of file elxRandomCoordinateSampler.h.
typedef Superclass1::MaskType elastix::RandomCoordinateSampler< TElastix >::MaskType |
Definition at line 119 of file elxRandomCoordinateSampler.h.
typedef Superclass1::OutputVectorContainerPointer elastix::RandomCoordinateSampler< TElastix >::OutputVectorContainerPointer |
Definition at line 111 of file elxRandomCoordinateSampler.h.
typedef Superclass1::OutputVectorContainerType elastix::RandomCoordinateSampler< TElastix >::OutputVectorContainerType |
Definition at line 110 of file elxRandomCoordinateSampler.h.
typedef itk::SmartPointer< Self > elastix::RandomCoordinateSampler< TElastix >::Pointer |
Definition at line 93 of file elxRandomCoordinateSampler.h.
typedef Superclass2::RegistrationPointer elastix::RandomCoordinateSampler< TElastix >::RegistrationPointer |
Definition at line 142 of file elxRandomCoordinateSampler.h.
typedef Superclass2::RegistrationType elastix::RandomCoordinateSampler< TElastix >::RegistrationType |
Definition at line 141 of file elxRandomCoordinateSampler.h.
typedef RandomCoordinateSampler elastix::RandomCoordinateSampler< TElastix >::Self |
Standard ITK-stuff.
Definition at line 88 of file elxRandomCoordinateSampler.h.
typedef itk::ImageRandomCoordinateSampler< typename elx::ImageSamplerBase< TElastix >::InputImageType > elastix::RandomCoordinateSampler< TElastix >::Superclass1 |
Definition at line 91 of file elxRandomCoordinateSampler.h.
typedef elx::ImageSamplerBase< TElastix > elastix::RandomCoordinateSampler< TElastix >::Superclass2 |
Definition at line 92 of file elxRandomCoordinateSampler.h.
|
inlineprotected |
The constructor.
Definition at line 155 of file elxRandomCoordinateSampler.h.
|
inlineoverrideprotected |
The destructor.
Definition at line 157 of file elxRandomCoordinateSampler.h.
|
private |
The private constructor.
|
override |
Execute stuff before each resolution:
elastix::RandomCoordinateSampler< TElastix >::elxClassNameMacro | ( | "RandomCoordinate" | ) |
Name of this class. Use this name in the parameter file to select this specific interpolator.
example: (ImageSampler "RandomCoordinate")
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageRandomCoordinateSampler< elx::ImageSamplerBase< TElastix >::InputImageType >.
elastix::RandomCoordinateSampler< TElastix >::itkStaticConstMacro | ( | InputImageDimension | , |
unsigned int | , | ||
Superclass1::InputImageDimension | |||
) |
The input image dimension.
|
static |
Method for creation through the object factory.
|
private |
The private copy constructor.
Generated on 1667476801 for elastix by 1.9.4 |