[Insight-developers] itkVTKImageWriter

Damion Shelton dmsst59+@pitt.edu
Tue, 22 May 2001 16:54:28 -0400


Is there any reason not to make the following changes to itkVTKImageWriter:

00255       *fp << inIt.Get() << " ";

to

00255       *fp << inIt.Get().GetScalar() << " ";

and

00263       scalarType foo = inIt.Get();

to

00263       scalarType foo = inIt.Get().GetScalar();

This allows you to write any pixel type that supports a GetScalar call which
returns a valid VTK type. For instance, the scalar portion of an
itkScalarVector can be written to a VTK file with these changes, but not
under the current system.

A side effect (I think) of this will be the inability to write images of
simple types - you now must use explicit itk::Scalar<> calls when creating
an image. Let me know if this conflicts with your code; if not, I'll go
ahead and commit the change.

Thanks,

-Damion-