Re: [wxVTK] Problems with vtkImageViewer2
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2008-11-26 16:14:06
|
Steven, On Tue, Nov 25, 2008 at 9:50 PM, Steven Hou <ste...@gm...> wrote: > Hi Mathieu, thanks for the reply. I was able to display the image by > changing my code to mimic how it's done in the comments of the example you > linked for me. > > Not working code: > > viewer->SetInput(image); > viewer->SetColorWindow(1230100); > viewer->SetColorLevel(615050); > viewer->SetupInteractor ( m_pVTKWindow ); > > Working code: > > viewer->SetColorWindow(1230100); > viewer->SetColorLevel(615050); > viewer->SetupInteractor (NULL); > viewer->SetRenderWindow(m_pVTKWindow->GetRenderWindow()); > viewer->SetInput(image); > viewer->GetRenderer()->ResetCamera(); cool, thanks for report ! > The problem for me now is that I have this black border around my image. I > have attached an example of what I mean. My image does resize properly when > I change the window size but the black border is always there. Do you have > any ideas about how I can get rid of it? I have absolutely no clue what you mean, sorry. When using vtkImageViewer2 (vs vtkImageViewer) your 2D slice is displayed in the 3D world (as a texture), so the background is black by default. I guess there should be an option to set it to something else ... > Also as a quick aside, I am getting the following error message > (vtkInteractorStyleJoystickCamera (09E7D2C8): Timer start failed) when I > click on my window. I understand this is just a one time warning that I > won't get again when I close the error message. I'm wondering is there > something I can do in code so that I don't get this message (even if the > only way is the disable the camera functionality somehow). I think you can press 'c' to use camera mode instead of joystick mode. This has been broken in VTK since > VTK 4.5 (AFAIK). Simply set another interactor style that does not rely on the timer API. 2cts -- Mathieu |