lassoan / SlicerElastix

This extension makes available Elastix medical image registration toolkit (http://elastix.isi.uu.nl/) available in Slicer.
MIT License
49 stars 29 forks source link

Use Elastix wrapping of ITK for Python #31

Closed BishopWolf closed 1 year ago

BishopWolf commented 4 years ago

https://github.com/InsightSoftwareConsortium/ITKElastix

This would ease the build of this extension as you no longer need to install elastix executable or do any external call.

This example is very clarifying https://github.com/InsightSoftwareConsortium/ITKElastix/blob/master/examples/2_RegistrationParameters.ipynb

lassoan commented 4 years ago

I don't think this is quite usable for us yet.

  1. Slicer uses SimpleITK for Python wrapping, not ITK's Python wrapping. Please check with SimpleITK developers if there are plans for wrapping Elastix.

  2. Elastix does not use ITK transform file format. We implemented a reader for that in SlicerElastix. It would be nice if we did not need to maintain it, but I don't think an alternative is available yet. Please check with Elastix/ITK/SimpleITK developers how Elastix transforms could be made available in ITK transformation objects.

BishopWolf commented 1 year ago

Seems like we are approaching to functionality here https://github.com/SuperElastix/elastix/releases/tag/5.1.0

elastix 5.1.0 is the first new release after elastix 5.0.1, October 2020. It has added support for ITK transform file formats, HDF5 and TFM. While still supporting the original elastix transform parameter files as well, of course. Furthermore, it has extended the library interface, allowing to pass transform objects in memory (bypasssing file I/O). Which allows SimpleITK (https://simpleitk.org/) and ITKElastix (https://github.com/InsightSoftwareConsortium/ITKElastix) to further extend in that direction, with future releases. And it has significant runtime performance improvements.

lassoan commented 1 year ago

Elastix has now been upgraded to 5.1.0.

ITKElastix Python wrapping could be indeed used in this extension. Pros:

Considering pros/cons do not overwhelmingly point towards switching to the ITKElastix, we remain on using Elastix that is built from source.