[vtkusers] How to disable rotation in vtkResliceImageViewer?
John Drescher
drescherjm at gmail.com
Thu Sep 20 11:14:16 EDT 2012
On Thu, Sep 20, 2012 at 11:09 AM, wydesenej <wydesenej at gmail.com> wrote:
> 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();
> }
>
>
Set the interactor style to one that does not rotate.
John
More information about the vtkusers
mailing list