elastix icon indicating copy to clipboard operation
elastix copied to clipboard

ENH: Add NumberOfWorkUnits to ElastixMain, used by CreateComponent

Open N-Dekker opened this issue 3 years ago • 1 comments

With this commit, the GenerateData() member function of both TransformixFilter and ElastixRegistrationMethod pass their NumberOfWorkUnits to their corresponding ElastixMain/TransformixMain object, which passed this NumberOfWorkUnits to each component that is an itk::ProcessObject.

Related to issue https://github.com/InsightSoftwareConsortium/ITKElastix/issues/163 "No option to set number of threads for Transformix", by Sebastian (@Svdvoort)

N-Dekker avatar Sep 04 '22 19:09 N-Dekker

For the record, five out of the ten elastix component base classes (at https://github.com/SuperElastix/elastix/tree/3e89c0cf9c90998b336fbed22c92d9f42bcf2959/Core/ComponentBaseClasses/) have an ITKBaseType that is derived (directly or indirectly) from itk::ProcessObject:

elastix component base class ITKBaseType inheritance
FixedImagePyramidBase itk::MultiResolutionPyramidImageFilter<> ImageToImageFilter => ImageSource => ProcessObject
MovingImagePyramidBase itk::MultiResolutionPyramidImageFilter<> ImageToImageFilter => ImageSource => ProcessObject
ImageSamplerBase itk::ImageSamplerBase<> ImageToVectorContainerFilter => VectorContainerSource => ProcessObject
RegistrationBase itk::MultiResolutionImageRegistrationMethod2<> ProcessObject
ResamplerBase itk::ResampleImageFilter<> ImageToImageFilter => ImageSource => ProcessObject

The other five are not derived from itk::ProcessObject:

elastix component base class ITKBaseType inheritance
InterpolatorBase itk::InterpolateImageFunction<> ImageFunction => FunctionBase => Object
ResampleInterpolatorBase itk::InterpolateImageFunction<> ImageFunction => FunctionBase => Object
MetricBase itk::SingleValuedCostFunction CostFunction => Object
OptimizerBase itk::Optimizer Object
TransformBase AdvancedCombinationTransform AdvancedTransform => Transform => TransformBaseTemplate => Object

N-Dekker avatar Sep 06 '22 13:09 N-Dekker