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-&gt;AddPage(m_pVTKWindow, &quot;wxVTK&quot;);<br><br>vtkImageData *image = vtkImageData::New();<br>image-&gt;SetDimensions(xSize+1,ySize+1,zSize+1);<br>
image-&gt;SetScalarTypeToDouble();<br>image-&gt;AllocateScalars();<br><br>double *x = static_cast&lt;double*&gt;(image-&gt;GetScalarPointer());<br><br>... I fill x with data<br><br>viewer-&gt;SetInput(image);<br>viewer-&gt;SetColorWindow(1230100);<br>
viewer-&gt;SetColorLevel(615050);<br>viewer-&gt;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>