[ITK] [ITK-dev] Explicit Instantiation of PatchBasedDenoisingImageFilter causes compiler errors?

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jun 26 14:05:31 EDT 2014


I have seen that before. That is why this class is not wrapped with WrapITK. But it is wrapped with SimpleITK.

I believe and EnablelIf is required.

Brad

On Jun 26, 2014, at 1:53 PM, Williams, Norman K <norman-k-williams at uiowa.edu> wrote:

> The following two lines of code generates hundreds of lines of error messages:
> 
> #include "itkPatchBasedDenoisingImageFilter.h"
> template class itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >;
> 
> Interestingly enough, this code does not:
> 
> typedef itk::Image<float,3u> ImageType;
> typedef itk::PatchBasedDenoisingImageFilter<ImageType,ImageType> PDIFType;
> PDIFType::Pointer filter = PDIFType::New();
> 
> Here are the compiler errors:
> 
> make
> Scanning dependencies of target PatchBasedDenoisingTest
> [100%] Building CXX object CMakeFiles/PatchBasedDenoisingTest.dir/PatchBasedDenoisingTest.cxx.o
> In file included from /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:1:
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:337:62: error: no viable
>       conversion from 'const DiffusionTensor3D<PixelValueType>' to 'const PixelType' (aka 'const float')
>       ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(a, b, weight,
>                                                              ^
> /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:3:21: note: in instantiation of member
>       function 'itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3>, itk::Image<float, 3>
>       >::ComputeDifferenceAndWeightedSquaredNorm' requested here
> template class itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >; //Instantiated 9 times
>                     ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:501:80: note: passing
>       argument to parameter 'a' here
>   void ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(const PixelType& a, const PixelType& b,
>                                                                                ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:372:39: error: no viable
>       conversion from 'const DiffusionTensor3D<RealValueType>' to 'const RealType' (aka 'const double')
>       return this->AddEuclideanUpdate(a, b);
>                                       ^
> /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:3:21: note: in instantiation of member
>       function 'itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3>, itk::Image<float, 3> >::AddUpdate' requested here
> template class itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >; //Instantiated 9 times
>                     ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:524:47: note: passing
>       argument to parameter 'a' here
>   RealType AddEuclideanUpdate(const RealType& a, const RealType& b);
>                                               ^
> In file included from /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:1:
> In file included from /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:541:
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:784:5: error: called
>       object type 'PixelType' (aka 'float') is not a function or function pointer
>     identityTensor(ii,ii) = NumericTraits<PixelValueType>::One;
>     ^~~~~~~~~~~~~~
> /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:3:21: note: in instantiation of member
>       function 'itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3>, itk::Image<float, 3> >::ThreadedRiemannianMinMax'
>       requested here
> template class itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >; //Instantiated 9 times
>                     ^
> In file included from /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:1:
> In file included from /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:541:
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1067:20: error: type
>       'PixelType' (aka 'float') cannot be used prior to '::' because it has no members
>   typedef typename PixelType::MatrixType            MatrixType;
>                    ^
> /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:3:21: note: in instantiation of member
>       function 'itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3>, itk::Image<float, 3>
>       >::ComputeLogMapAndWeightedSquaredGeodesicDifference' requested here
> template class itk::PatchBasedDenoisingImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >; //Instantiated 9 times
>                     ^
> In file included from /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:1:
> In file included from /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:541:
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1068:20: error: type
>       'RealType' (aka 'double') cannot be used prior to '::' because it has no members
>   typedef typename RealType::EigenValuesArrayType   RealEigenValuesArrayType;
>                    ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1069:20: error: type
>       'RealType' (aka 'double') cannot be used prior to '::' because it has no members
>   typedef typename RealType::EigenVectorsMatrixType RealEigenVectorsMatrixType;
>                    ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1070:20: error: type
>       'RealType' (aka 'double') cannot be used prior to '::' because it has no members
>   typedef typename RealType::MatrixType             RealMatrixType;
>                    ^
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1132:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[0] = ( eigenVecs(0,0) * factor0 + eigenVecs(0,1) * factor1 + eigenVecs(0,2) * factor2 ) / eigenVals[0];
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1133:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[1] = ( eigenVecs(1,0) * factor0 + eigenVecs(1,1) * factor1 + eigenVecs(1,2) * factor2 ) / std::sqrt(
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1135:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[2] = ( eigenVecs(2,0) * factor0 + eigenVecs(2,1) * factor1 + eigenVecs(2,2) * factor2 ) / std::sqrt(
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1142:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[3] = ( eigenVecs(1,0) * factor0 + eigenVecs(1,1) * factor1 + eigenVecs(1,2) * factor2 ) / eigenVals[1];
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1143:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[4] = ( eigenVecs(2,0) * factor0 + eigenVecs(2,1) * factor1 + eigenVecs(2,2) * factor2 ) / std::sqrt(
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1150:3: error: 
>       subscripted value is not an array, pointer, or vector
>   Y[5] = ( eigenVecs(2,0) * factor0 + eigenVecs(2,1) * factor1 + eigenVecs(2,2) * factor2 ) / eigenVals[2];
>   ^ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1154:5: error: no
>       matching member function for call to 'Compute3x3EigenAnalysis'
>     Compute3x3EigenAnalysis(Y, YEigenVals, YEigenVecs);
>     ^~~~~~~~~~~~~~~~~~~~~~~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:520:8: note: candidate
>       template ignored: could not match 'DiffusionTensor3D<type-parameter-0-0>' against 'double'
>   void Compute3x3EigenAnalysis(const DiffusionTensor3D<TensorValueT>& spdMatrix,
>        ^
> In file included from /scratch/kent/itktest/PatchBasedDenoisingTest/src/PatchBasedDenoisingTest.cxx:1:
> In file included from /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.h:541:
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1177:5: error: 
>       subscripted value is not an array, pointer, or vector
>     YEigenVals[ii] = std::log(vnl_math_max(RealValueType(1e-15),YEigenVals[ii]) );
>     ^~~~~~~~~~ ~~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1182:34: error: 
>       subscripted value is not an array, pointer, or vector
>   const RealValueType YEigVal0 = YEigenVals[0];
>                                  ^~~~~~~~~~ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1183:34: error: 
>       subscripted value is not an array, pointer, or vector
>   const RealValueType YEigVal1 = YEigenVals[1];
>                                  ^~~~~~~~~~ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1184:34: error: 
>       subscripted value is not an array, pointer, or vector
>   const RealValueType YEigVal2 = YEigenVals[2];
>                                  ^~~~~~~~~~ ~
> /scratch/kent/itktest/ITK/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx:1186:49: error: called
>       object type 'RealEigenVectorsMatrixType' (aka 'int') is not a function or function pointer
>   const RealValueType temp00 = eigenVecs(0,0) * YEigenVecs(0,0) * eigVal0 +
>                                                 ^~~~~~~~~~
> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 20 errors generated.
> make[2]: *** [CMakeFiles/PatchBasedDenoisingTest.dir/PatchBasedDenoisingTest.cxx.o] Error 1
> make[1]: *** [CMakeFiles/PatchBasedDenoisingTest.dir/all] Error 2
> make: *** [all] Error 2
> 
> Compilation exited abnormally with code 2 at Thu Jun 26 12:35:30
> 
> 
> 
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140626/8b8f3906/attachment-0002.html>
-------------- next part --------------
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list