AW: [Insight-users] Process Bar problem in ITK program

jiang jiang at TI . Uni-Trier . DE
Wed, 3 Dec 2003 17:12:01 +0100


Hi Luis,
Thank you very much for your detailed answer. I read the documents as your
hints, and integrate the QtITK's QtProcessBar into my code. However, when I
run application, the progress bar doesn't work. The progress bar's frame is
showed on the screen as I set in the program. But the progress bar doesn't
go ahead even the whole application is over.
The following is my code:



void initializeProgressBar()
{

		FilterPointer  m_Filter;
		m_Filter=lg->GetFCFilter();//to get FuzzyConnectedness pointer. At this
time, the pointer is just constructed, without any operations.
  // Connect the progress bar to the ITK processObject
  qs->Observe( m_Filter.GetPointer() );

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

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

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

lg->FCSegmentation();//Perform the FuzzyConnectedness segmentation

}

Call initializeProgressBar() when use clicks the command button.


Is there something wrong in my code? Why progress bar doesn't run?

With best regards,

Chunyan

-----Ursprungliche Nachricht-----
Von: Luis Ibanez [mailto:luis . ibanez at kitware . com]
Gesendet: Mittwoch, 3. Dezember 2003 01:33
An: jiang
Cc: ITK
Betreff: Re: [Insight-users] Process Bar problem in ITK program


Hi Chunyan,

ITK filters use the paradigm of Event/Observers
You will find a description of this concepts in
the software guide

    http://www . itk . org/ItkSoftwareGuide . pdf

please look at Chapter 3, "System Overview"
pdf-page 45.

Examples on the use of Observers are abundant on
the Registration chapter.

You will also find descriptions on how to use
observers in the tutorial sessions:

In particular in "ITK Architecture" :
http://www . itk . org/CourseWare/Training/GettingStarted-III . pdf


For code examples on how to integrate ITK with Qt,
please look at the tutorial:

        "ITK and Graphical User Interface"
http://www . itk . org/CourseWare/Training/GettingStarted-IV . pdf


You will find code examples about interfacing Qt and ITK in


      InsightApplications/QtITK


There is an explicit example on how to create a QtProgress
bar that is connected as observer of the ProgressEvents
sent by an ITK filter.

Look at:

     itkQtProgressBar.h
     itkQtProgressBar.cxx

http://www . itk . org/cgi-bin/cvsweb . cgi/InsightApplications/QtITK/?cvsroot=Ins
ight




Regards,


    Luis



--------------------------------------
jiang wrote:

> Hi,
> I can use FuzzyConnectedness to do segmentation in my program. However,
the
> segmenting process is a time consuming work. I want to use process bar to
> indicate the progress. When I debug the code, I find that there is only
one
> line is very slow. It is m_Filter->Update(); This step occupies almost 80%
> process time.
> How can I separate m_Filter->Update(); in several steps, or use other
method
> to show the process of the segmentation?
> I use Qt as GUI.
>
> Thanks a lot!
>
> Chunyan
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>