[vtkusers] How to make vtkImagefrom vtkTIFFReader resize

Kenneth Evans evans at aps.anl.gov
Tue May 20 16:18:33 EDT 2008


I am reading and rereading TIFF images of different sizes (this is in
Python, but it should not matter):

 

    reader = vtk.vtkTIFFReader()

    reader.SetFileName(filename)

    reader.Update()

 

    actor = vtk.vtkImageActor()

    actor.SetInput(reader.GetOutput())

    actor.SetVisibility(1)

    ren.AddActor(actor)

 

I want to read a new image:

 

      reader.SetFileName(filename)

      reader.Update()

 

This works fine, except the output = reader.GetOutput() which is a vtkImage
retains the old size.

 

output.GetExtent() returns the original extent.

output.GetWholeExtent() returns the new extent

 

but

 

output.SetExtent(output.GetWholeExtent()) crashes.

 

How to I reset the vtkImage extent (without creating a new actor)?

 

Thanks,

 

 

        -Ken

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080520/6db0db0f/attachment.htm>


More information about the vtkusers mailing list