[vtkusers] How to disable rotation in vtkResliceImageViewer?

wydesenej wydesenej at gmail.com
Thu Sep 20 11:09:31 EDT 2012


Hello.

I have problem with vtkResliceImageViewer. I need to disable rotation of
reslice cursor axes. I want that axes will be orthogonal to each other.
Inserted picture ilustrates rotation of one axe.

<http://vtk.1045678.n5.nabble.com/file/n5716216/01%29.png> 

After 2 days I didnt found how to disable this rotation.  Please help. Here
is my code:

vtkSmartPointer<vtkResliceCursorCallback> cbk =
vtkSmartPointer<vtkResliceCursorCallback>::New();

    for(int i=0; i<3; i++)
    {
        riw[i] = vtkSmartPointer< vtkResliceImageViewer >::New();

        vtkResliceCursorLineRepresentation *rep =
vtkResliceCursorLineRepresentation::SafeDownCast(riw[i]->GetResliceCursorWidget()->GetRepresentation());
        riw[i]->SetResliceCursor(riw[0]->GetResliceCursor());
       
rep->GetResliceCursorActor()->GetCursorAlgorithm()->SetReslicePlaneNormal(i);

        qvtkWidgets[i].SetRenderWindow(riw[i]->GetRenderWindow());
        riw[i]->SetupInteractor( qvtkWidgets[i].GetInteractor() );
        riw[i]->SetInput(image_data);
        riw[i]->GetResliceCursor()->SetImage( image_data );
        riw[i]->GetResliceCursor()->SetCenter( image_data->GetCenter() );
        riw[i]->GetResliceCursor()->Update();
        riw[i]->SetSliceOrientation(i);
        riw[i]->SetResliceModeToAxisAligned();
        riw[i]->SetResliceMode(1);
        riw[i]->GetRenderer()->ResetCamera();

        cbk->RCW[i] = riw[i]->GetResliceCursorWidget();
        riw[i]->GetResliceCursorWidget()->AddObserver(
vtkResliceCursorWidget::ResliceAxesChangedEvent, cbk );

        riw[i]->Render();
    }



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-disable-rotation-in-vtkResliceImageViewer-tp5716216.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list