-
Notifications
You must be signed in to change notification settings - Fork 23
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
No option to set number of threads for Transformix #163
Comments
@Svdvoort Hi Sebastian, thank you for your suggestion! Do you have a particular use case that would significantly benefit from running itk.TransformixFilter multi-threaded? Would you then expect a large speed-up of the transformation process? I'm asking, because it may not be entirely trivial to implement this option for TransformixFilter in a thread-safe way. We would have to have a closer look. |
Transformix (the command line version, and I think also the library version) by default already performs multithreading using the default ITK implementation. I think Sebastian's question is just to have a function to set the maximum number of threads, just like possible on the commandline.
Cheers, stefan
From: Niels Dekker ***@***.***>
Sent: Thursday, August 25, 2022 1:47 PM
To: InsightSoftwareConsortium/ITKElastix ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [InsightSoftwareConsortium/ITKElastix] No option to set number of threads for Transformix (Issue #163)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
@Svdvoort<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSvdvoort&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Ce903426332094da9c70708da868f7509%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637970247945080288%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7w4UOshaKFxeNZcmCAzL4cGn8eUZHcI81i7UwzZ7Pz4%3D&reserved=0> Hi Sebastian, thank you for your suggestion! Do you have a particular use case that would significantly benefit from running itk.TransformixFilter multi-threaded? Would you then expect a large speed-up of the transformation process?
I'm asking, because it may not be entirely trivial to implement this option for TransformixFilter in a thread-safe way. We would have to have a closer look.
-
Reply to this email directly, view it on GitHub<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITKElastix%2Fissues%2F163%23issuecomment-1227150677&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Ce903426332094da9c70708da868f7509%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637970247945080288%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RnHq4rmZ33OY3H9mqPhRrkPaNlaiNWHcW%2Bk%2By0eYoXA%3D&reserved=0>, or unsubscribe<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNJY3JF3OK2ZWN4VKV3V25MJPANCNFSM57AUFIAA&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Ce903426332094da9c70708da868f7509%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637970247945080288%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=k7uQbedAWFMWHIzxeyOOpn32cIOm7bjy9OoqeugsNjI%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Indeed, as Stefan points out I would just like to set the maximum number of threads transformix uses. |
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
@Svdvoort @stefanklein OK, thank you for your clarification. 👍 Please check: SuperElastix/elastix#714 Of course, once it is merged into SuperElastix/elastix (develop branch), it still needs to be included with the ITKElastix Python wrapping as well. |
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
@Svdvoort @thewtex Technically, the TransformixFilter option is there in C++ now, with SuperElastix/elastix#714 (Still to be merged, and wrapped by ITKElastix.) Internally it adds the "-threads" option with the specified number of threads, which triggers calling For the transformix executable, "-threads" is certainly a useful option. However, when using ITKElastix with the |
I guess that would work, but it would affect other filters too (probably not a big deal). I guess it is more intuitive, and easier to find, if the thread limitation exists in the filter. |
@Svdvoort As a workaround, does it work for you to just call We are looking into how to add a function like |
Addressed issue InsightSoftwareConsortium/ITKElastix#163 "No option to set number of threads for Transformix", submitted by Sebastian van der Voort.
@N-Dekker in the big picture, moving forward with Elastix output for |
Hi Matt,
Strong part of itk-elastix is indeed that we now offer the flexibility of extracting the ITKtransform so that the user can setup their own resampleimagefilter in exactly the way they like.
That having said, I'm not sure if we should turn it around and use it as a reason to not expose functionality via the elastix interface: part of the added value of Elastix is that it wraps the ResampleImageFilter (and GPU accelerated versions of it) and takes care of some book-keeping etc, so that the users don't need to setup the resample image filter themselves.
Cheers, Stefan
From: Matt McCormick ***@***.***>
Sent: Monday, October 17, 2022 3:40 PM
To: InsightSoftwareConsortium/ITKElastix ***@***.***>
Cc: Stefan Klein ***@***.***>; Mention ***@***.***>
Subject: Re: [InsightSoftwareConsortium/ITKElastix] No option to set number of threads for Transformix (Issue #163)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
For the transformix executable, "-threads" is certainly a useful option. However, when using ITKElastix with the itk Python wrapping, doesn't itk support calling itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads directly in Python?
@N-Dekker<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FN-Dekker&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cc218207d355f46ce9f7608dab0451683%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C638016108018103174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ra5JyC4FdRbt5DlWkBJlstrfemsr2PAvJirMeAVmqIQ%3D&reserved=0> in the big picture, moving forward with Elastix output for itk.Transform will allow us to use itk.ResampleImageFilter. This has interfaces for setting the number of threads, etc. We can also take advantage of other GPU-optimized itk.ResampleImageFilter implementations in the works.
-
Reply to this email directly, view it on GitHub<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITKElastix%2Fissues%2F163%23issuecomment-1280878400&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cc218207d355f46ce9f7608dab0451683%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C638016108018103174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=P6lPsvh4lsbvTZlK30AIKdTRtE3BjZGj5g6%2BwdkEK6k%3D&reserved=0>, or unsubscribe<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNPZZRW4KPXGB6SEP2LWDVJK7ANCNFSM57AUFIAA&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cc218207d355f46ce9f7608dab0451683%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C638016108018103174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=g1w9X%2Faxg8s4OndCzGGfSe7ClO%2BfZU1QudO3iLExRfg%3D&reserved=0>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Hi @stefanklein , Yes, I agree, the flexibility of Elastix helps its adoption. To be clear, I am not suggesting that we do not add the ability to set the number of threads to the Transformix interface. We should continue to increase the flexibility of Elastix so all GPU acceleration versions of resampling, including e.g. Python / CUDA implementations, are available to Elastix users. This is possible by providing an in-memory |
Please see the discussion at SuperElastix/elastix#714 on how to provide this functionality on the Transformix interface. |
The
itk.ElastixRegistrationMethod
method has theSetNumberOfThreads
andGetNumberOfThreads
functions to set and get the number of threads respectively.However,
itk.TransformixFilter
does not have such functions. Should the number of threads be set in a different way, or can aSetNumberOfThreads
function be added?The text was updated successfully, but these errors were encountered: