[Insight-users] itkVTKImageToImageFilter

Yan Pingkun engp1734 at nus.edu.sg
Tue, 23 Mar 2004 14:09:38 +0800


This is a multi-part message in MIME format.

------_=_NextPart_001_01C4109D.6BF94CB7
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Dear all,
=20
In my project, I need to convert vtk image to itk image. So I write
following program:
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
VtkImageToItkImageFilterType::Pointer v2iFilter =3D
VtkImageToItkImageFilterType::New();
v2iFilter->SetInput(stencil->GetOutput());
this->m_pItkImage =3D v2iFilter->GetImporter()->GetOutput();
v2iFilter->GetImporter()->Update();
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
Then I encountered two problems. The first is compiling error:
error C2977: 'VTKImageImport' : too many template arguments
I found that the VTKImageImport file under basicfilters folder has been
updated. But the=20
file "itkVTKImageToImageFilter.h" is still using the old interface. So I
modified it and this error disappear.
=20
The second problem is run time error. The program always crash when is
comes to
v2iFilter->GetImporter()->Update();
=20
Any body can help? Thanks!
=20
Regards,
Pingkun
=20
To Mathieu: My problem may not caused by vtkImageStencil but by this
filter...

------_=_NextPart_001_01C4109D.6BF94CB7
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>Dear=20
all,</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>In my =
project, I=20
need to convert vtk image to itk image. So I write following=20
program:</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></S=
PAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>VtkImageToItkImageFilterType::Pointer v2iFilter =3D=20
VtkImageToItkImageFilterType::New();<BR>v2iFilter-&gt;SetInput(stencil-&g=
t;GetOutput());<BR>this-&gt;m_pItkImage=20
=3D=20
v2iFilter-&gt;GetImporter()-&gt;GetOutput();<BR>v2iFilter-&gt;GetImporter=
()-&gt;Update();</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></S=
PAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>Then I =
encountered=20
two problems. The first is compiling error:</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>error =
C2977:=20
'VTKImageImport' : too many template arguments</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>I =
found that the=20
VTKImageImport file under basicfilters folder has been updated. But the=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>file=20
"itkVTKImageToImageFilter.h" is still using the old interface. So I =
modified it=20
and this error disappear.</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>The =
second problem=20
is run time error. The program always crash when is comes =
to</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>v2iFilter-&gt;GetImporter()-&gt;Update();</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>Any =
body can help?=20
Thanks!</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2>Pingkun</FONT></SPAN></DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D599240106-23032004><FONT face=3DArial size=3D2>To =
Mathieu: My=20
problem may not caused by vtkImageStencil but by this=20
filter...</FONT></SPAN></DIV></BODY></HTML>

------_=_NextPart_001_01C4109D.6BF94CB7--