[Insight-users] Problems with Insight Applications compilation

Luis Ibanez luis . ibanez at kitware . com
Thu, 11 Dec 2003 11:40:59 -0500


Hi Rodrigo,

The API for GetSpacing() and GetOrigin() has changed.

They are no longer raw pointers to double but an
itkPoint<> for Origin and an itkVector<> for spacing.

Please use the types:


ImageType::SpacingType spacing = image->GetSpacing();
ImageType::PointType   origin  = image->GetOrigin();

or

const ImageType::SpacingType & spacing = image->GetSpacing();
const ImageType::PointType   & origin  = image->GetOrigin();


Regards,


    Luis



-------------------------
Rodrigo Trujillo wrote:

> Hi,
>  
> I  updated all the code for the compilation of ITK through CVS 
>  (Insight, CableSwing, InsightApplications ).
> All had compiled well, but an error in InsightApplications ocurred, 
> during the compilation :
>  
>         File:  C:\InsightApplications\Morphogenesis\CellularAggregate.cxx
>         Line 863:      const double * spacing = 
> substrate->GetSpacing().GetDataPointer();
>  
>         Error:   "      left of '.GetDataPointer' must have 
> class/struct/union type"
>  
> I tried to solve this problem making:
>  
>         const double * spacing = 
> substrate->GetSpacing();//.GetDataPointer();
>  
> This solved the problem, but another error happened:
>  
>  
> --------------------Configuration: SNAPTests - Win32 
> Release--------------------
> Compiling...
> SnakeWrapper.cxx
> GUITestPadLogic.cxx
> C:\InsightApplications\SNAP\Testing\GUITestPadLogic.cxx(196) : error 
> C2664: 'void __thiscall itk::DiscreteGaussianImageFilter<class 
> itk::Image<float,3>,class itk::Image<float,3> >::SetMaximumError(const 
> class itk::FixedArray<double,3>)' : cannot convert parameter 1 from 
> 'float *' to 'const class itk::FixedArray<double,3>'
>         No constructor could take the source type, or constructor 
> overload resolution was ambiguous
> ImageWrapperTest.cxx
> Generating Code...
> Error executing cl.exe.
>  
> ALL_BUILD - 1 error(s), 0 warning(s)
>  
>  
> I believe that the error is in the code,  but i'm not certain of this. 
> I'm using:
>  
> Visual C++  6.0
> VTK - 4.2.2
> Python 2.3.2
> CMake 1.6 - patch 7
>  
>  
> Can someone help me ?
>  
> Thanks,
>  
> Rodrigo Trujillo