ITK - Concept checking error

Hello,

I am trying to segment tumour in liver. I made one program which is working fine with 2D images.
but when I am trying to run 3D series for the same program,
its showing following “Concept checking” error.

/usr/local/include/ITK-4.13/itkConceptChecking.h:804:3: required from ‘struct itk::Concept::IsFloatingPoint’
/usr/local/include/ITK-4.13/itkCannyEdgeDetectionImageFilter.h:220:3: required from ‘class itk::CannyEdgeDetectionImageFilter<itk::Image<short int, 3>, itk::Image<short int, 3> >’
/home/PVirkar/Desktop/program/Tumour3Dwatershed/Tumour3Dwatershed.cxx:167:36: required from here
/usr/local/include/ITK-4.13/itkConceptChecking.h:796:17: error: conversion from ‘itk::Concept::IsFloatingPoint::Constraints::FalseT {aka itk::Concept::Detail::UniqueType_bool}’ to non-scalar type ‘itk::Concept::IsFloatingPoint::Constraints::IntegralT {aka itk::Concept::Detail::UniqueType_bool}’ requested
IntegralT a = FalseT();
^
/usr/local/include/ITK-4.13/itkConceptChecking.h:797:17: error: conversion from ‘itk::Concept::IsFloatingPoint::Constraints::FalseT {aka itk::Concept::Detail::UniqueType_bool}’ to non-scalar type ‘itk::Concept::IsFloatingPoint::Constraints::ExactT {aka itk::Concept::Detail::UniqueType_bool}’ requested
ExactT b = FalseT();

As per my understanding, there is problem in data type of Canny edge detection filter. This filter requires
pixel type as float. But as i am dealing with 3D series, my pixel type is signed short and constexpr unsigned int.
Is it correct?
I tried using castimagefilter also. but getting same error for cast image filter.

error: no matching function for call to ‘itk::CastImageFilter<itk::Image<unsigned char, 3>, itk::Image<double, 3> >::SetInput(itk::ImageSource<itk::Image<short int, 3> >::OutputImageType*)’
toReal->SetInput( reader->GetOutput() );

And another error for next filter (gradient magnitude).

I am unable to understand how to make pipeline of different filters which requires different data types for its input.
I am using ROI, canny edge, gradient magnitude and watershed filters. And I want to use it on 3D series data as input and want 3D image as output.

Anybody has any solution for this problem?
^

Canny edge needs a float image type as output, e.g.:
using CannyType = itk::CannyEdgeDetectionImageFilter<ShortImageType, FloatImageType>;. It might also need input type to be float. You can start from a working example and modify it to suit your needs.

1 Like