[vtkusers] vtkImageActor and scaling

David Gobbi david.gobbi at gmail.com
Tue Nov 30 09:32:24 EST 2010


On Tue, Nov 30, 2010 at 7:10 AM, endlosschleife1 <
endlosschleife1 at googlemail.com> wrote:

 I was actually looking for accelerated scaling, so this sounds like
> vtkActor2D is not be the right thing for that.
>

For accelerated scaling, you need to use vtkImageActor.

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).
>

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.


>  I create a vtkWindowLevelTable, set the window and center, and then call
> build on the lut. Then I used it with a vtkImageMapToColors instance:
>
> vtkImageMapToColors *color = vtkImageMapToColors::New();
> color->SetLookupTable(lut); // lut is the vtkWindowLevelTable
> color->SetInput(...) // some vtkImageData
>

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).

  David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101130/2dff341a/attachment.htm>


More information about the vtkusers mailing list