[vtkusers] vtkImageViewer2 border

Steven Hou steveo14 at gmail.com
Thu Dec 4 21:09:45 EST 2008


Hi all, I am trying to display a 2D image with vtkImageViewer2 which is
placed within a wxWidget object. I can get the image to display properly
except I get this black border around my image (see attached image). I am
wondering how do I make the image I am trying to view fit completely inside
my widget (with no black border surrounding the image)?

Code snippet I am using:

wxVTKRenderWindowInteractor *m_pVTKWindow = new
wxVTKRenderWindowInteractor(notebook, MY_VTK_WINDOW);
vtkImageData *image = vtkImageData::New();
image = ...
vtkImageViewer2 *viewer = vtkImageViewer2::New();

viewer->SetColorWindow(2400);
viewer->SetColorLevel(1200);
viewer->SetInput(image);
viewer->SetupInteractor (NULL);
m_pVTKWindow->SetRenderWindow(viewer->GetRenderWindow());
viewer->GetRenderer()->ResetCamera();

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081204/86a63bbd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imageviewer2_border.JPG
Type: image/jpeg
Size: 22981 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081204/86a63bbd/attachment.jpeg>


More information about the vtkusers mailing list