[vtkusers] How to make vtkImagefrom vtkTIFFReader resize

Vidyadhar vidyadhar at lucidindia.com
Wed May 21 07:40:28 EDT 2008


Hi,
I have a suggestion. After reader.Update() call, try reader.GetOutput().Update(). This is supposed to update bounds, extents, et cetera.
HTH
Vidyadhar
  ----- Original Message ----- 
  From: Kenneth Evans 
  To: vtkusers at vtk.org 
  Sent: Wednesday, May 21, 2008 1:48 AM
  Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize


  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

   



------------------------------------------------------------------------------


  _______________________________________________
  This is the private VTK discussion list.
  Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
  Follow this link to subscribe/unsubscribe:
  http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080521/11228fee/attachment.htm>


More information about the vtkusers mailing list