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

Williams, Norman K norman-k-williams at uiowa.edu
Thu Jun 26 13:53:08 EDT 2014


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.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20140626/653391b4/attachment.html>


More information about the Insight-developers mailing list