Hi everyone, I am trying to display a 2D image using wxVTK:<br><br>My code looks something like this:<br><br>vtkImageViewer2 *viewer;<br>wxVTKRenderWindowInteractor *m_pVTKWindow;<br><br>viewer = vtkImageViewer2::New();<br>
m_pVTKWindow = new wxVTKRenderWindowInteractor(notebook, MY_VTK_WINDOW);<br>notebook->AddPage(m_pVTKWindow, "wxVTK");<br><br>vtkImageData *image = vtkImageData::New();<br>image->SetDimensions(xSize+1,ySize+1,zSize+1);<br>
image->SetScalarTypeToDouble();<br>image->AllocateScalars();<br><br>double *x = static_cast<double*>(image->GetScalarPointer());<br><br>... I fill x with data<br><br>viewer->SetInput(image);<br>viewer->SetColorWindow(1230100);<br>
viewer->SetColorLevel(615050);<br>viewer->SetupInteractor ( m_pVTKWindow );<br><br>When I compile this code, the image viewer displays a black screen. If I<br>change vtkImageViewer2 to vtkImageViewer, the image is displayed properly.<br>
Are there compatibility issues with wxVTK and vtkImageViewer2?<br><br>Thanks <br>