[Insight-users] How does SimpleMemberCommand work in ThresholdSegmentationLevelSetFltkGui?

jiang jiang at TI.Uni-Trier.DE
Mon, 5 Jan 2004 17:40:26 +0100


Hi ITK users,
In the example application ThresholdSegmentationLevelSetFltkGui, when the
segmentation is running, the output window will be updated in every
iteration progress. I look into the code and find that it may be realized
by:
  // set up the segmentation observer
  typedef itk::SimpleMemberCommand< SegmenterConsole > SimpleCommandType;

  SimpleCommandType::Pointer iterationCommand = SimpleCommandType::New();
  iterationCommand->SetCallbackFunction( this,
      & SegmenterConsole::UpdateViewerAfterIteration );

  m_thresholdSegmentation->AddObserver( itk::IterationEvent(),
iterationCommand );

And another function SegmenterConsole::UpdateViewerAfterIteration draws the
result in every iteration. I don't know how SimpleMemberCommand works in
this case. How to evoke the iterationCommand. If I want to realize the
similar function, what should I do?
Please show me step by step. For example, if the first step is to click one
button to do the segmentation work in one function Segment(), then what is
the next step?


Thank you very much!


Chunyan