I want to render about 40 vtkRenderWindow objects each with its own image. The issue is my initial render is slow, it takes about 100-200 ms per render window. My pipeline can be seen in the code below.
I am using vtk8.2 release version and my discrete Nvdia GPU is being used. Any subsequent calls to Render() are lightning fast.
Is there a way to reduce the time the initial Render() call takes?
Thank you.
// Reading of data not included in timing
vtkDICOMImageReader* imageReader = vtkDICOMImageReader::New(); // 512 kbs
vtkImageData* imageData = vtkImageData::New();
imageReader->SetFileName( filepath );
imageReader->Update();
imageData->DeepCopy( imageReader->GetOutput() );
//timing starts here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//Creation of objects
vtkRenderWindow* renderWin = vtkRenderWindow::New();
vtkImageActor* imageActor = vtkImageActor::New();
vtkRenderer* renderer = vtkRenderer::New();
// Add actors and data to the render window
imageActor->SetInputData( imageData );
renderWin->AddRenderer( renderer );
vtkRenderWindowInteractor* interactor = vtkRenderWindowInteractor::New();
interactor->SetRenderWindow( renderWin );
renderer->AddActor( imageActor );
imageActor->Update();
// Render window
renderWin->Render();
//timing ends here >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Even with just running the following it takes about the same time.
vtkRenderWindow* renderWin = vtkRenderWindow::New();
renderWin->Render();