[SOLVED] Using make on an example leads to error: itkFEMRegistrationFilter.h: No such file or directory

I copied the source code from https://itk.org/Doxygen/html/Examples_2RegistrationITKv4_2DeformableRegistration1_8cxx-example.html into the home/james/ITK-examples/DeformableRegistration1.cxx together with CMakeLists.txt as per the bottom of this post. In that folder, I then used the commands:

  1. mkdir build
  2. cmake -DITK_DIR=/home/james/ITK-build …/
  3. make

Upon executing the third command, I get the error itkFEMRegistrationFilter.h: No such file or directory. How do I link that header file, located in /home/james/ITK/Modules/Registration/FEM/include, so that this error does not occur? I tried adding it to the includePath in VS Code but it hasn’t made a difference. Any help would be much appreciated!



When configuring ITK using CMake, turn Module_ITKFEMRegistration ON.

Thanks for your quick reply! So I turned on ITKFEMRegistration during configuration, but now I get the following error:

After re-configuring ITK, you need to do an incremental build.

cd ~/ITK-build/
make -j4

Everything working now, thank you so much!