Error with Elastix Registration: Elastix not found

Hi everyone,

I’m working on a Slicer custom application, which was built according to this tutorial: SlicerCAT: Creating custom applications based on 3D Slicer - Kitware Blog

The application runs a custom module developed in Python language programming using the Extension Manager module available in 3D Slicer.

The module should perform image registration using the SlicerElastix toolbox through the following lines of code:

    self.elastixLogic = Elastix.ElastixLogic()

        self.movingNode, self.referenceNode,

But I’m getting an error message saying “Elastix Not Found”. Any idea how to solve it?

Thanks in advance.

Did you use to generate your Slicer custom application? I believe when you use that it will use the current Slicer master git hash when setting up the custom application. It looks from the image you posted that you are using an older Slicer version (4.11). is an example of a Slicer custom app, but not necessarily the starting point or the source you should be editing to create your application.

As it relates to Elastix, did you specify to build your Slicer custom application with the SlicerElastix as a remote extension? Were there any build errors? I would suggest to use latest Slicer master git hash and SlicerElastix git hash as these should be currently compatible.

@marianaslicer Can you answer some of the above questions? Did your Slicer custom app build without errors? Did you solve the Elastix error you posted about earlier?

Hi James,

Sorry for answering later.
I used the link you mentioned to generate my Slicer application and I think I used the current Slicer master git, Slicer 4.11.20210226.
Then, I added to the cmakefile.txt the SlicerElastix extension:

set(extension_name “SlicerElastix”)
set({extension_name}_SOURCE_DIR "{CMAKE_BINARY_DIR}/{extension_name}") FetchContent_Populate({extension_name}
SOURCE_DIR {{extension_name}_SOURCE_DIR}

And there were no build errors. What I did to solve my problem (which is not the best approach) was to add manually the elastix.exe and transformix.exe files to the Slicer Elastix folder and specify it at the custom elastix toolbox location.