[Insight-users] Courseware FLTK example question...

Luis Ibanez luis.ibanez@kitware.com
Thu, 20 Mar 2003 22:37:40 -0500


Hi Bill,

Your point is well taken,

You are right, this code will not display any image.

The example in slide 9 was mostly intended to show
*how to build* FLTK + ITK together rather that
making them to *do something useful* together.

An easy fix is to replace the plain Fl_Window
with the more useful class : Image2DViewer


for example:


  typedef float  PixelType;
  fltk::Image2DViewer< PixelType > ViewerType;

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

  filter->Update();

  viewer->SetImage( filter->GetOutput() );
  viewer->SetLabel("Output of Filter");


  viewer->Show();


  Fl::run();


Note that this application will have to link
with the FltkImageViewer library that is
created in InsightApplications/FltkImageViewer.


Please let us know if you find any other problem


Thanks


    Luis


----------------------------------
Bill Oliver wrote:
> I have been going through the courseware.  I have been able to compiles
> and run the VTK and FLTK examples, but have a question about the FLTK
> example in slide 9 of Getting Started IV.  While the VTK example given
> in the courseware correctly generates and displays an image, I only
> get a blank window with the FLTK version.  In looking at the example, I
> don't see an equivalent of VTKs viewer->SetInput(reader GetOutput).
> 
> The problem is not with the algorithm, since everything works
> with the VTK examples.
> 
> The problem is probably not with my FLTK installation, because
> the Insight Apps all seem to work (in particular
> RawImageReaderViewer).
> 
> So, where do I hook the image to the window?
> 
> Is this implied and not necessary for FLTK?
>    If so, what is missing to get the window to display the
>    image?
> 
> Is the equivalent line to viewer->SetInput() missing from the tutorial?
>    If so, what is it and where do I find out about it?
>    If it's in the tutorial and I've made a silly mistake,
>     where is it?
> 
> Is there a simpler FLTK example that doesn't use the
> Auxiliary/FltkImageViewer?  FltkImageViewer, while
> very nice, is a little complex for self-teaching
> FLTK.
> 
> 
> Thanks!
> 
> billo
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>