[vtkusers] SetInputData and extents

Kit Chambers kit.chambers.kc at gmail.com
Mon Jan 16 12:17:43 EST 2017


Hi All, 

I did some more digging on the and found a solution that works (at least so far). My custom VTK filter class (derived from vtkImageAlgorithm) contained a method RequestUpdateExtent, which contained the following code:

  for (int i=0; i<numInputPorts; i++)
    {
    int numInputConnections = this->GetNumberOfInputConnections(i);
    for (int j=0; j<numInputConnections; j++)
      {
      vtkInformation* inputInfo = inputVector[i]->GetInformationObject(j);
      inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
      }
    }

I changed:
	inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);

to:
	inputInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),WholeExtent,6);

where the array WholeExtent is the maximum extent computed over all input and output ports. 

This seems to work, but I am not sure why. If anyone could point me in the direction of some explanation of the purpose behind extents in the VTK pipeline and how they are best used I would be very grateful. 

Thanks

Kit


> On 4 Jan 2017, at 12:56, Kit Chambers <kit.chambers.kc at googlemail.com> wrote:
> 
> Hi All,
> 
> I have a custom datatype (myType) derived from vtkImageData and a custom filter derived from vtkImageAlgorithm. The filter takes input on two ports which are both myType objects with different sizes. 
> 
> So in principle I should be able to set these inputs using either SetInputData() or SetInputConnection() right? However, when I run the filter  I get errors like:
> 
> ERROR: In …. /vtk/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx, line 857
> vtkStreamingDemandDrivenPipeline (0x7fc6fa444a00): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0x7fc6fa4444a0) is 0 31 0 0 0 0, which is outside the whole extent 0 5 0 0 0 0.
> 
> ERROR: In …. /vtk/src/vtk/Common/ExecutionModel/vtkTrivialProducer.cxx, line 264
> vtkTrivialProducer (0x7fc6fa4444a0): This data object does not contain the requested extent.
> 
> Any suggestions? Is there something I am missing here? 
> 
> Kit
> 
> 



More information about the vtkusers mailing list