Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concept checking error in itk2vol #390

Closed
phcerdan opened this issue Oct 16, 2020 · 2 comments
Closed

concept checking error in itk2vol #390

phcerdan opened this issue Oct 16, 2020 · 2 comments

Comments

@phcerdan
Copy link
Member

phcerdan commented Oct 16, 2020

The failing concept is from DGtal ITKWriter

Error:

[1/2] Building CXX object converters/CMakeFiles/itk2vol.dir/itk2vol.cpp.o
FAILED: converters/CMakeFiles/itk2vol.dir/itk2vol.cpp.o
In file included from DGtal/src/src/DGtal/base/CPredicate.h:45,
                 from DGtal/src/src/DGtal/kernel/BasicPointPredicates.h:50,
                 from DGtal/src/src/DGtal/kernel/domains/HyperRectDomain.h:49,
                 from DGtal/src/src/DGtal/helpers/StdDefs.h:47,
                 from DGtal/DGtalTools-src/converters/itk2vol.cpp:33:
DGtal/src/src/DGtal/base/CUnaryFunctor.h: In instantiation of ‘DGtal::concepts::CUnaryFunctor<X, A, R>::~CUnaryFunctor() [with X = DGtal::functors::Rescaling<double, unsigned char>; A = double; R = double]’:
/usr/include/boost/concept/detail/general.hpp:39:47:   required from ‘static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = DGtal::concepts::CUnaryFunctor<DGtal::functors::Rescaling<double, unsigned char>, double, double>]’
DGtal/src/src/DGtal/io/writers/ITKWriter.h:71:5:   required from ‘struct DGtal::ITKWriter<DGtal::ImageContainerBySTLVector<DGtal::HyperRectDomain<DGtal::SpaceND<3, int> >, double>, DGtal::functors::Rescaling<double, unsigned char> >’
DGtal/src/src/DGtal/io/writers/GenericWriter.ih:206:62:   required from ‘static bool DGtal::GenericWriter<TContainer, 3, unsigned char, TFunctor>::exportFile(const string&, const TContainer&, const string&, const TFunctor&) [with TContainer = DGtal::ImageContainerBySTLVector<DGtal::HyperRectDomain<DGtal::SpaceND<3, int> >, double>; TFunctor = DGtal::functors::Rescaling<double, unsigned char>; std::string = std::__cxx11::basic_string<char>]’
DGtal/DGtalTools-src/converters/itk2vol.cpp:143:69:   required from here
DGtal/src/src/DGtal/base/CUnaryFunctor.h:98:29: error: no matching function for call to ‘sameType(double&, unsigned char)’
   98 |       ConceptUtils::sameType( r, x.operator() ( a ) );
      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from DGtal/src/src/DGtal/base/Common.h:120,
                 from DGtal/DGtalTools-src/converters/itk2vol.cpp:32:
DGtal/src/src/DGtal/base/ConceptUtils.h:117:8: note: candidate: ‘template<class T> void DGtal::concepts::ConceptUtils::sameType(const T&, const T&)’
  117 |   void sameType( const T & /* t1 */, const T & /* t2 */ ) {}
      |        ^~~~~~~~
DGtal/src/src/DGtal/base/ConceptUtils.h:117:8: note:   template argument deduction/substitution failed:
In file included from DGtal/src/src/DGtal/base/CPredicate.h:45,
                 from DGtal/src/src/DGtal/kernel/BasicPointPredicates.h:50,
                 from DGtal/src/src/DGtal/kernel/domains/HyperRectDomain.h:49,
                 from DGtal/src/src/DGtal/helpers/StdDefs.h:47,
                 from DGtal/DGtalTools-src/converters/itk2vol.cpp:33:
DGtal/src/src/DGtal/base/CUnaryFunctor.h:98:29: note:   deduced conflicting types for parameter ‘const T’ (‘doubleandunsigned char’)
   98 |       ConceptUtils::sameType( r, x.operator() ( a ) );
      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
DGtal/src/src/DGtal/base/CUnaryFunctor.h: In instantiation of ‘DGtal::concepts::CUnaryFunctor<X, A, R>::~CUnaryFunctor() [with X = DGtal::functors::Rescaling<int, unsigned char>; A = int; R = int]’:
/usr/include/boost/concept/detail/general.hpp:39:47:   required from ‘static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = DGtal::concepts::CUnaryFunctor<DGtal::functors::Rescaling<int, unsigned char>, int, int>]’
DGtal/src/src/DGtal/io/writers/ITKWriter.h:71:5:   required from ‘struct DGtal::ITKWriter<DGtal::ImageContainerBySTLVector<DGtal::HyperRectDomain<DGtal::SpaceND<3, int> >, int>, DGtal::functors::Rescaling<int, unsigned char> >’
DGtal/src/src/DGtal/io/writers/GenericWriter.ih:206:62:   required from ‘static bool DGtal::GenericWriter<TContainer, 3, unsigned char, TFunctor>::exportFile(const string&, const TContainer&, const string&, const TFunctor&) [with TContainer = DGtal::ImageContainerBySTLVector<DGtal::HyperRectDomain<DGtal::SpaceND<3, int> >, int>; TFunctor = DGtal::functors::Rescaling<int, unsigned char>; std::string = std::__cxx11::basic_string<char>]’
DGtal/DGtalTools-src/converters/itk2vol.cpp:160:69:   required from here
DGtal/src/src/DGtal/base/CUnaryFunctor.h:98:29: error: no matching function for call to ‘sameType(int&, unsigned char)’
In file included from DGtal/src/src/DGtal/base/Common.h:120,
                 from DGtal/DGtalTools-src/converters/itk2vol.cpp:32:
DGtal/src/src/DGtal/base/ConceptUtils.h:117:8: note: candidate: ‘template<class T> void DGtal::concepts::ConceptUtils::sameType(const T&, const T&)’
  117 |   void sameType( const T & /* t1 */, const T & /* t2 */ ) {}
      |        ^~~~~~~~
DGtal/src/src/DGtal/base/ConceptUtils.h:117:8: note:   template argument deduction/substitution failed:
In file included from DGtal/src/src/DGtal/base/CPredicate.h:45,
                 from DGtal/src/src/DGtal/kernel/BasicPointPredicates.h:50,
                 from DGtal/src/src/DGtal/kernel/domains/HyperRectDomain.h:49,
                 from DGtal/src/src/DGtal/helpers/StdDefs.h:47,
                 from DGtal/DGtalTools-src/converters/itk2vol.cpp:33:
DGtal/src/src/DGtal/base/CUnaryFunctor.h:98:29: note:   deduced conflicting types for parameter ‘const T’ (‘intandunsigned char’)
   98 |       ConceptUtils::sameType( r, x.operator() ( a ) );
      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

It can be reproduced when DGtal option WITH_ITK is enabled.

@kerautret kerautret pinned this issue Dec 7, 2020
@kerautret
Copy link
Member

Thanks @phcerdan I will have look next week probably

@kerautret
Copy link
Member

thanks @phcerdan I reproduce it and have a workaround (just a problem on reading int type from .nii)

@kerautret kerautret mentioned this issue Apr 2, 2021
6 tasks
kerautret added a commit that referenced this issue Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants