-
Notifications
You must be signed in to change notification settings - Fork 118
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
Final image transformation takes long time #370
Comments
@orange676 Thank you for reporting this issue. Are you sure that setting Then, when executing a Debug build, You see, when elastix is used as a library, it still checks Can you still further clarify the issue? |
@mstaring Do you have a suggestion how to further proceed with this issue? As far as I can see, the library does take the |
For the first part of the question, it is normal that the resampling takes much more time than the time during registration, as during registration no resampling of the complete image is done. Only about 2000 samples are warped and interpolated. As for the second part, Niels' response says that we are not able to reproduce this issue at the moment. @orange676, could you provide a reproducing example of this behavior? If not, I suggest to close the issue. |
@orange676 Thanks for your further elaboration on this issue. Now I see,
https://github.com/SuperElastix/elastix/blob/5.0.1/Core/Main/elxElastixFilter.hxx#L133-L134 With commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by @kaspermarstal, 3 February 2016. Kasper do you happen to know if it is still necessary nowadays, to always to do WriteResultImage = "true"? |
Hi Niels and Marius, Thank you for solve it :-) can I ask you another questions? About the "not enough sample" error. I had this problem in the very begining, after I provide the intial transform, this problem seems solved. But it appears from time to time, I have check my initial transforamtion, it looks not bad. I have also noticed that it fails more often if the initial rotation is large, or sometimes I need 180 degree. Can elastix handle such case or what is the proper way to handle it? Should I open another ticket for this question? |
Both `ElastixFilter::GenerateData()` and `ElastixRegistrationMethod::GenerateData()` did overwrite a user preference by explicitly setting the "WriteResultImage" parameter. This behavior was added with commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by Kasper Marstal, 3 February 2016. Which causes a performance issue, #370 "Final image transformation takes long time", reported by orange676. With this commit these `GenerateData()` member functions is longer set "WriteResultImage".
@orange676 The issue is not yet solved! We just got an explanation of why the final image transformation takes such a long time. I'm now preparing a real fix, at https://github.com/SuperElastix/elastix/tree/GenerateData-no-longer-set-WriteResultImage-true But I still need to figure out what might go wrong when
This sounds like another issue to me, for which you might open another ticket (GitHub-issue)... |
Both `ElastixFilter::GenerateData()` and `ElastixRegistrationMethod::GenerateData()` did overwrite a user preference by explicitly setting the "WriteResultImage" parameter. This behavior was added with commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by Kasper Marstal, 3 February 2016. Which causes a performance issue, #370 "Final image transformation takes long time", reported by orange676. With this commit these `GenerateData()` member functions is longer set "WriteResultImage".
Both `ElastixFilter::GenerateData()` and `ElastixRegistrationMethod::GenerateData()` did overwrite a user preference by explicitly setting the "WriteResultImage" parameter. This behavior was added with commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by Kasper Marstal, 3 February 2016. Which causes a performance issue, #370 "Final image transformation takes long time", reported by orange676. With this commit these `GenerateData()` member functions is longer set "WriteResultImage". When the value of this parameter is false, the elastix library will no longer generate a result image; `GetOutput()` will return an empty image. Discussed at the internal elastix sprint of 7 June 2021, with Marius, Stefan, and Viktor.
Both `ElastixFilter::GenerateData()` and `ElastixRegistrationMethod::GenerateData()` did overwrite a user preference by explicitly setting the "WriteResultImage" parameter. This behavior was added with commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by Kasper Marstal, 3 February 2016. Which causes a performance issue, #370 "Final image transformation takes long time", reported by orange676. With this commit these `GenerateData()` member functions longer set "WriteResultImage". When the value of this parameter is false, the elastix library will no longer generate a result image; `GetOutput()` will return an empty image. Discussed at the internal elastix sprint of 7 June 2021, with Marius, Stefan, and Viktor.
Both `ElastixFilter::GenerateData()` and `ElastixRegistrationMethod::GenerateData()` did overwrite a user preference by explicitly setting the "WriteResultImage" parameter. This behavior was added with commit a6e8f10 "ENH: Add ElastixFilter support for initial transform parameter file" by Kasper Marstal, 3 February 2016. Which causes a performance issue, #370 "Final image transformation takes long time", reported by orange676. With this commit these `GenerateData()` member functions longer set "WriteResultImage". When the value of this parameter is false, the elastix library will no longer generate a result image; `GetOutput()` will return an empty image. Discussed at the internal elastix sprint of 7 June 2021, with Marius, Stefan, and Viktor.
@orange676 Can you please confirm that the issue (Final image transformation takes long time) is solved now at the develop branch? With commit 7d9b9ef, "PERF: GenerateData() should not set "WriteResultImage" (pull request #477). |
Closed for now, thank you @orange676 Please reopen if you think otherwise! |
I am using elastix as a library, and want to get the affine transformation matrix. The registration works pretty good 👍 . However, the final applying of the transformation tooks really long time, which I don't understand.
I have 3D image, about 400x400x300, the registration tooks around 40sec, however, the final applying taks nearly 3min. I further add some debug code, it shows that most time is spend on elxResamplerBase::CreateItkResultImage(.) by the ResampleImageFilter. I assume during the registration, many times of resample happend, how could the last application took so long time? I also tried manually call resampleImageFilter on my image, with affine transformation, it is about 10sec. So What I see in the code , is that you have elxMyStandardResampler, wrap around itk resample image filter.
Actually, I don't need this image. I tried to set WriteResultImage to false. However, because it is running as library, I think it will create this image. I tried to false writeResultImage to false in code, then some exception will happen. what is the proper way to skip this time consuming step ?
The text was updated successfully, but these errors were encountered: