[Insight-users] itkGradientVectorFlowImageFilter problems at compilation

Luis Ibanez luis.ibanez at kitware.com
Sun, 11 Apr 2004 13:13:42 -0400


Hi Julien,

What version of ITK are you using ?

The current test for this filter is working
fine on the Dashboard...

Could you please post a minimal (but complete)
example of code that is producing this compiler
error.


Thanks


    Luis


-------------------------
Julien Mercenier wrote:

> Hi everyone,
>  
>             I've got problems with itkGradientVectorFlowImageFilter.
>             I've tried many things but do not understand the error message.
>  
> Here is the part of  my code related to this filter :
>  
> #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"    //egdes
> #include "itkGradientVectorFlowImageFilter.h"
> 
> #include "itkImage.h"
>  
> #include "itkCovariantVector.h"
>  
> #include "itkImageFileReader.h"
>  
> #include "itkRescaleIntensityImageFilter.h"
>  
> #include "itkPoint.h"
>  
> *main*...
>     ...
>  
>  const     unsigned int    Dimension = 3; 
>  typedef   double          PixelType;
>  typedef itk::Image<PixelType, Dimension>      ImageType; 
>  
>  typedef itk::CovariantVector< double, Dimension >  GradientPixelType;
>  typedef itk::Image< GradientPixelType, Dimension > GradientImageType;
>   
>  typedef 
> itk::GradientMagnitudeRecursiveGaussianImageFilter<ImageType,ImageType>   
>   GradientMagnitudeFilterType;
>  typedef itk::GradientVectorFlowImageFilter<ImageType, GradientImageType>
>   GradientVectorFlowFilterType;
>  
>  typedef itk::ImageFileReader< ImageType       >  ReaderType;
>  ReaderType::Pointer       imageReader   =  ReaderType::New();
>  
>  imageReader->SetFileName( "cible2.img");
>   
>  GradientMagnitudeFilterType::Pointer  
> gradientMagnitudeFilter                                        
>   = GradientMagnitudeFilterType::New();
>  
>  GradientVectorFlowFilterType::Pointer gradientVectorFlowFilter
>   = GradientVectorFlowFilterType::New();
>  
>  gradientMagnitudeFilter->SetInput( imageReader->GetOutput() );
>  gradientMagnitudeFilter->SetSigma( 1.0 );
>  
>  gradientVectorFlowFilter->SetInput( gradientMagnitudeFilter->GetOutput());
>  gradientVectorFlowFilter->SetTimeStep(1.0);
>  gradientVectorFlowFilter->SetNoiseLevel(0.1);
>  gradientVectorFlowFilter->SetIterationNum(20);
> 
>  gradientVectorFlowFilter->Update();
>  
>  
>  
> the first lignes of the error message is :
>  
> --------------------Configuration: ferrantsansfixeGVF - Win32 
> Debug--------------------
> Compiling...
> ferrantsansfixeGVF.cxx
> J:\Documents and Settings\Administrateur\Mes 
> documents\cours\TFE\ITK\Code\Algorithms\itkGradientVectorFlowImageFilter.txx(115) 
> : error C2109: subscript requires array or pointer type
>         J:\Documents and Settings\Administrateur\Mes 
> documents\cours\TFE\ITK\Code\Common\itkSize.h(177) : while compiling 
> class-template member function 'void __thiscall 
> itk::GradientVectorFlowImageFilter<class itk::Image<double,3>,class 
> itk::Image<
> class itk::CovariantVector<double,3>,3> >::InitInterImage(void)'
> J:\Documents and Settings\Administrateur\Mes 
> documents\cours\TFE\ITK\Code\Algorithms\itkGradientVectorFlowImageFilter.txx(135) 
> : error C2109: subscript requires array or pointer type
>         J:\Documents and Settings\Administrateur\Mes 
> documents\cours\TFE\ITK\Code\Common\itkSize.h(177) : while compiling 
> class-template member function 'void __thiscall 
> itk::GradientVectorFlowImageFilter<class itk::Image<double,3>,class 
> itk::Image<
> class itk::CovariantVector<double,3>,3> >::InitInterImage(void)'
>  
>  
> Thanks in advance for your answers...
>  
>             Best regards.
>  
>     Julien, Belgium.