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

Brad King brad.king at kitware.com
Thu Aug 18 15:14:14 EDT 2005


Prabhu Ramachandran wrote:
>>>>>>"Brad" == Brad King <brad.king at kitware.com> writes:
> 
> 
>     Brad> Prabhu Ramachandran wrote:
>     >>>>>>> "Dean" == Dean Inglis <dean.inglis at camris.ca> writes:
>     >>
>     Dean> and removed the outline filter from the pipeline and
>     Dean> everything runs fine.  As soon as I add the outline filter,
>     Dean> I get the same weird results.  I haven't figured out if this
>     Dean> is a pipeline problem, IPW problem or outline filter
>     Dean> pb.... :{
>     >>
>     >> Thanks for the confirmation of the problem!  This means there
>     >> is a nasty bug lurking somewhere in there.
> 
>     Brad> I've found the problem.  The vtkOutlineFilter derives from
>     Brad> vtkPolyDataAlgorithm.
>     Brad> vtkPolyDataAlgorithm::RequestUpdateExtent sets
>     Brad> RequestExactExtent to 1 so that it requests the exact
>     Brad> unstructured extent.  However when the input of
> [...]
>     Brad> Since vtkTrivialProducer has only one copy of the data it
>     Brad> will never actually generate or re-initialize its output.
>     Brad> However when RequestExactExtent is on then the executive
>     Brad> crops the data and it is lost forever!
> 
> I don't understand this.  Shouldn't this work because the pipeline is
> "branched" in the sense that the resliced output is used by one actor
> and the original (intact) data is used by the outline filter.  Why
> should the cropping propagate upstream at all and affect all branches
> of the pipeline?

The problem is that for some reason an exact-extent request was 
originally implemented in terms of the output of a filter instead of the 
input.  Therefore there is only one copy of the data and it is cropped 
away.  Since the outline filter executes first it sends the exact-extent 
request and destroys the data before the other filters get a chance to 
see it.

There are at least two fixes for this:

1.) Implement exact-extent requests in terms of the input to a filter by 
having the executive make a cropped copy of the data before passing it 
to the filter.  Then the original will stay intact for other consumers 
but there will be more memory usage.

2.) Get rid of structured exact-extent requests and rewrite the filters 
that need them to do something else.  This solution is probably alot of 
work.

-Brad



More information about the vtk-developers mailing list