<div dir="ltr"><div><div><div>Thanks Berk,<br></div>Thanks a lot ! Indeed checking out the master did solve the issue (and more! Good surprise!)<br><br></div>Best regards,<br></div>Jerome<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-24 16:30 GMT+01:00 Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It is hard to guess whether the problem is the same without seeing code. However, this issue was fixed in VTK master so you may want to update and see for yourself. I am including below the documentation explaining the change (also available in Documentation/Doxygen/ChangesVTK-7-1.md).<div><br></div><div>However, if RequestInformation() executes and RequestData() executes, it is impossible for RequestUpdateExtent() not to execute. There is no code path for this. So something is fishy.</div><div><br></div><div>Best,</div><div>-berk</div><div><br><div><br></div><div><div>Pipeline Update Methods</div><div>-----------------------</div><div><br></div><div>The following methods were deprecated in VTK 7.1:</div><div><br></div><div>### vtkAlgorithm:</div><div><br></div><div> int SetUpdateExtentToWholeExtent(int port);</div><div> int SetUpdateExtentToWholeExtent();</div><div> void SetUpdateExtent(int port,</div><div> int piece,int numPieces, int ghostLevel);</div><div> void SetUpdateExtent(</div><div> int piece,int numPieces, int ghostLevel);</div><div> void SetUpdateExtent(int port, int extent[6]);</div><div> void SetUpdateExtent(int extent[6]);</div><div><br></div><div>### vtkStreamingDemandDrivenPipeline:</div><div><br></div><div> int SetUpdateExtentToWholeExtent(int port);</div><div> static int SetUpdateExtentToWholeExtent(vtkInformation *);</div><div> int SetUpdateExtent(int port, int extent[6]);</div><div> int SetUpdateExtent(int port, int x0, int x1, int y0, int y1, int z0, int z1);</div><div> static int SetUpdateExtent(vtkInformation *, int extent[6]);</div><div> int SetUpdateExtent(int port,</div><div> int piece, int numPieces, int ghostLevel);</div><div> static int SetUpdateExtent(vtkInformation *,</div><div> int piece, int numPieces, int ghostLevel);</div><div> static int SetUpdatePiece(vtkInformation *, int piece);</div><div> static int SetUpdateNumberOfPieces(vtkInformation *, int n);</div><div> static int SetUpdateGhostLevel(vtkInformation *, int n);</div><div> int SetUpdateTimeStep(int port, double time);</div><div> static int SetUpdateTimeStep(vtkInformation *, double time);</div><div><br></div><div>The following new methods were added:</div><div><br></div><div>### vtkAlgorithm:</div><div><br></div><div> int Update(int port, vtkInformationVector* requests);</div><div> int Update(vtkInformation* requests);</div><div> int UpdatePiece(int piece, int numPieces, int ghostLevels, int* extents=0);</div><div> int UpdateExtent(int piece, int numPieces, int ghostLevels, int* extents=0);</div><div> int UpdateTimeStep(double time,</div><div> int piece=-1, int numPieces=1, int ghostLevels=0, int* extents=0);</div><div><br></div><div>### vtkStreamingDemandDrivenPipeline:</div><div><br></div><div> int Update(int port, vtkInformationVector* requests);</div><div><br></div><div>The main reason behind these changes is to make requesting a particular time step or a particular spatial subset (extent or pieces) during an update easier and more predictable. Prior to these changes, the following is the best way to request a subset during update:</div><div><br></div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> // Set some properties of source here</div><div> source->UpdateInformation();</div><div> source->SetUpdateExtent(0, 5, 0, 5, 2, 2);</div><div> source->Update();</div><div><br></div><div>Note that the following will not work:</div><div><br></div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> // Set some properties of source here</div><div> // source->UpdateInformation(); <-- this was commented out</div><div> source->SetUpdateExtent(0, 5, 0, 5, 2, 2);</div><div> source->Update();</div><div><br></div><div>This is because when the output of an algorithm is initialized, all request meta-data stored in its OutputInformation is removed. The initialization of the output happens during the first *RequestInformation*, which is why `UpdateInformation()` needs to be called before setting any request values. To make things more complicated, the following will also not work:</div><div><br></div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> // Set some properties of source here</div><div> source->UpdateInformation();</div><div> source->SetUpdateExtent(0, 5, 0, 5, 2, 2);</div><div> source->Modified();</div><div> source->Update();</div><div><br></div><div>This is because during *RequestInformation*, the extent and piece requests are initialized to default values (which is the whole dataset) and *RequestInformation* is called during update if the algorithm has been modified since the last information update.</div><div><br></div><div>This necessary sequence of calls has been mostly tribal knowledge and is very error prone. To simplify pipeline updates with requests, we introduced a new set of methods. With the new API, our example would be:</div><div><br></div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> int updateExtent[6] = {0, 5, 0, 5, 2, 2};</div><div> // Set some properties of source here</div><div> source->UpdateExtent(updateExtent);</div><div><br></div><div>To ask for a particular time step from a time source, we would do something like this:</div><div><br></div><div> vtkNew<vtkExodusIIReader> reader;</div><div> // Set properties here</div><div> reader->UpdateTimeStep(0.5);</div><div> // or</div><div> reader->UpdateTimeStep(0.5, 1, 2, 1);</div><div><br></div><div>The last call asks for time value 0.5 and the first of two pieces with one ghost level.</div><div><br></div><div>The new algorithm also supports directly passing a number of keys to make requests:</div><div><br></div><div> typedef vtkStreamingDemandDrivenPipeline vtkSDDP;</div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> int updateExtent[6] = {0, 5, 0, 5, 2, 2};</div><div> vtkNew<vtkInformation> requests;</div><div> requests->Set(vtkSDDP::UPDATE_EXTENT(), updateExtent, 6);</div><div> reader->Update(requests.GetPointer());</div><div><br></div><div>This is equivalent to:</div><div><br></div><div> typedef vtkStreamingDemandDrivenPipeline vtkSDDP;</div><div> vtkNew<vtkRTAnalyticSource> source;</div><div> int updateExtent[6] = {0, 5, 0, 5, 2, 2};</div><div> source->UpdateInformation();</div><div> source->GetOutputInformation(0)->Set(vtkSDDP::UPDATE_EXTENT(), updateExtent, 6);</div><div> reader->Update();</div><div><br></div><div>We expect to remove the deprecated methods in VTK 8.0.</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Feb 24, 2016 at 3:01 AM, Jé Velut <span dir="ltr"><<a href="mailto:jerome.velut@gmail.com" target="_blank">jerome.velut@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div><div><div><div>Dear all,<br><br></div>I am struggling with the pipeline mechanism.<br></div>I wrote an image reader that wraps the ITK gdcm reader. When I change the directory, <br>the reader does update. However, if the extent of the second volume is larger than the <br></div>first one, I get the warning message :<br><br>ERROR: In C:\Users\Jerome\Dev\VTK\vtk-src\Common\ExecutionModel\vtkStreamingDemandDrivenPipeline.cxx, line 857<br>vtkCompositeDataPipeline (000002913075DB70): The update extent specified in the information for output port 0 on algorithm vtkITKGDCMImageReader(000002913074A470) is 0 255 0 255 0 255, which is outside the whole extent 0 255 0 255 0 197.<br><br></div>Strangely, I wrote a simple test for this reader and the warning is not thrown. The test set the file path, updates, then changes the file path and updates again. The warning appears in a more complicated pipeline.<br><br></div>The odd is that I implemented the RequestUpdateExtent, that simply returns the Superclass::RequestUpdateExtent result. In the simple test, this function is called at each pipeline update. In the full application, it is not called the second time (while requestInformation is correctly called...).<br><br></div>I guess the pipeline does not notify correctly the reader to change the update extent. But why?<br></div>I found this thread which may be close to my issue :<br><a href="http://markmail.org/search/?q=update_extent+not+updated#query:update_extent%20not%20updated+page:1+mid:xmi3dp3xqbnp2hzv+state:results" target="_blank">http://markmail.org/search/?q=update_extent+not+updated#query:update_extent%20not%20updated+page:1+mid:xmi3dp3xqbnp2hzv+state:results</a><br><br></div>Thanks a lot !<br></div>Jerome<br></div>
<br></div></div>_______________________________________________<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/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>