<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thank you David for your response.<br>
    I had already took a look to TestPriorityStreaming in vtk and to
    Paraview StreamingView code but i can't get it work...<br>
    Here is a sample code I use for test, am I doing something wrong ?<br>
    <br>
    <br>
    // Dummy clipper only used to set bounding box of pieces to read<br>
    // Only ProcessRequest method is redefined<br>
    <br>
    class VtkClipDataSetExtend : public vtkClipDataSet<br>
    {<br>
    public:<br>
    &nbsp;&nbsp;&nbsp; vtkTypeMacro(VtkClipDataSetExtend,vtkClipDataSet);<br>
    <br>
    &nbsp;&nbsp;&nbsp; static VtkClipDataSetExtend *New();<br>
    <br>
    <br>
    protected:<br>
    &nbsp;&nbsp;&nbsp; VtkClipDataSetExtend() {}<br>
    &nbsp;&nbsp;&nbsp; virtual ~VtkClipDataSetExtend() {}<br>
    <br>
    &nbsp;&nbsp;&nbsp; int VtkClipDataSetExtend::ProcessRequest(vtkInformation*
    request,<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkInformationVector** inputVector,<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkInformationVector* outputVector)<br>
    &nbsp;&nbsp;&nbsp; {<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkInformation *outInfo =
    outputVector-&gt;GetInformationObject(0);<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkStreamingDemandDrivenPipeline *sdd = <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    vtkStreamingDemandDrivenPipeline::SafeDownCast(this-&gt;GetExecutive());<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (sdd == NULL)<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Bounds of pieces to read<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int extent[6];<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[0] = 0;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[1] = 1;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[2] = 0;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[3] = 1;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[4] = 0;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extent[5] = 1;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkDebugMacro(&lt;&lt;"SetUpdateExtent " <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;&lt; extent[0] &lt;&lt; "&nbsp; " &lt;&lt; extent[1]
    &lt;&lt; "&nbsp; " <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;&lt; extent[2] &lt;&lt; "&nbsp; " &lt;&lt; extent[3]
    &lt;&lt; "&nbsp; "<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;&lt; extent[4] &lt;&lt; "&nbsp; " &lt;&lt; extent[5]
    &lt;&lt; "&nbsp; ");<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Set these bounds in pipeline<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sdd-&gt;SetUpdateExtent(outInfo, extent);<br>
    <br>
    <br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 1;<br>
    &nbsp;&nbsp;&nbsp; }<br>
    <br>
    };<br>
    <br>
    vtkStandardNewMacro(VtkClipDataSetExtend);<br>
    <br>
    ..........<br>
    <br>
    {<br>
    ..........<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
//----------------------------------------------------------------------------------------------------//<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // writer<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // generate a pieces splitted image file <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(writeFile)<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkImageGridSource* const source =
    vtkImageGridSource::New();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; source-&gt;SetDataScalarTypeToShort();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; source-&gt;SetFillValue((double)0xAAAA);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; source-&gt;SetDataExtent(0, DATASOURCESIZE-1, 0,
    DATASOURCESIZE-1, 0, DATASOURCESIZE-1);<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // parallel image writer<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkXMLPImageDataWriter&gt; writer =
    vtkSmartPointer&lt;vtkXMLPImageDataWriter&gt;::New();<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // connect data source<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    writer-&gt;SetInputConnection(source-&gt;GetOutputPort());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; source-&gt;Delete();<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // settings<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;SetFileName("PartShortVolume16.pvti");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;SetNumberOfPieces(NUMPIECES);<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // range of pieces assigned to this writer<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;SetStartPiece(0);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;SetEndPiece(NUMPIECES-1);<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // split xml ref / data<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;SetWriteSummaryFile(TRUE); <br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // write<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;Update();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; writer-&gt;Write();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // reader<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkXMLPImageDataReader&gt; reader =
    vtkSmartPointer&lt;vtkXMLPImageDataReader&gt;::New();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;SetFileName("PartShortVolume16.pvti");<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;ReleaseDataFlagOn();<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;DebugOn();<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // clipping<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;VtkClipDataSetExtend&gt; clipper =
    vtkSmartPointer&lt;VtkClipDataSetExtend&gt;::New();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPlane&gt; plane =
    vtkSmartPointer&lt;vtkPlane&gt;::New();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; plane -&gt;SetNormal(1.0,0.0,0.0);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; plane &gt;SetOrigin(5.5,5.5,5.5);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clipper -&gt;SetClipFunction(plane);<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // pipeline connections<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkDataSetMapper&gt; mapper =
    vtkSmartPointer&lt;vtkDataSetMapper&gt;::New();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clipper -&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapper -&gt;SetInputConnection(clipper
    -&gt;GetOutputPort());<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Send the request of update to the reader<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // The reader should only read pieces include in bounds
    defined by extent set in clipper<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // But all pieces are loaded ... custom extent is not
    retrieved by reader ?<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapper-&gt;Update();<br>
    }<br>
    <br>
    Is somewhere maybe a documentation explaining the mechanism of
    pieces streaming and how to use it ? ...<br>
    <br>
    Thank you again !<br>
    <br>
    Le 08/06/2011 19:09, David E DeMarle a &eacute;crit&nbsp;:
    <blockquote
      cite="mid:BANLkTi=cf_x+DLJtfO7UaDmkSBCC+5ahzw@mail.gmail.com"
      type="cite">Look in the ParaView source code under the
      directory&nbsp;Plugins/StreamingView/VTK.&nbsp;That directory does not need
      ParaView, ie you can compile it against a standalone VTK build.
      The tests should be particularly helpful.
      <div><br>
      </div>
      <div>I have not tried vtkXMLPImageDataReader so it might take some
        work to use the files you have at hand. However,
        vtkXMLImageDataReader (note the lack of P) does work with
        streaming. Instead of separate files streaming takes advantage
        of the little exercised sub pieces within a single vti file
        feature to do what it needs to with this file format.</div>
      <div><br>
      </div>
      <div>See VTK/Rendering/Testing/Cxx/TestPriorityStreaming for more
        information.</div>
      <div><br>
      </div>
      <div>David E DeMarle<br>
        Kitware, Inc..<br>
        R&amp;D Engineer<br>
        28 Corporate Drive<br>
        Clifton Park, NY 12065-8662<br>
        Phone: 518-371-3971 x109<br>
        <br>
        <br>
        <div class="gmail_quote">2011/6/8 Fr&eacute;d&eacute;ric Speisser <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:frederic.speisser@grooviz.com">frederic.speisser@grooviz.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            All,<br>
            <br>
            I have a data object stored in pvti format (splitted in
            several pieces) and I would like to be able to stream only
            pieces involved in rendering. This should be possible in
            vtk, referring documentation.<br>
            I use vtkStreamindDemandDrivenPipeline and
            vtkStreamindDemandDrivenPipeline::UPDATE_EXTENT, but despite
            the fact I set bounds defining only a little part of my
            dataobject in update_extent key, the
            reader(vtkXMLPImageDataReader) always loads all pieces...<br>
            I have made plenty of tests but I'm not able to make this
            mechanism working.<br>
            <br>
            I need some help/hints !<br>
            <br>
            Thank you<br>
            <br>
            _______________________________________________<br>
            Powered by <a moz-do-not-send="true"
              href="http://www.kitware.com" target="_blank">www.kitware..com</a><br>
            <br>
            Visit other Kitware open-source projects at <a
              moz-do-not-send="true"
              href="http://www.kitware.com/opensource/opensource.html"
              target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
            <br>
            Please keep messages on-topic and check the VTK FAQ at: <a
              moz-do-not-send="true"
              href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
            <br>
            Follow this link to subscribe/unsubscribe:<br>
            <a moz-do-not-send="true"
              href="http://www.vtk.org/mailman/listinfo/vtkusers"
              target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <hr noshade="noshade" size="1">
      <p class="avgcert" color="#000000" align="left">Aucun virus trouv&eacute;
        dans ce message.<br>
        Analyse effectu&eacute;e par AVG - <a moz-do-not-send="true"
          href="http://www.avg.fr">www.avg.fr</a><br>
        Version: 10.0.1382 / Base de donn&eacute;es virale: 1511/3688 - Date:
        08/06/2011</p>
    </blockquote>
    <br>
  </body>
</html>