[Insight-users] Updating the ImageViewer

Darby J Van Uitert darbyb at cs . utah . edu
Wed, 25 Jun 2003 13:27:07 -0600 (MDT)


I have an application that uses the ThresholdSegmentationLevelSet filter.
I want to have my viewer update every 100 iterations or so. I have added
an observer so that it calls my UpdateMyViewer function every iteration.
That works. And I can get an fltk::Image2DViewer to update each
iteration.  But I want the segmented image to be an overlay to the original
image.  So before I view images, I cast them from 2D to 3D because the
fltk::ImageViewer has an overlay.

My problem is that the 3D viewer will not update the overlay until the
end.  I don't know if it is a pipeline issue either since in my
UpdateMyViewer function has an update call.  It basically does the
following:

void UpdateMyViewer()
{
  //cast 2D to 3D
  m_Caster->SetInput( m_thresholdSegmentation->GetOutput() );
  try {
    m_Caster->Update();
  }
  catch( itk::ExceptionObject & excep }
    {
      std::cerr << "Exception caught! " << excep << std::endl;
  }

  // 3D fltk::ImageViewer
  m_Viewer->SetOverlay( m_Caster->GetOutput() );
  m_Viewer->Update();
  Fl::check();

}

Any help would be appreciated.

	-darby j
---------------------------
Darby J Van Uitert
SCI Institute
University of Utah
Email: darbyb at cs . utah . edu
Phone: 801.585.1869
---------------------------