I am developing a Qt application using C++ to display the three dicom views and perform interaction between them.
I have displayed DICOM using vtkSmartPointer
resliceImageViewer->SetSlice(100);
should set the dicom slice value to 100. Actually it does in backend, but in UI there is no change. The default slice is set at mid-value and is not changing in UI.
The following is my script
resliceImageViewer[1] = vtkSmartPointer<vtkResliceImageViewer>::New(); resliceImageViewer[1]->GetRenderer()->AddViewProp ( cornerAnnotationCorL); ui->renderDockWidgetCoronal->SetRenderWindow(resliceImageViewer[1]->GetRenderWindow()); resliceImageViewer[1]->SetupInteractor(ui->renderDockWidgetCoronal->GetRenderWindow()->GetInteractor()); vtkResliceCursorLineRepresentation *rep = vtkResliceCursorLineRepresentation::SafeDownCast( resliceImageViewer[1]->GetResliceCursorWidget()->GetRepresentation()); resliceImageViewer[1]->SetResliceCursor(resliceImageViewer[0]->GetResliceCursor()); rep->GetResliceCursorActor()-> GetCursorAlgorithm()->SetReslicePlaneNormal(1); resliceImageViewer[1]->SetInputData(reader->GetOutput()); resliceImageViewer[1]->SetSliceOrientation(1); resliceImageViewer[1]->SetResliceModeToAxisAligned(); resliceImageViewer[1]->SetResliceMode(1); resliceImageViewer[1]->GetRenderer()->ResetCamera(); resliceImageViewer[1]->Render();
corCam = vtkCamera::New();
corCam->SetPosition(0, 0, 1);
corCam->SetViewUp(0, -1, 0);
corCam = resliceImageViewer[1]->GetRenderer()->GetActiveCamera();
corCam->Roll(180);
resliceImageViewer[1]->SetSliceOrientationToXZ();
resliceImageViewer[1]->GetRenderer()->ResetCamera();
resliceImageViewer[1]->Render();resliceImageViewer[1]->SetSlice(100); // this is not reflecting in UI resliceImageViewer[1]->GetRenderer()->ResetCamera(); resliceImageViewer[1]->Render();
I couldn’t find any possible solution to this issue.
Help me out, guys.