[Insight-developers] ImageViewer and GLUT

Luis Ibanez luis.ibanez@kitware.com
Wed, 16 Oct 2002 19:49:33 -0400


Hi Jim,

Yeap, as you already mention,
unfortunately GLUT doesn't seem to be installed
by default on Windows.

I installed it on Windows using the sources from
Nate Robins:

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

On Linux it is usually part of a standard distribution.

This itk::ImageViewer<> is an attempt to provide a
minimum image viewer for examples. Hopefully that will
make the itk::HelloWorld more appealing.

GLUT is the last desperate attempt before being forced
to print the pixels as ascii characters   :-)

-------

The use will look like:


typedef itk::Image<char,3>  ImageType;
typedef itk::ImageViewer< ImageType >  ViewerType;

ViewerType::Pointer  viewer = ViewerType::New();

viewer->SetInput( filter->GetOutput() );

viewer->Update();  // equivalent to viewer->Show();


ViewerType::StartInteraction();   // start the loop event.



The viewer is based on the GlutMaster classes written by
George Stetten. GlutMaster was ITK-ized and included in
the Insight/Utilities directory.

There are still some minor issues with the 3D images.
2D are working Ok.

This is a truly minimal viewer, no fancy features....
no zoom, no intensity windowing,..

Keyboard an mouse interaction (e.g. pixel picking)
are available though.


      Luis


==================================================================




Robert Tamburo wrote =====================

In the past with lab software, we manually installed Glut. Not sure if =
it still applies in itkLand, but here's how:

The GL subdirectory is in Visual Studio's include path:
X:\....\Microsoft Visual Studio .NET\Vc7\include\GL    --> move glut.h =
here

X:\....\Program Files\Microsoft Visual Studio .NET\Vc7\lib  --> move =
glut.lib here

Put glut.dll in the system32 directory.


   ----- Original Message -----=20
   From: Miller, James V (Research)=20
   To: Insight-developers (E-mail)=20
   Sent: Wednesday, October 16, 2002 9:26 AM
   Subject: [Insight-developers] GlutImageViewer woes


   Luis,

   I tried to use the glut image viewer that you are piecing together.  I =
hit upon the following issues:
     1.. Developer Studio .Net does not include glut in the default =
installation.  I didn't have my CD's with me last night to see if it is =
somewhere on the installation disk.  However, given MS's relationship =
with OpenGL, I would not be surprised if they no longer distribute glut. =

     2.. I downloaded a win32 binary installation of glut. FindGLUT.cmake =
of course did not find my new installation, so I told CMakeSetup where =
the glut.lib was.  Unfortunately, the binary installation of glut is =
just a directory with  "glut.h", "glut.lib", and a "glut.dll".  So when =
GlutMaster tries to include "GL/glut.h" is cannot find glut.h because =
the header is not in a subdirectory "GL".=20
     3.. I don't think my FindGLUT.cmake file sets ups a variable for the =
defining where the include directory for glut.h would be on a win32 =
system.=20
     4.. FindGLUT.cmake defines GLUT_LIBRARY but your CMakeLists.txt file =
references GLUT_LIBRARIES
    After this I lost interest and went about using VTK to view my =
images.=20