[vtkusers] vtkImageReader copy

Brandi Pitta brandimichelle415 at gmail.com
Fri Jun 12 11:18:50 EDT 2009


Hello all,

I am trying to make a copy of the vtkImageReader's output

I have tried the following 2 situations:
copy = vtkImageData()
copy.DeepCopy(reader.GetOutput())

and

copy = vtkImageData()
copy.SetDimensions(x,y,z)
copy.SetOrigin(0,0,0)
copy.SetSpacing(1,1,1)
copy.SetScalarTypeToFloat()
copy.SetExtent(0,x-1, 0,y-1, 0,z-1)
copy.CopyAndCastFrom(reader.GetOutput(), 0,x-1, 0,y-1, 0,z-1)

In the first situation, the extent is not correct, so I cannot read
the actual data.  In other words, the extent does not become the
extent of the reader.

In the second situation, the data is all zeros, but that is not what
it is in the reader.

Any suggestions?

Thanks,
Brandi



More information about the vtkusers mailing list