[Insight-developers] VTKImageIO and ImageFileWriter

Robert Tamburo rjtst21+@pitt.edu
Mon, 18 Mar 2002 09:40:41 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0032_01C1CE60.F7C32C30
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Are these classes still working correctly?

Previously, I was able to view the generated file with the following =
code:
itk::VTKImageIO::Pointer vtkIO;
vtkIO =3D itk::VTKImageIO::New();
itk::ImageFileWriter<TImageType>::Pointer writer;
writer =3D itk::ImageFileWriter<TImageType>::New();
writer->SetInput(sourceImage);
writer->SetFileName("ellipsoid.vtk");
writer->SetImageIO(vtkIO);
writer->Write();

However, the file does not seem to be a valid VTK image file anymore.  =
The headers of the file is:

# vtk DataFile Version 3.0
VTK File Generated by Insight Segmentation and Registration Toolkit =
(ITK)
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 50 50 50
SPACING 1 1 1
ORIGIN 0 0 0
POINT_DATA 125000
SCALARS scalars unsigned_char 1
LOOKUP_TABLE default
=E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC=20
=E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC=20
=E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC =E2=82=AC=20
.
.
.
repeating=20

Am I setting everything correctly?

Here's the image file that it generated - =
http://viaserver.bioe.pitt.edu/ellipsoid.vtk

Thanks
-Rob

------=_NextPart_000_0032_01C1CE60.F7C32C30
Content-Type: text/html;
	charset="utf-8"
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=3Dutf-8">
<META content=3D"MSHTML 5.50.4912.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2><FONT size=3D2>Are these classes still working=20
correctly?</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2>Previously, I was able to view the =
generated file=20
with the following code:</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>itk::VTKImageIO::Pointer =
vtkIO;<BR>vtkIO =3D=20
itk::VTKImageIO::New();<BR>itk::ImageFileWriter&lt;TImageType&gt;::Pointe=
r=20
writer;<BR>writer =3D=20
itk::ImageFileWriter&lt;TImageType&gt;::New();<BR>writer-&gt;SetInput(sou=
rceImage);<BR>writer-&gt;SetFileName("ellipsoid.vtk");<BR>writer-&gt;SetI=
mageIO(vtkIO);<BR>writer-&gt;Write();<BR></FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>However, the file does not seem to be =
a valid VTK=20
image file anymore.&nbsp; The headers of the file =
is:</FONT></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><FONT size=3D2># vtk DataFile Version =
3.0</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>VTK File Generated by Insight =
Segmentation and=20
Registration Toolkit (ITK)</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>ASCII</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>DATASET =
STRUCTURED_POINTS</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>DIMENSIONS 50 50 =
50</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>SPACING 1 1 1</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>ORIGIN 0 0 0</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>POINT_DATA 125000</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>SCALARS scalars unsigned_char=20
1</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>LOOKUP_TABLE =
default</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>=E2=82=AC =E2=82=AC =E2=82=AC =
=E2=82=AC =E2=82=AC =E2=82=AC </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>=E2=82=AC =E2=82=AC =E2=82=AC =
=E2=82=AC =E2=82=AC =E2=82=AC </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT size=3D2>=E2=82=AC =E2=82=AC =E2=82=AC =
=E2=82=AC =E2=82=AC =E2=82=AC </FONT></FONT></DIV>
<DIV><FONT size=3D2>.</FONT></DIV>
<DIV><FONT size=3D2>.</FONT></DIV>
<DIV><FONT size=3D2>.</FONT></DIV>
<DIV><FONT size=3D2>repeating </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Am I setting everything correctly?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Here's the image file that it generated - <A=20
href=3D"http://viaserver.bioe.pitt.edu/ellipsoid.vtk">http://viaserver.bi=
oe.pitt.edu/ellipsoid.vtk</A></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Thanks</FONT></DIV>
<DIV><FONT size=3D2>-Rob</FONT></DIV></BODY></HTML>

------=_NextPart_000_0032_01C1CE60.F7C32C30--