[Insight-users] ITK windows compilation error

Kaiser, Adrien akaiser at email.unc.edu
Wed Jan 30 11:41:17 EST 2013


Hello everybody,

I try to compile a tool (dtiprocess) using ITK (ITKv4.3.0 from git://itk.org/ITK.git, commit from 12-16-2012 13:05:15) on Windows (Windows 7 with Visual Studio 208).
ITK compiled without any problem, but the tool fails to compile and gives me an error in one of the ITK classes:
"
1>Compiling...
1>tensorscalars.cxx
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(145) : error C2039: 'NumericTraits' : is not a member of 'itk::itk'
1>        C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(136) : while compiling class template member function 'void itk::VectorIndexSelectionCastImageFilter<TInputImage,TOutputImage>::BeforeThreadedGenerateData(void)'
1>        with
1>        [
1>            TInputImage=itk::Image<DeformationPixelType,3>,
1>            TOutputImage=RealImageType
1>        ]
1>        ..\..\dtiprocessTK\PrivateLibrary\tensorscalars.cxx(93) : see reference to class template instantiation 'itk::VectorIndexSelectionCastImageFilter<TInputImage,TOutputImage>' being compiled
1>        with
1>        [
1>            TInputImage=itk::Image<DeformationPixelType,3>,
1>            TOutputImage=RealImageType
1>        ]
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(145) : warning C4091: 'typedef ' : ignored on left of 'itk::NumericTraits' when no variable is declared
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(145) : error C2143: syntax error : missing ';' before '<'
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(145) : error C2143: syntax error : missing ';' before '<'
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(148) : error C2039: 'NumericTraits' : is not a member of 'itk::itk'
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(148) : warning C4091: 'typedef ' : ignored on left of 'itk::NumericTraits' when no variable is declared
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(148) : error C2143: syntax error : missing ';' before '<'
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(148) : error C2143: syntax error : missing ';' before '<'
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(148) : error C2039: 'ScalarRealType' : is not a member of '`global namespace''
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(152) : error C2065: 'PixelRealType' : undeclared identifier
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(152) : error C2070: ''unknown-type'': illegal sizeof operand
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(152) : error C2065: 'PixelScalarRealType' : undeclared identifier
1>C:\Devel\E-b\DTIAtlasBuilder-build\I4-i\include\ITK-4.3\itkVectorIndexSelectionCastImageFilter.h(152) : error C2070: ''unknown-type'': illegal sizeof operand
"

The part of the tool's code where the error appears is:
(tensorscalars.cxx:93)
"
#include "itkVectorIndexSelectionCastImageFilter.h"

 (...)

template<>
itk::Image<double, 3>::Pointer createLambda<double>(TensorImageType::Pointer timg, // Tensor image
                                                    EigenValueIndex lambdaind) // Lambda index
{
  // Not really a deformation image output jsut a 3-vector of doubles.
  typedef itk::FastSymmetricEigenAnalysisImageFilter<TensorImageType,DeformationImageType> LambdaFilterType;
  LambdaFilterType::Pointer lambdafilter = LambdaFilterType::New();
  lambdafilter->SetInput(timg);
  lambdafilter->OrderEigenValuesBy(LambdaFilterType::FunctorType::OrderByValue);
  lambdafilter->Update();

(l.93)  typedef itk::VectorIndexSelectionCastImageFilter<LambdaFilterType::OutputImageType, RealImageType> ElementSelectAdaptorType;
  ElementSelectAdaptorType::Pointer elementSelect = ElementSelectAdaptorType::New();
  elementSelect->SetInput(lambdafilter->GetOutput());
  // Reverse semanatics of lambda_1 from ITK.
  // In our convention lambda_1 is the largest eigenvalue whereas in
  // ITK its the smallest
  elementSelect->SetIndex(2 - lambdaind);
  elementSelect->Update();

  return elementSelect->GetOutput();
}
"

I did not write the tool myself, but I think the problem comes from the tool and not from ITK, I just can not figure out what I need to change to make it compile.
Does anyone have any ideas ?

Thanks,
Best Regards,

Adrien Kaiser
University of North Carolina at Chapel Hill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130130/68663573/attachment.htm>


More information about the Insight-users mailing list