[Insight-users] ITK windows compilation error
Matt McCormick
matt.mccormick at kitware.com
Wed Jan 30 13:46:31 EST 2013
Hi Adrien,
Please test and review this patch:
http://review.source.kitware.com/#/c/9534/
Thanks,
Matt
On Wed, Jan 30, 2013 at 5:17 PM, Kaiser, Adrien <akaiser at email.unc.edu> wrote:
> Hi Brad,
>
> Thank you for your answer.
>
> I included "itkNumericTraits.h", and it did not change the error.
>
> Something I forgot to precise is that the tool compiles without errors on
> linux (Ubuntu 12.10) and Mac, so I think it is specific to the compiler from
> Visual Studio 2008.
>
> The weird part is that it seems to look for NumericTraits in "itk::itk",
> which I assume is wrong:
>
> "
> error C2039: 'NumericTraits' : is not a member of 'itk::itk'
> "
> I have no idea of where it can come from.
>
> By the way, the code of my tool is here. The file "tensorscalars.cxx" is in
> PrivateLibrary/tensorscalars.cxx
>
> Thanks,
> Adrien
>
> ________________________________
> From: Bradley Lowekamp [blowekamp at mail.nih.gov]
> Sent: Wednesday, January 30, 2013 12:01 PM
> To: Kaiser, Adrien
> Subject: Re: [Insight-users] ITK windows compilation error
>
> Hello,
>
> My first guess would be that it's a missing include.
>
> Did you including "itkNumericTraits.h" before
> itkVectorIndexSelectionCastImageFilter.h. If that is the problem then it
> looks like there is a missing include in the ITK header.
>
> Brad
>
> On Jan 30, 2013, at 11:41 AM, "Kaiser, Adrien" <akaiser at email.unc.edu>
> wrote:
>
> 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
> _____________________________________
> 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://www.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://www.itk.org/mailman/listinfo/insight-users
>
>
>
> _____________________________________
> 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://www.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://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list