It's possible that I'm misinterpreting the performance results of my implementation and that applying the window level lookup table is actually not what makes the difference. I'm comparing a vtkActor2D/vtkImageMapper based and a vtkImageActor based implementation of something that shows a series of images one by one with a specific window/level. <br>
<br>If the window/level is not the issue, how much of a difference in performance drop for the vtkImageActor implementation would be expected?<br><br>I have 700 images (512 x 512, 12 bits stored), rendered into a 512 x 512 viewport). vtkActor2D/vtkImageMapper takes about 8 seconds, vtkImageActor about 26 seconds to render the whole series. If I additionally resample my data to add a scale to best fit to the vtkActor2D/vtkImageMapper implementation I get to 18 seconds (that was my starting point to look for accelarated scaling). There is no visible difference when I add scaling to the vtkImageActor. That means that I'm getting much faster scaling for the vtkImageActor based implementation, but that overall it still performs slower. Unless there is some other bottleneck in my implementation.<br>
<br>Mark<br><br><br><br><div class="gmail_quote">2010/11/30 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, Nov 30, 2010 at 7:10 AM, endlosschleife1 <span dir="ltr"><<a href="mailto:endlosschleife1@googlemail.com" target="_blank">endlosschleife1@googlemail.com</a>></span> wrote:</div><div><br><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote"><div>
</div><div>I was actually looking for accelerated scaling, so this sounds like vtkActor2D is not be the right thing for that.</div></div></blockquote><div><br></div></div><div>For accelerated scaling, you need to use vtkImageActor. </div>
<div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div>I'm not sure, but it looks like my implementation probably doesn't use any GPU acceleration (it seems to be pure image data filtering). It still seemed to be not as performant as I expected (compared to an implementation where I only used VTK for the imaging pipeline, but did the LUT application and visualization separetely).</div>
</div></blockquote><div><br></div></div><div>The vtkImageMapper doesn't have accelerated window/level either. It does all the computations on the CPU and then uses glDrawPixels() to render the image.</div><div class="im">
<div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote">
<div>I create a vtkWindowLevelTable, set the window and center, and then call build on the lut. Then I used it with a vtkImageMapToColors instance:</div>
<div> </div>
<div>vtkImageMapToColors *color = vtkImageMapToColors::New();</div>
<div>color->SetLookupTable(lut); // lut is the vtkWindowLevelTable</div>
<div>color->SetInput(...) // some vtkImageData</div></div></blockquote><div><br></div></div><div>Yes, that looks typical. Make sure that you call table->SetRampToLinear() because by default, a VTK lookup table uses a curved ramp instead of a linear ramp (I was shocked when I discovered this for the first time).</div>
<div><br></div><div> David</div></div><br></div>
</blockquote></div><br>