Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add NumberOfThreads property to itk::TransformixFilter #714

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

N-Dekker
Copy link
Member

Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort (@Svdvoort).

@N-Dekker N-Dekker force-pushed the Add-NumberOfThreads-to-TransformixFilter branch 2 times, most recently from ffab4b9 to c3dd02c Compare August 26, 2022 10:13
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
@N-Dekker N-Dekker force-pushed the Add-NumberOfThreads-to-TransformixFilter branch from c3dd02c to 96df5ee Compare September 3, 2022 13:55
Copy link
Contributor

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@N-Dekker
Copy link
Member Author

Sorry, after submitting this pull request, I started doubting. If TransformixFilter.SetNumberOfThreads is just equivalent to itk.MultiThreaderBase.SetGlobalMaximumNumberOfThreads, I think users should just call the itk.MultiThreaderBase member function directly.

@thewtex
Copy link
Contributor

thewtex commented Oct 17, 2022

@N-Dekker There is a per-instance SetNumberOfWorkUnits on all ProcessObject's. When using ResampleImageFilter directly, for example, this can be set. Ideally, itk::TransformixFilter should expose this interface and pass the value to component classes.

@N-Dekker
Copy link
Member Author

There is a per-instance SetNumberOfWorkUnits on all ProcessObject's. When using ResampleImageFilter directly, for example, this can be set. Ideally, itk::TransformixFilter should expose this interface and pass the value to component classes.

@thewtex Thanks for the suggestion Matt. I did give it an initial try before, with https://github.com/SuperElastix/elastix/compare/NumberOfWorkUnits It sets the NumberOfWorkUnits for each elastix component that is derived from itk::ProcessObject. However, I have not finished this approach, because it does not really limit the number of threads used by each individual component. The NumberOfWorkUnits is not (yet?) passed to each sub-object of each component. I don't know if it's already worth merging this incomplete commit. If users really want to reduce the number of threads, they should just call itk.MultiThreaderBase.SetGlobalMaximumNumberOfThreads anyway.

@thewtex
Copy link
Contributor

thewtex commented Oct 17, 2022

@N-Dekker that's great, it looks like with some more work to propagate NumberOfWorkUnits to the sub-objects developers will be able to request the number of threads used on a per-filter basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants