[vtkusers] Problem with cursoring in vtkImagePlaneWidget + enum news to me

Dean Inglis dean.inglis at sympatico.ca
Sat Sep 16 07:42:39 EDT 2006


Peter,

>only partially. I am using the output of a vtkImageCheckerboard as the
input
>for the vtkImagePlaneWidgets. If I insert the line:

>checkers->Update();

>after setting up the checkerboard, the image planes work as expected. That
>is, when I click a new plane, the cursor works as it should. However, if I
>change something in the checkerboard at run-time, such as the amount of
>divisions, the situation returns to the original problem, where I cannot
>select a new plane without first having to move it. Adding a call to
>checkers->Update()
>after changing the checkerboard doesn't work either.

vtkIPW calls UpdateCursor in which it checks to make sure the image data
is up to date:

<snip>
void vtkImagePlaneWidget::UpdateCursor(int X, int Y )
{
  this->ImageData = vtkImageData::SafeDownCast(this->Reslice->GetInput());
  if ( !this->ImageData )
    {
    return;
    }
  // We're going to be extracting values with GetScalarComponentAsDouble(),
  // we might as well make sure that the data is there.  If the data is
  // up to date already, this call doesn't cost very much.  If we don't make
  // this call and the data is not up to date, the GetScalar... call will
  // cause a segfault.
  this->ImageData->Update();
<snip>

this->ImageData is set in vtkIPW's SetInput method, but is only a loose
pointer
to the data: so perhaps if you call SetInput(checkers->GetOutput()) before
interacting with the widget?  Does this behaviour occur with any other
pipelines
you have created?

Dean




More information about the vtkusers mailing list