[vtkusers] vtkImageReslice and vtkImageMapToWindowLevelColors needs UpdateWholeExtent?

Matthias Zangl matthias.zangl at srs-med.com
Fri Nov 9 05:08:35 EST 2001


Hi out there!

As I moved from vtk 3.2 to 4.0 I encountered the following problem:

After changing the windowlevel with the vtkImageMapToWindowLevelColors
it showed a totally messed up image (if there is a transformation or
after a transformation). I found out that I've to call
UpdateWholeExtent after rotating the image.

The problem is that UpdateWholeExtent takes a long time (about 5
seconds). So I want to avoid it if possible or maybe updating only the
relevant area (maybe the displayed one?).


The 2 involved procedures in my program are:

Rotate

this procedure is responsible for modifying the transformation-matrix
and setting it to the reslice object.

The vtk-relevant code of this procedure is:

    transform->Identity();
    transform->RotateX(rotX);
    transform->RotateY(rotY);
    transform->RotateZ(rotZ);
    transform->Update();

now I assume to have a correct transformation and I am going to assign
it my reslice object.

    reslice->SetResliceAxes (transform->GetMatrix());
    reslice->SetOutputExtent(0,255,0,255,0,255);
    reslice->UpdateWholeExtent();

I set the OutputExtent to a fixed size.
My volume is:

X1,X2: 0,255
Y1,Y2: 0,255
Z1,Z2: 0,160

To always have the same extents after rotation I set the output extent
to these values.


ChangeWindowColor

changes the color on mouse moves of the user.

using:

vtkImageMapToWindowLevelColors->SetLevel
vtkImageMapToWindowLevelColors->SetWindow





The vtkImageMapToWindowLevelColors uses the output of the reslice
object. And the output of the colorfilter is passed to the actor.

Today I tried connecting the other way around. I passed the output of
the colorfilter to the reslice-object which is doing the
transformation. And the transformation is going to be displayed by the
actor. This resulted in a real bad output. The screen was messed up
immediatly after the first windowchangecolor.

Please keep in mind that the code worked on vtk before 4.0. Studying
the documentation I recognized that the windowlevelfilter was changed on
11th October the last time. Are there some incompabilities between
the Colorfilter and the reslicer? Why can't vtkImageReslice take the
output of the colorfilter?


greetings from Austria,
 Matthias                          mailto:matthias.zangl at srs-med.com




More information about the vtkusers mailing list