2
我是ITK/VTK的新手,在VTK中學習的過程中,我們如何一次調用多個可視化輸出窗口(不同輸出窗口具有不同功能的分離器屏幕)。 我嘗試使用多個線程執行上述但我不能夠達到所需的上述..VTK:在渲染窗口中啓用分屏
// output window function 1
std::string inputFilename="E:\\DICOM_work\\CE53E85F";
vtkSmartPointer<vtkDICOMImageReader> reader =vtkSmartPointer<vtkDICOMImageReader>::New();
reader->SetFileName(inputFilename.c_str());
reader->Update();
// Visualize
vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New();
imageViewer->SetInputConnection(reader->GetOutputPort());
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
imageViewer->SetupInteractor(renderWindowInteractor);
imageViewer->Render();
imageViewer->GetRenderer()->ResetCamera();
imageViewer->Render();
renderWindowInteractor->Start();
}
// output window function 2
void display1(void *)
{
std::string inputFilename="E:\\DICOM_work\\CE53E85Fg2";
vtkSmartPointer<vtkDICOMImageReader> reader1 = vtkSmartPointer<vtkDICOMImageReader>::New();
reader1->SetFileName(inputFilename.c_str());
reader1->Update();
// Visualize
vtkSmartPointer<vtkImageViewer2> imageViewer2 = vtkSmartPointer<vtkImageViewer2>::New();
imageViewer2->SetInputConnection(reader1->GetOutputPort());
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor1 = vtkSmartPointer<vtkRenderWindowInteractor>::New();
imageViewer2->SetupInteractor(renderWindowInteractor1);
imageViewer2->Render();
imageViewer2->GetRenderer()->ResetCamera();
imageViewer2->Render();
renderWindowInteractor1->Start();
}
當過我嘗試執行它..代碼執行,直到...
renderWindowInteractor->啓動();
然後代碼退出而不執行其他功能。請幫助!
謝謝。就是我在找的東西! – faisal