[Insight-users] itkGradientVectorFlowImageFilter problems at compilation

Julien Mercenier itk_julienmercenier at hotmail.com
Sun, 11 Apr 2004 18:53:00 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C41FF6.360DB3A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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"=20

#include "itkRescaleIntensityImageFilter.h"

#include "itkPoint.h"

main...
    ...

 const     unsigned int    Dimension =3D 3; =20
 typedef   double          PixelType;=20
 typedef itk::Image<PixelType, Dimension>      ImageType;=20

 typedef itk::CovariantVector< double, Dimension >  GradientPixelType;
 typedef itk::Image< GradientPixelType, Dimension > GradientImageType;
  =20
 typedef =
itk::GradientMagnitudeRecursiveGaussianImageFilter<ImageType,ImageType>  =
 =20
  GradientMagnitudeFilterType;
 typedef itk::GradientVectorFlowImageFilter<ImageType, =
GradientImageType>
  GradientVectorFlowFilterType;
 =20
 typedef itk::ImageFileReader< ImageType       >  ReaderType;
 ReaderType::Pointer       imageReader   =3D  ReaderType::New();

 imageReader->SetFileName( "cible2.img");
  =20
 GradientMagnitudeFilterType::Pointer  gradientMagnitudeFilter           =
                             =20
  =3D GradientMagnitudeFilterType::New();

 GradientVectorFlowFilterType::Pointer gradientVectorFlowFilter
  =3D GradientVectorFlowFilterType::New();

 gradientMagnitudeFilter->SetInput( imageReader->GetOutput() );=20
 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.
------=_NextPart_000_0005_01C41FF6.360DB3A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi everyone,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; I've got problems with=20
itkGradientVectorFlowImageFilter.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; I've tried many things but do not understand the =
error=20
message.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here is the part of&nbsp; my code =
related to this=20
filter :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#include=20
"itkGradientMagnitudeRecursiveGaussianImageFilter.h"&nbsp;&nbsp;&nbsp; =
//egdes=20
<BR>#include "itkGradientVectorFlowImageFilter.h"</FONT></DIV><FONT =
face=3DArial=20
size=3D2>
<DIV><BR>#include "itkImage.h"</DIV>
<DIV>&nbsp;</DIV>
<DIV>#include "itkCovariantVector.h"</DIV>
<DIV>&nbsp;</DIV>
<DIV>#include "itkImageFileReader.h" </DIV>
<DIV>&nbsp;</DIV>
<DIV>#include "itkRescaleIntensityImageFilter.h"</DIV>
<DIV>&nbsp;</DIV>
<DIV>#include "itkPoint.h"</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>main</STRONG>...</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;const&nbsp;&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp;=20
Dimension =3D 3;&nbsp; <BR>&nbsp;typedef&nbsp;&nbsp;=20
double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PixelType;=20
<BR>&nbsp;typedef itk::Image&lt;PixelType,=20
Dimension&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageType;&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;typedef itk::CovariantVector&lt; double, Dimension &gt;&nbsp; =

GradientPixelType;<BR>&nbsp;typedef itk::Image&lt; GradientPixelType, =
Dimension=20
&gt; GradientImageType;<BR>&nbsp;&nbsp; <BR>&nbsp;typedef=20
itk::GradientMagnitudeRecursiveGaussianImageFilter&lt;ImageType,ImageType=
&gt;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;GradientMagnitudeFilterType;<BR>&nbsp;typedef=20
itk::GradientVectorFlowImageFilter&lt;ImageType,=20
GradientImageType&gt;<BR>&nbsp;&nbsp;GradientVectorFlowFilterType;<BR>&nb=
sp;=20
<BR>&nbsp;typedef itk::ImageFileReader&lt;=20
ImageType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;=20
ReaderType;<BR>&nbsp;ReaderType::Pointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
imageReader&nbsp;&nbsp; =3D&nbsp; ReaderType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;imageReader-&gt;SetFileName( "cible2.img");<BR>&nbsp;&nbsp;=20
<BR>&nbsp;GradientMagnitudeFilterType::Pointer&nbsp;=20
gradientMagnitudeFilter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;=3D GradientMagnitudeFilterType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;GradientVectorFlowFilterType::Pointer=20
gradientVectorFlowFilter<BR>&nbsp;&nbsp;=3D=20
GradientVectorFlowFilterType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;gradientMagnitudeFilter-&gt;SetInput( =
imageReader-&gt;GetOutput() );=20
<BR>&nbsp;gradientMagnitudeFilter-&gt;SetSigma( 1.0 );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;gradientVectorFlowFilter-&gt;SetInput(=20
gradientMagnitudeFilter-&gt;GetOutput());<BR>&nbsp;gradientVectorFlowFilt=
er-&gt;SetTimeStep(1.0);<BR>&nbsp;gradientVectorFlowFilter-&gt;SetNoiseLe=
vel(0.1);<BR>&nbsp;gradientVectorFlowFilter-&gt;SetIterationNum(20);<BR><=
BR>&nbsp;gradientVectorFlowFilter-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>the first lignes of the error message is :</DIV>
<DIV>&nbsp;</DIV>
<DIV>--------------------Configuration: ferrantsansfixeGVF - Win32=20
Debug--------------------<BR>Compiling...<BR>ferrantsansfixeGVF.cxx<BR>J:=
\Documents=20
and Settings\Administrateur\Mes=20
documents\cours\TFE\ITK\Code\Algorithms\itkGradientVectorFlowImageFilter.=
txx(115)=20
: error C2109: subscript requires array or pointer=20
type<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; J:\Documents and=20
Settings\Administrateur\Mes =
documents\cours\TFE\ITK\Code\Common\itkSize.h(177) :=20
while compiling class-template member function 'void __thiscall=20
itk::GradientVectorFlowImageFilter&lt;class =
itk::Image&lt;double,3&gt;,class=20
itk::Image&lt;<BR>class itk::CovariantVector&lt;double,3&gt;,3&gt;=20
&gt;::InitInterImage(void)'</DIV>
<DIV>J:\Documents and Settings\Administrateur\Mes=20
documents\cours\TFE\ITK\Code\Algorithms\itkGradientVectorFlowImageFilter.=
txx(135)=20
: error C2109: subscript requires array or pointer=20
type<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; J:\Documents and=20
Settings\Administrateur\Mes =
documents\cours\TFE\ITK\Code\Common\itkSize.h(177) :=20
while compiling class-template member function 'void __thiscall=20
itk::GradientVectorFlowImageFilter&lt;class =
itk::Image&lt;double,3&gt;,class=20
itk::Image&lt;<BR>class itk::CovariantVector&lt;double,3&gt;,3&gt;=20
&gt;::InitInterImage(void)'</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance for your answers...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Best=20
regards.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Julien, Belgium.</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C41FF6.360DB3A0--