[Insight-users] itk::QtProgressBar doesn't work with itk::ThresholdSegmentationLevelSetImageFilter

jiang jiang at TI.Uni-Trier.DE
Tue, 6 Jan 2004 17:10:09 +0100


Hi Luis,
I try to connect QtProgressBar with
itk::ThresholdSegmentationLevelSetImageFilter. The code is following. It
works before when I connect it with itk::MedianImageFilter as a test.

	ThresholdSegmentationLevelSetImageFilterType::Pointer m_Filter;
	m_Filter=ls->GetLSFilter();//"ls" is the pointer of the class which does
segmentation
  // Connect the progress bar to the ITK processObject
  qs->Observe( m_Filter.GetPointer() );

  typedef itk::QtSlotAdaptor<ThresholdSegmentationLevelSetImageFilterType>
SlotAdaptorType;
  SlotAdaptorType slotAdaptor;

  // Connect the adaptor to a method of the ITK filter
  slotAdaptor.SetCallbackFunction( m_Filter, &
ThresholdSegmentationLevelSetImageFilterType::Update );

  // Connect the adaptor's Slot to the Qt Widget Signal
  connect(LevelSetBt , SIGNAL(clicked()), &slotAdaptor, SLOT(Slot()) );

And the button is also connected with the function which performs the
threshold level set segmentation.
connect( LevelSetBt, SIGNAL(clicked()), this, SLOT(LevelSetSegment()));

LevelSetSegment()
{
	ls->Segment();
}
In ls->Segment, all parameters for
ThresholdSegmentationLevelSetImageFilterType are set up, and "Update()" is
called.

The progress bar works before when I connected it with
itk::MedianImageFilter as a test. The code is exactly same. But it doesn't
work now. I use Qt as UI, and ITK 1.4.

Furtheremore I have the documents you recommended in the last email,
however, I still have no idea about how to use IterationEvent to show
something when ThresholdSegmentationLevelSetImageFilter is running
iteratively, including the progress bar problem.
Thank you for your kind help!


Chunyan