[vtkusers] vtkImageViewer2 border

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Dec 5 06:01:01 EST 2008


On Fri, Dec 5, 2008 at 3:09 AM, Steven Hou <steveo14 at gmail.com> wrote:
> 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();

As I said -already- in gdcm ml, you need to zoom ... this is a 3d
texture (different from vtkImageViewer).

-- 
Mathieu



More information about the vtkusers mailing list