[vtkusers] no zooming with vtkImageViewer
Roelof Kemp
rkemp at few.vu.nl
Fri Feb 16 07:54:17 EST 2007
Hi all,
I've a small code example. Would anyone please have a look at it and
help me? I've troubles with interacting with an image. I made the code
example as basic as possible (it is Java but that shouldn't be a problem
I hope...). Are there any errors in the sequence of the my calls? Do I
miss any calls? Should I use other calls / objects instead
(vtkImageViewer2?)? I'd like just to zoom/pan/rotate the image.
Thanks in advance,
Roelof
---code---
vtkImageData imageData = new vtkImageData();
/* read data, set dimensions etc. */
vtkImageMapToRGBA map = new vtkImageMapToRGBA();
map.SetInput(imageData);
map.SetLookupTable(lut); /* lut already created */
vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
vtkImageViewer viewer = new vtkImageViewer();
viewer.SetupInteractor(iren);
iren.SetRenderWindow(viewer.GetRenderWindow());
viewer.SetInput(map.GetOutput());
/* set viewer's color window and color level, position and size */
viewer.Render();
iren.Initialize();
iren.Start();
More information about the vtkusers
mailing list