<div dir="ltr">Hi Dean,<div><br></div><div>thanks again for your reply and time.</div><div><br></div><div>Testing with only one vtkImagePlaneWidget at a time did not produce changes in the observed behavior: rendering on the old PC is still slow if the input volume is made up of fewer slices, and fast if the input volume is made up of more slices (i.e., larger).</div>
<div><br></div><div>Here is some info about my test environment:</div><div><br></div><div>VTK 6.0, compiled with Visual Studio 2008, 32-bit, MinSizeRel build config, shared</div><div><br></div><div>The &quot;old PC&quot; has the following configuration:</div>
<div><br></div><div>Pentium 4, 3 GHz, 1 GB RAM</div><div>Two graphic cards: Intel Express (?) card 64 MB video memory driving the primary color monitor + Barco 1MP2FH dual-head card driving two Barco Coronis grayscale diagnostic monitors</div>
<div>Window XP Pro SP2 32-bit</div><div><br></div><div>Digging further, I discovered something interesting: trying to run the same test on the primary color monitor (i.e., the one driven by the &quot;stock&quot; Intel Express card), initially I had similar results: with the &quot;smaller&quot; volume, NOTHING was displayed inside my vtkCanvas panel (totally empty); with the &quot;larger&quot; volume, the three widget planes were displayed correctly and interacted at good performances. While the cause of this behavior still is very obscure to me, on this primary color monitor all issues disappeared after an update of the driver of the Intel Express graphics card: with the new driver, the widgets appear and work fine with both the small volume and the large volume.</div>
<div><br></div><div>Unfortunately, I cannot find updated device drivers for the Barco graphics card, so I am unable to test if updating drivers will fix the behavior also on the diagnostic monitors.</div><div><br></div><div>
However, once I am conviced that the really weird behavior I observed can be marked as a &quot;device driver issue&quot;, I am satisfied.</div><div><br></div><div>Any comments will be appreciated.</div><div>Thanks in advance.<br>
</div><div><br></div><div>Marco</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 7:10 PM, Dean Inglis <span dir="ltr">&lt;<a href="mailto:inglis.dl@gmail.com" target="_blank">inglis.dl@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi Marco,<br><br></div>can you test and see what happens with only 1 image plane widget?  Texture mapping used in the widget works on a power of two sampling and<br>
</div>maybe for certain slice orientations, your hardware / driver is having issue with that.  Test with only 1 widget and do the<br>
test 3 x with the plane orientation orthogonally different with each test.  Try one widget with the plane orientation non-orthognally aligned.<br></div>Also, when reporting issues with VTK, you should specify your build environment (eg., VTK version, compiler, static/shared, debug/release, basic hardware and OS<br>

</div>parameters such as RAM, GPU, CPU etc.).<br><br><br></div>- Dean<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 12:48 PM, Marco Sambin <span dir="ltr">&lt;<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>let me add something to my previous post, since I discovered some facts which may be useful in identifying the issue.</div>

<div><br></div><div>I made the following test:</div><div><br>
</div><div>1) I have a set of 357 raw files in an input folder. Each file contains a 512x512 unsigned short pixel matrix.</div><div><br></div><div>2) Using this single set of raw files (i.e., always keeping the same input test volume), after several attempts I discovered that if I limit my reader to read just 326 slices or less, then rendering of the vtkImagePlaneWidget will be slow. On the other side, if I allow my reader to read 327 slices or more, then rendering of vtkImagePlaneWidget will be fast. In code (with reference to the code posted in my previous message):</div>


<div><br></div><div>[...]</div><div><div><div>imageReaderVTK.SetDataExtent(0, sliceCols - 1,</div><div>                              0, sliceRows - 1,</div></div><div>                              0, 325);</div>
</div><div>[...]</div>
<div>---&gt; rendering will be SLOW</div><div><br></div><div><br></div><div><div>[...]</div><div><div><div>imageReaderVTK.SetDataExtent(0, sliceCols - 1,</div><div>                              0, sliceRows - 1,</div>
</div><div>                              0, 326);</div>
</div><div>[...]</div><div>---&gt; rendering will be FAST</div></div><div><br></div><div>Once again, the set of RAW input slices available in the input folder is always the same.</div><div><br></div><div>Any explanation for this? </div>


<div><br></div><div>The only explanation which comes to my mind is the existence in VTK of a rendering technique adopting a policy like &quot;if data is small enough to be managed by the graphic card, then demand this task to the graphic card, otherwise use the CPU&quot;, and on that old PC the CPU may be a lot faster than the graphic card to do that job.</div>


<div><br></div><div>Is this just fantasy? Or there may be an explanation of that kind to the behavior I observed on that old PC?</div><div><br></div><div>Thanks in advance for your comments.</div><span><font color="#888888"><div>

<br></div><div>Marco</div></font></span><div><div>
<div><br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 5:29 PM, Marco Sambin <span dir="ltr">&lt;<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Dean,<div><br></div><div>first of all, thank you for your message.</div>


