Closed prash-p closed 5 years ago
Does this work? If you don't run transformix then what would generate deformationField.mhd?
I think we need to implement a reader for elastix transformation files as I described it here.
It works on the data I had to test on. Transformix still runs to produce the deformation field, but the input parameters are altered so an output image isn't created if not required. This can save a little bit of time at the end of the registration process.
I agree the ideal situation would be to convert the proprietary transforms into a slicer transform, instead of running transformix. I'll take a look at your work on it and see if I can contribute in any way.
OK, I see, so we run transformix anyway, but we don't generate resampled output volume if we don't need it.
Could we simply make inputParamsTransformix += ['-in', os.path.join(inputDir, 'moving.mha')]
conditional (only add it if resampled moving volume is needed) instead of duplicating about 20 lines of code?
This change will help a bit, but implementing transform reader would make a huge difference: we could get the transform in seconds (immediately if only linear) and store it in a few kilobytes instead of hundreds of megabytes.
Yes that would work I think, but we need to consider the condition when the user wants an output volume but no transformation. In this case we could just not create an output transform node?
Yes, we need to handle volume, transform, and volume+transform cases, preferably with a single call of transformix (just by tuning its command-line arguments).
Do you want me to make those changes, or are you working on it?
Please make the changes. Thank you!
Should work same as before but with fewer lines now.
Pull request in response to this discussion https://discourse.slicer.org/t/prevent-transformix-running-in-slicer-elastix/7902