[Insight-developers] ImageViewer working

Luis Ibanez luis.ibanez@kitware.com
Wed, 16 Oct 2002 22:44:50 -0400


Hi,

The issues on the ImageViewer seem to be solved
now.


An example on its use was added to


     Insight/Examples/ImageViewer


It looks pretty much like a filter:

----------------

typedef itk::ImageViewer< ImageType > ViewerType;
ViewerType::Pointer viewer = ViewerType::New();
viewer->SetInput( filter->SetOutput() );
viewer->Update();

ViewerType::StartInteraction();  // event loop


-----------------

So far it supports Scalar images (any type) in
2D and 3D. Images are automatically normalized
to fit in the 0:255 intensity range.

When displaying 3D images the following Key callbacks
have been defined:

'f' = forward = go to next slice
'b' = back    = go to previous slice
'x' = axis X  = cut slices on the YZ plane
'y' = axis Y  = cut slices on the XZ plane
'z' = axiz z  = cut slices on the XY plane


Mouse clicks are returned vie Observers/Command.
a couple of events are defined in

   Insight/Code/IO/itkImageViewerWindow.h

   - MouseEvent()
   - KeyPressedEvent()


-------------------

The not so good news is that this requires GLUT to
be installed in your system. This is not an issue
on Linux. MS-Windows will have to install it as
binaries or built it from sources. It can be found at

    http://www.xmission.com/~nate/glut.html

Does somebody knows of a more official site ?

------------

This seems to be the simplest portable way of
displaying images. Altough GLUT must be installed,
the process is simpler than using FLTK or QT.


GLUT has also "mui" which is a minimal GUI library
based on OpenGL. It is possible to create menus,
buttons and scrollbars. It is not the best GUI
in the world but for the price it is not a bad
deal.


The ImageViewer<> is using George Stetten's GlutMaster
classes added in Insight/Utilities.



   Luis