From 42ce29b83d0e587e8ce92cdb95fbde8897b4a59b Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 8 Jan 2021 18:41:40 +0000 Subject: [PATCH] fix for ITK 5.1 ITK 5.1 introduced a typed-enum IOPixelEnum Fixes #654 --- src/IO/ITKImageInputFileFormat.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/IO/ITKImageInputFileFormat.cxx b/src/IO/ITKImageInputFileFormat.cxx index 8e8a45e47..2f2751b6f 100644 --- a/src/IO/ITKImageInputFileFormat.cxx +++ b/src/IO/ITKImageInputFileFormat.cxx @@ -569,7 +569,13 @@ read_file_itk(const std::string &filename) __FILE__, __LINE__); return NULL; } - if (reader->GetImageIO()->GetPixelType() != itk::ImageIOBase::VECTOR) { + if (reader->GetImageIO()->GetPixelType() != +#if ITK_VERSION_MAJOR<5 || (ITK_VERSION_MAJOR==5 && ITK_VERSION_MINOR==0) + itk::ImageIOBase::VECTOR +#else + itk::IOPixelEnum::VECTOR +#endif + ) { error("read_file_itk: Image type should be vector %s:%d.", __FILE__, __LINE__); return NULL; }