elastix
elastix copied to clipboard
ENH: Add NumberOfWorkUnits to ElastixMain, used by CreateComponent
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)
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 |