<div dir="ltr">Hi Kit,<div><br></div><div>The VTK image pipeline updates occur in three passes (RequestInformation(), RequestUpdateExtent(), RequestData()), which are discussed in the VTK Users's Guide and also on the following web page: <a href="http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline" target="_blank">http://www.vtk.org/Wiki/<wbr>VTK/Tutorials/New_Pipeline</a> <br></div><div><br></div><div>A filter should never directly set the WHOLE_EXTENT of its input.  It is only allowed to set the WHOLE_EXTENT of its output.</div><div><br></div><div>With respect to the extent, the three passes of the pipeline work like this:</div><div><br></div><div>In RequestInformation(), a filter sets the WHOLE_EXTENT of its output.  This is how a filter tells the pipeline "this is how data I can produce".  A filter can be asked to produce less that this (as described in RequestUpdateExtent, below).  In most cases, what a filter does in RequestInformation() is check the WHOLE_EXTENT of its input, and then use that same WHOLE_EXTENT for its output. </div><div><br></div><div>In RequestUpdateExtent(), a filter can request that an produce less than the WHOLE_EXTENT of that input.  It does this by setting the UPDATE_EXTENT of the input, while tells the pipeline "I need at least this much data from this input".  Usually, it will set the UPDATE_EXTENT of the input to the WHOLE_EXTENT of the input.  If a filter also sets EXACT_EXTENT for the input, that tells the pipeline "I need exactly this much data from this input".  If you do not set EXACT_EXTENT, then the pipeline will produce at least as much data as requested by UPDATE_EXTENT, but possibly more.</div><div><br></div><div>Finally, in RequestData() a filter should call GetExtent() on each input data object to see how data is actually there.</div><div><br></div><div> - David</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 16, 2017 at 10:17 AM, Kit Chambers <span dir="ltr"><<a href="mailto:kit.chambers.kc@gmail.com" target="_blank">kit.chambers.kc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
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:<br>
<br>
  for (int i=0; i<numInputPorts; i++)<br>
    {<br>
    int numInputConnections = this-><wbr>GetNumberOfInputConnections(i)<wbr>;<br>
    for (int j=0; j<numInputConnections; j++)<br>
      {<br>
      vtkInformation* inputInfo = inputVector[i]-><wbr>GetInformationObject(j);<br>
      inputInfo->Set(<wbr>vtkStreamingDemandDrivenPipeli<wbr>ne::EXACT_EXTENT(), 1);<br>
      }<br>
    }<br>
<br>
I changed:<br>
        inputInfo->Set(<wbr>vtkStreamingDemandDrivenPipeli<wbr>ne::EXACT_EXTENT(), 1);<br>
<br>
to:<br>
        inputInfo->Set(<wbr>vtkStreamingDemandDrivenPipeli<wbr>ne::WHOLE_EXTENT(),<wbr>WholeExtent,6);<br>
<br>
where the array WholeExtent is the maximum extent computed over all input and output ports.<br>
<br>
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.<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
Kit<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On 4 Jan 2017, at 12:56, Kit Chambers <<a href="mailto:kit.chambers.kc@googlemail.com">kit.chambers.kc@googlemail.<wbr>com</a>> wrote:<br>
><br>
> Hi All,<br>
><br>
> 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.<br>
><br>
> 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:<br>
><br>
> ERROR: In …. /vtk/Common/ExecutionModel/<wbr>vtkStreamingDemandDrivenPipeli<wbr>ne.cxx, line 857<br>
> vtkStreamingDemandDrivenPipeli<wbr>ne (0x7fc6fa444a00): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(<wbr>0x7fc6fa4444a0) is 0 31 0 0 0 0, which is outside the whole extent 0 5 0 0 0 0.<br>
><br>
> ERROR: In …. /vtk/src/vtk/Common/<wbr>ExecutionModel/<wbr>vtkTrivialProducer.cxx, line 264<br>
> vtkTrivialProducer (0x7fc6fa4444a0): This data object does not contain the requested extent.<br>
><br>
> Any suggestions? Is there something I am missing here?<br>
><br>
> Kit<br>
><br>
><br>
<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>