[vtk-developers] RE: Problem when creating vtkImageData by hand

Brad King brad.king at kitware.com
Fri Aug 12 21:24:54 EDT 2005


Brad King wrote:
> The reason this did not happen in VTK 4.4 is that vtkOutlineFilter did 
> not set RequestExactExtent.  If I add a RequestUpdateExtent method to 
> vtkOutlineFilter and change RequestExactExtent back to 0 then the 
> problem is fixed.

Okay I take that back...VTK 4.4 did request an exact extent.  However 
since there was no filter producing the data this request was not 
honored (which was probably a bug).  Now that the implementation of 
request-exact-extent has been moved to the executive it is always honored.

Unfortunately in the case of vtkTrivialProducer there may not be much we 
can do.  It is not safe to produce the exact extent by providing a copy 
of the output that has been cropped because then the input is not the 
exact data object that was connected.  Ideas anyone?

Prabhu, I also had to add this to the hand-made copy:

my_img_data.SetNumberOfScalarComponents(img_data.GetNumberOfScalarComponents())

Technically this should have been needed in VTK 4.4 but since the
default number of components was 1 it didn't matter for this example.

I've fixed vtkDataObject::SetActiveAttributeInfo to preserve the old
scalar-type=VTK_DOUBLE and number-of-components=1 defaults.

-Brad



More information about the vtk-developers mailing list