<div><br></div><div>The underlying pixel data type is unsigned short for both volumes.</div><div>Here is how I configure the reader:</div>
<div><br></div><div><div>        imageReaderVTK =  new vtkImageReader2();</div><div>        imageReaderVTK.FileLowerLeftOn();</div><div>        imageReaderVTK.SetFilePrefix(filePrefix);</div><div>        imageReaderVTK.SetFilePattern(&quot;%s_%d.raw&quot;);</div>



<div>        imageReaderVTK.SetDataExtent(0, sliceCols - 1,</div><div>                              0, sliceRows - 1,</div><div>                              0, numOfImages - 1);</div><div>        imageReaderVTK.SetDataSpacing(xSpacing, ySpacing, zSpacing);</div>



<div>        imageReaderVTK.SetDataOrigin(0.0, 0.0, 0.0);</div><div>        imageReaderVTK.SetDataScalarTypeToUnsignedShort();<br></div><div>        imageReaderVTK.SetDataByteOrderToBigEndian();</div></div><div>        imageReaderVTK.UpdateWholeExtent();</div>



<div><br></div><div><br></div><div>And here is how I configure the widget:</div><div><br></div><div><div>    vtkGenericRenderWindowInteractor interactor = getRenderWindowInteractor();</div><div>    planeWidgets[planeWidgetIndex].RestrictPlaneToVolumeOn();</div>



<div>    planeWidgets[planeWidgetIndex].SetInteractor(interactor);</div><div>    planeWidgets[planeWidgetIndex].DisplayTextOn();</div><div>    planeWidgets[planeWidgetIndex].TextureInterpolateOn();</div><div>    planeWidgets[planeWidgetIndex].UserControlledLookupTableOff();</div>



<div>    planeWidgets[planeWidgetIndex].SetResliceInterpolateToCubic();</div><div>    planeWidgets[planeWidgetIndex].KeyPressActivationOff();</div><div>    planeWidgets[planeWidgetIndex].SetInputConnection(imageReaderVTK.GetOutputPort());</div>



<div>    planeWidgets[planeWidgetIndex].SetWindowLevel(winWidth, winLevel, 0);</div><div>    planeWidgets[planeWidgetIndex].SetPlaneOrientation(planeWidgetIndex);    </div><div>    planeWidgets[planeWidgetIndex].PlaceWidget(volBounds);</div>



<div>    planeWidgets[planeWidgetIndex].On();</div><div>    planeWidgets[planeWidgetIndex].SetEnabled(1);</div></div><div><br></div><div>As I explained in my previous post, strangely the widgets interact with much better performances when my volume is made up of 360 512x512 slices, and worse when my volume is made up of 90 512x512 slices.</div>



<div>But this only happens on the old PC. On my development machine the rendering performance of the widgets are fine and undistinguishable in both cases.</div><div><br></div><div>I would like to underline that, on the old machine and with the smaller volume, the rendering of the vtkImagePlaneWidget is slow even when I try to modify the camera position through the default VTK interactor. I do not trigger any recomputation of window/level, or other, just roll my camera around the volume, and still I see the rendering slowness (I can distinguish painting of each triangle of each texture).</div>



<div><br></div><div>Thanks in advance for sharing your comments and suggestions with me.</div><div><br></div><div>Marco</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 4:21 PM, Dean Inglis <span dir="ltr">&lt;<a href="mailto:inglis.dl@gmail.com" target="_blank">inglis.dl@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Marco,<br><br></div>what is the underlying pixel data type in those two images ?  The widget has an internal<br>



vtkImageMapToColors which will do additional processing to convert the input to <br>
uchar if required.  How do you configure your widgets ?<br></div><br><div><br></div>- Dean<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 7:08 AM, Marco Sambin <span dir="ltr">&lt;<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all.<div><br></div><div>In my VTK6-based Java application, I am using a vtkCanvas where I display three orthogonal vtkImagePlaneWidgets, cutting a volume loaded through vtkImageReader2.</div>




<div><br></div>
<div>Everything works fine on my development machine, which is a recent and moderately-powerful 64-bit Win 7-based machine.</div><div><br></div><div>For legacy-compatibility purposes, I tested this application under an older Win XP-based Pentium 4 machine with 1 GB RAM and old Barco graphic cards, and I obtained &quot;strange&quot; results:</div>





<div><br></div><div>- if I feed vtkImageReader2 with a volume made up of around 360 raw slices, each one 512x512 pixels, then the overall rendering performances of the view containing the three vtkImagePlaneWidgets are acceptable.</div>





<div><br></div><div>- on the other side, if I feed vtkImageReader2 with a volume made up of 90 (i.e., fewer) raw slices, each one 512x512 pixels, then the overall rendering performances of the view containing the three vtkImagePlaneWidgets become really poor, and I can distinguish the texture appearing on top of each plane widget painting as two separate triangles, given the slow rendering.</div>





<div><br></div><div>Can you guess why the rendering performance of the vtkImagePlaneWidgets are much worse with the smaller volume w.r.t. with the larger volume?</div><div><br></div><div>Thanks for any hints you will give.</div>





<div><br></div><div>Best regards,</div><div><br></div><div>Marco</div><div><br></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a 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 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 href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div>