# Cannot open source file "itkMultiScaleHessianBasedMeasureImageFilter.h"

Hello,

I get an error in Visual Studio 2017 when I am trying to include itkMultiScaleHessianBasedMeasureImageFilter header file.
When I try to build the solution I get the following error

Helen

How does you CMakeLists.txt look like? The filter you mention is in ITKImageFeature module.

My CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 3.9.5)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE}) if (ITKVtkGlue_LOADED) find_package(VTK REQUIRED) include(${VTK_USE_FILE})
else()
find_package(ItkVtkGlue REQUIRED)
include(${ItkVtkGlue_USE_FILE}) set(Glue ItkVtkGlue) endif() add_executable(MaskImageFilter MACOSX_BUNDLE MaskImageFilter.cxx) target_link_libraries(MaskImageFilter${Glue} ${VTK_LIBRARIES}${ITK_LIBRARIES})

and that filter that I want to use is that:

https://itk.org/Doxygen/html/itkMultiScaleHessianBasedMeasureImageFilter_8h.html

Thanks

Do you have any idea how can I solve that issue?

There is no package ItkVtkGlue. ItkVtkGlue is a COMPONENT in package ITK. Can you replace the else branch in CMakeLists.txt by:

...
else()
message(SEND_ERROR "ITK must be configured with VTKGlue")
endif()


This branch might be taken, thus affecting (not populating) the list of ITK modules. Of course, you need to enable Module_ITKVtkGlue when configuring ITK.

I updated the .txt file with the following:

cmake_minimum_required(VERSION 3.9.5)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE}) add_executable(MaskImageFilter MACOSX_BUNDLE MaskImageFilter.cxx) target_link_libraries(MaskImageFilter${VTK_LIBRARIES} \${ITK_LIBRARIES})

and still, doesn’t work.

Thanks

Which version of ITK are you using? Before version 5, that filter used to be part of non-default module Review. Make sure you enable that module when configuring ITK with CMake.

Open your project properties (right click on MaskImageFilter, properties is last option). Go to C/C++, General. Edit Additional Include Directories. See if path\to\ITK-source\Modules\Filtering\ImageFeature\include is in the list. If it isn’t in the list, what is? You can copy the list from Evaluated value box.

I have installed the 4.13.2 version, the latest available version on itk website.

I tried to add that directory, but I do not have include folder under “Image Feature”, please see the attached image.

I do not have include folder under “Image Feature”

You are looking in the ITK build folder, not the ITK source folder.

But first enable ITKReview module, as I think that is your main problem.

2 Likes

Thanks a lot for your help!

1 Like