Skip to content

Unable to successfully compile LesionSizingToolkit module #42

Closed

Description

@artitj

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

  1. dzenanz commented on Apr 26, 2021

    @dzenanz
    Member

    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?

  2. artitj commented on Apr 26, 2021

    @artitj
    Author

    Thanks for the quick reply! If I set LSTK_USE_VTK=OFF, the LesionSegmentation binary doesn't get built.

  3. dzenanz commented on Apr 26, 2021

    @dzenanz
    Member

    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

  4. artitj commented on Apr 26, 2021

    @artitj
    Author

    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

    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).

  5. dzenanz commented on Apr 26, 2021

    @dzenanz
    Member

    I guess it was only updated to build in default configuration. By build, I mean have no compile errors.

  6. romangrothausmann commented on May 13, 2025

    @romangrothausmann
    Member

    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=OFF did not seem to have any (positive) effect.

  7. dzenanz commented on May 13, 2025

    @dzenanz
    Member

    @hjmjohnson has PR #51 open, he might be up to date and be able to answer your questions.

  8. hjmjohnson commented on Oct 8, 2026

    @hjmjohnson
    Member

    Reproduced against ITK 6 and VTK 9.6: with LSTK_USE_VTK=ON the build stopped at the first VTK header because the top-level CMake still used a VTK 8 style vtk_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 with find_package(VTK 9 COMPONENTS ...) and updating the API calls builds all five executables (LesionSegmentation included) against ITK 6 + VTK 9.6; it is based on #61, which is now green for ITK 5.4 and ITK 6 without VTK. The LesionSegmentation binary is only built with LSTK_USE_VTK=ON because it renders with VTK; that is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions