[vtkusers] Extent Problem

rywchiu rywchiu at interchange.ubc.ca
Thu Jun 9 15:59:26 EDT 2005


Hi,

I've implemented an ImagePlaneWidget in one window, and am trying to display the 3 planes of the widget in 3 other separate windows. When I change the size of the planes in the widget (e.g. zoom in/out), it does not correctly update size of the corresponding image in the other window.  I've looked at some suggestions from the mailing list, but I'm still getting the problem. 

Below is my code for displaying one of planes of my widget. Is the problem from the inputs for imageActor->SetDisplayExtent() not being updated? Or is it something else...?

Thanks in advance!

Rita

---------------------------

vtkImagePlaneWidget *planeWidgetX = vtkImagePlaneWidget::New();
planeWidgetX->DisplayTextOn();
planeWidgetX->SetInteractor(iren);
planeWidgetX->SetInput(reader->GetOutput());
planeWidgetX->SetPlaneOrientationToXAxes();
planeWidgetX->SetPicker(picker);
planeWidgetX->SetKeyPressActivationValue('x');
planeWidgetX->PlaceWidget();
planeWidgetX->SetLookupTable(LUT);
planeWidgetX->SetSliceIndex((reader->GetOutput()->GetExtent()[1] - reader->GetOutput()->GetExtent()[0])/2);

vtkImageMapToColors *colorMap1 = vtkImageMapToColors::New();
colorMap1->PassAlphaToOutputOff();
colorMap1->SetLookupTable(planeWidgetX->GetLookupTable());
colorMap1->SetInput(planeWidgetX->GetResliceOutput());
colorMap1->UpdateWholeExtent();

vtkImageActor *imageActor1 = vtkImageActor::New();
imageActor1->SetInput(colorMap1->GetOutput());
imageActor1->GetInput()->UpdateInformation();
imageActor1->GetInput()->SetUpdateExtentToWholeExtent();
imageActor1->GetInput()->Update();
imageActor1->SetDisplayExtent(imageActor1->GetInput()->GetWholeExtent());




More information about the vtkusers mailing list