<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks David,</div><div class=""><br class=""></div><div class="">That clarifies things for me. Just to make sure I have got it, I will flesh out what I am trying to do and the way I understand it should be handled based on your response. Here goes:</div><div class=""><br class=""></div><div class="">My data type, let’s call it myGrid, is inherited from a vtkImageData. And similarly there is a myGridAlgorithm which acts as a base for constructing filters and sources to work on myGrid data. So an example pipeline might be something like this.</div><div class=""><br class=""></div><div class="">src1 > data1 [M by N myGrid object]</div><div class="">src2 > data2 [P by Q myGrid object] </div><div class="">filter1 < data1, data2 > data3 [M by N myGrid object]</div><div class=""><br class=""></div><div class="">So in src1 and src2 I should implement a RequestInformation(), which sets the WHOLE_EXTENT on the output ports to M by N and P by Q respectively and the RequestInformation() in filter1 should set the WHOLE_EXTENT of its output port to be the same as input 0. Is this correct? Note that in the above example we may have P>M or Q>N, would this mess things up?</div><div class=""><br class=""></div><div class="">Thanks for you help on this</div><div class=""><br class=""></div><div class="">Kit</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 16 Jan 2017, at 19:11, David Gobbi <<a href="mailto:david.gobbi@gmail.com" class="">david.gobbi@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I'm going to try again, with fewer typos:<div class=""><div class=""><br class=""></div><div class="">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" class="">http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline</a> </div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">With respect to the extent, the three passes of the pipeline work like this:</div><div class=""><br class=""></div><div class="">In RequestInformation(), a filter sets the WHOLE_EXTENT of its output. This is how a filter tells the pipeline "this is how much data I can produce". A filter can be asked to produce less than this (as described in RequestUpdateExtent, below). The default behavior of RequestInformation() is to check the WHOLE_EXTENT of the input, and then use that same WHOLE_EXTENT for the output. </div><div class=""><br class=""></div><div class="">In RequestUpdateExtent(), a filter can request for the pipeline 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 class=""><br class=""></div><div class="">Finally, in RequestData() a filter should call GetExtent() on each input data object to see how data is actually there.</div></div><div class=""><br class=""></div><div class=""> - David</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jan 16, 2017 at 12:04 PM, David Gobbi <span dir="ltr" class=""><<a href="mailto:david.gobbi@gmail.com" target="_blank" class="">david.gobbi@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Kit,<div class=""><br class=""></div><div class="">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" class="">http://www.vtk.org/Wiki/<wbr class="">VTK/Tutorials/New_Pipeline</a> <br class=""></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">With respect to the extent, the three passes of the pipeline work like this:</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Finally, in RequestData() a filter should call GetExtent() on each input data object to see how data is actually there.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class=""> - David</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jan 16, 2017 at 10:17 AM, Kit Chambers <span dir="ltr" class=""><<a href="mailto:kit.chambers.kc@gmail.com" target="_blank" class="">kit.chambers.kc@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br class="">
<br class="">
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 class="">
<br class="">
for (int i=0; i<numInputPorts; i++)<br class="">
{<br class="">
int numInputConnections = this->GetNumberOfInputConnecti<wbr class="">ons(i);<br class="">
for (int j=0; j<numInputConnections; j++)<br class="">
{<br class="">
vtkInformation* inputInfo = inputVector[i]->GetInformation<wbr class="">Object(j);<br class="">
inputInfo->Set(vtkStreamingDem<wbr class="">andDrivenPipeline::EXACT_<wbr class="">EXTENT(), 1);<br class="">
}<br class="">
}<br class="">
<br class="">
I changed:<br class="">
inputInfo->Set(vtkStreamingDem<wbr class="">andDrivenPipeline::EXACT_<wbr class="">EXTENT(), 1);<br class="">
<br class="">
to:<br class="">
inputInfo->Set(vtkStreamingDem<wbr class="">andDrivenPipeline::WHOLE_<wbr class="">EXTENT(),WholeExtent,6);<br class="">
<br class="">
where the array WholeExtent is the maximum extent computed over all input and output ports.<br class="">
<br class="">
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 class="">
<br class="">
Thanks<br class="">
<span class="m_-1846744212504491024HOEnZb"><font color="#888888" class=""><br class="">
Kit<br class="">
</font></span><div class="m_-1846744212504491024HOEnZb"><div class="m_-1846744212504491024h5"><br class="">
<br class="">
> On 4 Jan 2017, at 12:56, Kit Chambers <<a href="mailto:kit.chambers.kc@googlemail.com" target="_blank" class="">kit.chambers.kc@googlemail.co<wbr class="">m</a>> wrote:<br class="">
><br class="">
> Hi All,<br class="">
><br class="">
> 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 class="">
><br class="">
> 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 class="">
><br class="">
> ERROR: In …. /vtk/Common/ExecutionModel/vtk<wbr class="">StreamingDemandDrivenPipeline.<wbr class="">cxx, line 857<br class="">
> vtkStreamingDemandDrivenPipeli<wbr class="">ne (0x7fc6fa444a00): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0x7fc6fa444<wbr class="">4a0) is 0 31 0 0 0 0, which is outside the whole extent 0 5 0 0 0 0.<br class="">
><br class="">
> ERROR: In …. /vtk/src/vtk/Common/ExecutionM<wbr class="">odel/vtkTrivialProducer.cxx, line 264<br class="">
> vtkTrivialProducer (0x7fc6fa4444a0): This data object does not contain the requested extent.<br class="">
><br class="">
> Any suggestions? Is there something I am missing here?<br class="">
><br class="">
> Kit<br class="">
><br class="">
><br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensou<wbr class="">rce/opensource.html</a><br class="">
<br class="">
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank" class="">http://www.vtk.org/Wiki/VTK_FA<wbr class="">Q</a><br class="">
<br class="">
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=<wbr class="">vtkusers</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mail<wbr class="">man/listinfo/vtkusers</a><br class="">
</div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>