I’m compiling ITK-SNAP with ITK 5.4-rc.2 and start getting following errors from this line.
Similar errors also occur when using ImageFileWriter and ImageAlgorithm etc. with RLEImage. The project is still using the local version of the RLEImage code instead of the itkRLEImage module. Are there any changes I can make to fix this or do you recommend we start using the remote RLE module instead. Any suggestions are appreciated!
In file included from /Users/jileihao/dev/itksnap-dev/itksnap/Logic/Mesh/MultiLabelMeshPipeline.cxx:50:
In file included from /Users/jileihao/tk/itk/installed/include/ITK-5.4/itkBinaryThresholdImageFilter.h:21:
In file included from /Users/jileihao/tk/itk/installed/include/ITK-5.4/itkUnaryFunctorImageFilter.h:145:
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkUnaryFunctorImageFilter.hxx:88:30: error: no viable constructor or deduction guide for deduction of template arguments of 'ImageScanlineConstIterator'
ImageScanlineConstIterator inputIt(inputPtr, inputRegionForThread);
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkBinaryThresholdImageFilter.h:221:3: note: in instantiation of member function 'itk::UnaryFunctorImageFilter<RLEImage<unsigned short, 3>, itk::Image<float, 3>, itk::Functor::BinaryThreshold<unsigned short, float>>::DynamicThreadedGenerateData' requested here
BinaryThresholdImageFilter();
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkBinaryThresholdImageFilter.h:150:15: note: in instantiation of member function 'itk::BinaryThresholdImageFilter<RLEImage<unsigned short, 3>, itk::Image<float, 3>>::BinaryThresholdImageFilter' requested here
itkNewMacro(Self);
^
/Users/jileihao/dev/itksnap-dev/itksnap/Logic/Mesh/MultiLabelMeshPipeline.cxx:63:40: note: in instantiation of member function 'itk::BinaryThresholdImageFilter<RLEImage<unsigned short, 3>, itk::Image<float, 3>>::New' requested here
m_ThrehsoldFilter = ThresholdFilter::New();
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:106:3: note: candidate template ignored: substitution failure [with TImage = RLEImage<unsigned short, 3>]: cannot reference member of primary template because deduced class template specialization 'ImageScanlineConstIterator<RLEImage<unsigned short, 3>>' is instantiated from a partial specialization
ImageScanlineConstIterator(const TImage * ptr, const RegionType & region)
^ ~~~~~~~~~~
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:267:1: note: candidate template ignored: could not match 'SmartPointer<type-parameter-0-0>' against 'const RLEImage<unsigned short, 3> *'
ImageScanlineConstIterator(SmartPointer<TImage>, const typename TImage::RegionType &)
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:119:3: note: candidate function template not viable: requires single argument 'it', but 2 arguments were provided
ImageScanlineConstIterator(const ImageIterator<TImage> & it)
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:135:3: note: candidate function template not viable: requires single argument 'it', but 2 arguments were provided
ImageScanlineConstIterator(const ImageConstIterator<TImage> & it)
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:64:27: note: candidate function template not viable: requires 1 argument, but 2 were provided
class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator<TImage>
^
/Users/jileihao/tk/itk/installed/include/ITK-5.4/itkImageScanlineConstIterator.h:97:3: note: candidate function template not viable: requires 0 arguments, but 2 were provided
ImageScanlineConstIterator()
^
1 error generated.
I did some experiments with the remote module today. And the template deduction issue persists once I plug it in. Here’s a testing program, and it reports same error as mentioned above. Any thoughts on where could the issue be?
[ 50%] Building CXX object CMakeFiles/RLETest.dir/main.cxx.o
In file included from /Users/jileihao/dev/sandbox/RLETest/main.cxx:9:
In file included from /Users/jileihao/dev/itk-dev/itk/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.h:21:
In file included from /Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkUnaryFunctorImageFilter.h:145:
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkUnaryFunctorImageFilter.hxx:88:30: error: no viable constructor or deduction guide for deduction of template arguments of ‘ImageScanlineConstIterator’
ImageScanlineConstIterator inputIt(inputPtr, inputRegionForThread);
^
/Users/jileihao/dev/itk-dev/itk/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.h:221:3: note: in instantiation of member function ‘itk::UnaryFunctorImageFilter<itk::RLEImage<short, 3>, itk::Image<float, 3>, itk::Functor::BinaryThreshold<short, float>>::DynamicThreadedGenerateData’ requested here
BinaryThresholdImageFilter();
^
/Users/jileihao/dev/itk-dev/itk/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.h:150:15: note: in instantiation of member function ‘itk::BinaryThresholdImageFilter<itk::RLEImage<short, 3>, itk::Image<float, 3>>::BinaryThresholdImageFilter’ requested here
itkNewMacro(Self);
^
/Users/jileihao/dev/sandbox/RLETest/main.cxx:78:91: note: in instantiation of member function ‘itk::BinaryThresholdImageFilter<itk::RLEImage<short, 3>, itk::Image<float, 3>>::New’ requested here
auto fltThreshold = itk::BinaryThresholdImageFilter<shortRLEImage, Float3DImageType>::New();
^
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:106:3: note: candidate template ignored: substitution failure [with TImage = itk::RLEImage<short, 3>]: cannot reference member of primary template because deduced class template specialization ‘ImageScanlineConstIterator<itk::RLEImage<short, 3>>’ is instantiated from a partial specialization
ImageScanlineConstIterator(const TImage * ptr, const RegionType & region)
^ ~~~~~~~~~~
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:267:1: note: candidate template ignored: could not match ‘SmartPointer’ against ‘const itk::RLEImage<short, 3> *’
ImageScanlineConstIterator(SmartPointer, const typename TImage::RegionType &)
^
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:119:3: note: candidate function template not viable: requires single argument ‘it’, but 2 arguments were provided
ImageScanlineConstIterator(const ImageIterator & it)
^
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:135:3: note: candidate function template not viable: requires single argument ‘it’, but 2 arguments were provided
ImageScanlineConstIterator(const ImageConstIterator & it)
^
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:64:27: note: candidate function template not viable: requires 1 argument, but 2 were provided
class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator
^
/Users/jileihao/dev/itk-dev/itk/Modules/Core/Common/include/itkImageScanlineConstIterator.h:97:3: note: candidate function template not viable: requires 0 arguments, but 2 were provided
ImageScanlineConstIterator()
^
1 error generated.
make[2]: *** [CMakeFiles/RLETest.dir/main.cxx.o] Error 1
make[1]: *** [CMakeFiles/RLETest.dir/all] Error 2
make: *** [all] Error 2
Build started at 19:20...
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>1>Checking Build System
1>CMake is re-running because C:/Misc/Tester/CMakeFiles/generate.stamp is out-of-date.
1> the file 'C:/Dev/ITK-vs22/ITKConfig.cmake'
1> is newer than 'C:/Misc/Tester/CMakeFiles/generate.stamp.depend'
1> result='-1'
1>-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
1>-- ITK is setting tester's MSVC_RUNTIME_LIBRARY to dynamic
1>-- Configuring done (0.3s)
1>-- Generating done (0.1s)
1>-- Build files have been written to: C:/Misc/Tester
2>------ Build started: Project: tester, Configuration: Debug x64 ------
2>tester.cpp
2>tester.vcxproj -> C:\Misc\Tester\Debug\tester.exe
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========
========== Build completed at 19:21 and took 07.606 seconds ==========
Sorry for being late! Did ImageScanlineConstIterator support RLEImage before? I’m asking, because I just gave it a try, and got: itkImageConstIterator.h(117,43): error C2039: 'PixelContainer': is not a member of 'itk::RLEImage<unsigned short,3,unsigned short>'