Repository navigation
Unable to successfully compile LesionSizingToolkit module #42
Description
I am unable to successfully compile the LesionSizingToolkit module using ITK 5.12. I am building the module in tree by enabling the Module_LesionSizingToolkit option, setting LSTK_USE_VTK=ON. I have tried VTK 9.0.1 and VTK 7.1.1. I am using Ubuntu 20.04.2.
I receive the following errors:
`[ 80%] Building CXX object Modules/Remote/LesionSizingToolkit/Examples/CMakeFiles/LesionSegmentation.dir/LesionSegmentation.cxx.o
In file included from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:40:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h: In member function ‘double* LesionSegmentationCLI::GetROI()’:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:128:37: error: ‘__gnu_cxx::__alloc_traits<std::allocator<itk::SpatialObjectPoint<3> >, itk::SpatialObjectPoint<3> >::value_type’ {aka ‘class itk::SpatialObjectPoint<3>’} has no member named ‘GetPosition’
128 | this->ROI[2 * i] = seeds[0].GetPosition()[i] - this->GetValueAsFloat("MaximumRadius");
| ^~~~~~~~~~~
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:129:41: error: ‘__gnu_cxx::__alloc_traits<std::allocator<itk::SpatialObjectPoint<3> >, itk::SpatialObjectPoint<3> >::value_type’ {aka ‘class itk::SpatialObjectPoint<3>’} has no member named ‘GetPosition’
129 | this->ROI[2 * i + 1] = seeds[0].GetPosition()[i] + this->GetValueAsFloat("MaximumRadius");
| ^~~~~~~~~~~
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h: In member function ‘LesionSegmentationCLI::LandmarkPointListType LesionSegmentationCLI::GetSeeds()’:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:255:16: error: ‘__gnu_cxx::__alloc_traits<std::allocator<itk::SpatialObjectPoint<3> >, itk::SpatialObjectPoint<3> >::value_type’ {aka ‘class itk::SpatialObjectPoint<3>’} has no member named ‘SetPosition’
255 | seeds[i].SetPosition(sx, sy, sz);
| ^~~~~~~~~~~
In file included from /usr/include/dirent.h:245,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:17,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:40:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx: In function ‘itk::Image<short int, 3>::Pointer GetImage(std::string, bool)’:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:154:14: error: conversion from ‘long int’ to ‘itk::Image<short int, 3>::Pointer’ {aka ‘itk::SmartPointer<itk::Image<short int, 3> >’} is ambiguous
154 | return NULL;
| ^~~~
In file included from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkExceptionObject.h:25,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkMacro.h:1272,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReaderException.h:22,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReader.h:20,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:1:
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:99:3: note: candidate: ‘itk::SmartPointer::SmartPointer(itk::SmartPointer::ObjectType*) [with TObjectType = itk::Image<short int, 3>; itk::SmartPointer::ObjectType = itk::Image<short int, 3>]’
99 | SmartPointer(ObjectType * p) noexcept
| ^~~~~~~~~~~~
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:71:13: note: candidate: ‘constexpr itk::SmartPointer::SmartPointer(std::nullptr_t) [with TObjectType = itk::Image<short int, 3>; std::nullptr_t = std::nullptr_t]’
71 | constexpr SmartPointer(std::nullptr_t p) noexcept
| ^~~~~~~~~~~~
In file included from /usr/include/dirent.h:245,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:17,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:40:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:175:12: error: conversion from ‘long int’ to ‘itk::Image<short int, 3>::Pointer’ {aka ‘itk::SmartPointer<itk::Image<short int, 3> >’} is ambiguous
175 | return NULL;
| ^~~~
In file included from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkExceptionObject.h:25,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkMacro.h:1272,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReaderException.h:22,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReader.h:20,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:1:
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:99:3: note: candidate: ‘itk::SmartPointer::SmartPointer(itk::SmartPointer::ObjectType*) [with TObjectType = itk::Image<short int, 3>; itk::SmartPointer::ObjectType = itk::Image<short int, 3>]’
99 | SmartPointer(ObjectType * p) noexcept
| ^~~~~~~~~~~~
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:71:13: note: candidate: ‘constexpr itk::SmartPointer::SmartPointer(std::nullptr_t) [with TObjectType = itk::Image<short int, 3>; std::nullptr_t = std::nullptr_t]’
71 | constexpr SmartPointer(std::nullptr_t p) noexcept
| ^~~~~~~~~~~~
In file included from /usr/include/dirent.h:245,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentationCLI.h:17,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:40:
/home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:178:10: error: conversion from ‘long int’ to ‘itk::Image<short int, 3>::Pointer’ {aka ‘itk::SmartPointer<itk::Image<short int, 3> >’} is ambiguous
178 | return NULL;
| ^~~~
In file included from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkExceptionObject.h:25,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkMacro.h:1272,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReaderException.h:22,
from /home/artit/src/InsightToolkit-5.1.2/Modules/IO/ImageBase/include/itkImageFileReader.h:20,
from /home/artit/src/InsightToolkit-5.1.2/Modules/Remote/LesionSizingToolkit/Examples/LesionSegmentation.cxx:1:
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:99:3: note: candidate: ‘itk::SmartPointer::SmartPointer(itk::SmartPointer::ObjectType*) [with TObjectType = itk::Image<short int, 3>; itk::SmartPointer::ObjectType = itk::Image<short int, 3>]’
99 | SmartPointer(ObjectType * p) noexcept
| ^~~~~~~~~~~~
/home/artit/src/InsightToolkit-5.1.2/Modules/Core/Common/include/itkSmartPointer.h:71:13: note: candidate: ‘constexpr itk::SmartPointer::SmartPointer(std::nullptr_t) [with TObjectType = itk::Image<short int, 3>; std::nullptr_t = std::nullptr_t]’
71 | constexpr SmartPointer(std::nullptr_t p) noexcept
| ^~~~~~~~~~~~
make[2]: *** [Modules/Remote/LesionSizingToolkit/Examples/CMakeFiles/LesionSegmentation.dir/build.make:63: Modules/Remote/LesionSizingToolkit/Examples/CMakeFiles/LesionSegmentation.dir/LesionSegmentation.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:15615: Modules/Remote/LesionSizingToolkit/Examples/CMakeFiles/LesionSegmentation.dir/all] Error 2
make: *** [Makefile:152: all] Error 2`
EDIT: I tried ITK 4.13.3 with VTK 7.1 and it compiled successfully. So the problem seems to be with the latest versions of ITK.
Activity
dzenanz commentedon Apr 26, 2021
The original author (@karthikkrishnan?) has abandoned this nearly 10 years ago. ITK 5 had a significant SpatialObject refactoring, and I don't think anyone updated this remote properly. Does it build if you build without VTK?
artitj commentedon Apr 26, 2021
Thanks for the quick reply! If I set LSTK_USE_VTK=OFF, the LesionSegmentation binary doesn't get built.
dzenanz commentedon Apr 26, 2021
I meant, are there compile errors?
Yes, this module is in serious need of maintenance. Contributions are welcome. If anyone wants to do it, they should follow the migration guide:
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md
artitj commentedon Apr 26, 2021
Sorry I wasn't clear. While there are no compile errors, it doesn't look like the LegionSegmentation binary is actually part of the build; only its dependencies get built.
Thank you for your help though! I was confused since even the latest 5.2 rc 3 release notes specifically say the LesionSizingToolkit module is updated (https://github.com/InsightSoftwareConsortium/ITK/releases).
dzenanz commentedon Apr 26, 2021
I guess it was only updated to build in default configuration. By build, I mean have no compile errors.
romangrothausmann commentedon May 13, 2025
Hi @dzenanz!
Just came across this issue when trying to make use of itkVesselEnhancingDiffusion3DImageFilter.
I noticed that quite a bit of work has gone on LesionSizingToolkit since the last post here.
What is the last know combination of ITK-4.x and VTK-y to work for compiling ITK with
Module_LesionSizingToolkit=ON?Is there a known version combination that works for ITK-5.z?
Adding
-DLSTK_USE_VTK=OFFdid not seem to have any (positive) effect.dzenanz commentedon May 13, 2025
@hjmjohnson has PR #51 open, he might be up to date and be able to answer your questions.
romangrothausmann commentedon May 16, 2025
Found a working combination:
VTK-7.1.1 with ITK-4.12.2:
https://gitlab.com/romangrothausmann/ITK-VTK_CLIs/-/blob/03b952cf4389972057fab5b088b5334671b5a0bb/Dockerfile#L58
https://gitlab.com/romangrothausmann/ITK-VTK_CLIs/-/pipelines/1820809559
hjmjohnson commentedon Oct 8, 2026
Reproduced against ITK 6 and VTK 9.6: with
LSTK_USE_VTK=ONthe build stopped at the first VTK header because the top-level CMake still used a VTK 8 stylevtk_module_config()with an undefined target prefix, and underneath that the examples called the pre-ITK5 SpatialObject API (GetPosition,SetPosition,GetNumberOfObjects,GetObjects). A PR replacing the block withfind_package(VTK 9 COMPONENTS ...)and updating the API calls builds all five executables (LesionSegmentationincluded) against ITK 6 + VTK 9.6; it is based on #61, which is now green for ITK 5.4 and ITK 6 without VTK. TheLesionSegmentationbinary is only built withLSTK_USE_VTK=ONbecause it renders with VTK; that is unchanged.