[vtkusers] How to make vtkImagefrom vtkTIFFReader resize

Kenneth Evans evans at aps.anl.gov
Wed May 21 12:29:17 EDT 2008


When I do that:

 

      reader.SetFileName(self.filename)

      reader.Update()

      reader.GetOutput().Update()

 

I get this error (multiple times):

 

ERROR: In ..\..\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 628

vtkStreamingDemandDrivenPipeline (01026E70): The update extent specified in
the information for output port 0 on algorithm vtkTIFFReader(01026510) is 0
498 0 749 0 0, which is outside the whole extent 0 499 0 329 0 0.

 

        -Ken

  _____  

From: Vidyadhar [mailto:vidyadhar at lucidindia.com] 
Sent: Wednesday, May 21, 2008 6:40 AM
To: Kenneth Evans
Cc: vtkusers
Subject: Re: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize

 

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 <mailto:evans at aps.anl.gov>  

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/f10ea06f/attachment.htm>


More information about the vtkusers mailing list