DGtal-team / DGtal

Digital Geometry Tools and Algorithm Library
https://dgtal.org
GNU Lesser General Public License v3.0
370 stars 115 forks source link

ITKWriter fails to write images #1612

Closed kerautret closed 3 years ago

kerautret commented 3 years ago

By trying to export ITK image I have now an error like that (both on my computer on MacOS with ITK > 5 or on linux): Capture d’écran 2021-10-11 à 23 45 37 It compiles but gives such errors whatever the type used.

Capture d’écran 2021-10-11 à 23 46 20

@phcerdan If I am not wrong you were using ITK images in DGtal you also have the issue ? (or it is my ITK config)

phcerdan commented 3 years ago

I haven't faced this problem yet with DGtal. But maybe because I am finding ITK explicitly in my project. Is this happening compiling DGtal proper? Or other package using DGtal?

The IO factory registration is a CMake thing https://itk.org/Wiki/ITK/FAQ.

Maybe we need to add include(${ITK_USE_FILE}) in our DGtalConfig.cmake.in

To see if it is a CMake problem, you can add after find_package(DGtal):

find_package(DGtal)
find_package(ITK)
include(${ITK_USE_FILE})

And see if it compiles.

kerautret commented 3 years ago

Excellent, many thanks @phcerdan you are right it is well this problem of cmake since by adding it perfectly works! ;)

kerautret commented 3 years ago

I try to add it in the DGtalConfig.cmake.in as suggested!