.config/NA-MIC/Extensions-27501/SlicerElastix/lib/Slicer-4.10/elastix: error while loading shared libraries: libi2d.so.13: cannot open shared object file: No such file or directory
I know I can just call some function but I will have to modify many things in my code. Is there another way to call it from the terminal?
Can you start Elastix bundled with the latest nightly version? Does Elastix work with the latest nightly build when launched useing “General registration (Elastix)” module? Next steps depend on the answer to these questions.
I got same error above using nightly build (just downloaded it) . Elastix works in Slicer but does not work from the terminal. It would be nice if it runs from the terminal even using Slicer --launch option.
Since some plugins affect other plugins negatively, something should be done to avoid this as this makes it difficult to find the source of the problem if it is from another extension.
I don’t think there are any issues or limitations here, you just need to clearly distinguish between binaries built by Slicer factory machines (and included in extensions); and third-party binaries present on the system. Third-party binaries can be included in extensions, but this should be avoided.
Running executables bundled in a Slicer extension:
There is no interference between extensions if you let Slicer factory build all libraries (you must not bundle binaries created elsewhere). If there are libraries or executable used by multiple extensions (for example Elastix is used by several extensions) then you need to make sure that one extension builds the shared library and all other extensions depend on that. See how SequenceRegistration extension uses SlicerElastix for an example.
In the very rare case that different extensions use must incompatible versions of the same libraries, you can statically link the old version of the library to the extension that requires the old library version. We have 100+ extensions and I think this happened only once.
Running third-party executables or scripts installed on the system (not bundled with Slicer):
If you want to start third-party programs (executables, Python scripts, etc.) from Slicer, then you usually need to use startup environment as described here.
Thanks for the detailed info. I don’t understand the last part. Could you please provide an example of how to run the elastix binary in the terminal (not in python).
Would you run it manually by typing commands on the terminal? Or using a bash script? Don’t you want to use it from your Python scripted module?
Anyway, you can use third-party libraries on your system as @thewtex suggested above (completely independently from Slicer), or run any Slicer executables using the launcher, for example: