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

Luis Ibanez luis . ibanez at kitware . com
Fri, 05 Dec 2003 11:32:27 -0500


Hi Chuyan,

Thanks for letting us know about the result of your experiment.

Now we know that the Qt-ITK GUI connections are working fine.

You should now follow Yinpeng's advice and try the FuzzyConnectedness
filter with small data sets (preferably 2D) until you get familiar
with the characteristics of the method, in particular with the
heuristics for setting its parameters.

Please let us know if you find further problems,


Thanks,


   Luis


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

> Hi Luis,
> I do the test as you said. And I use the itkMedianImageFilter as the example
> in
> \InsightToolkit-1.4.0\Testing\Code\BasicFilters\itkMedianImageFilterTest.cxx
> . The process bar is exactly same as I used in FuzzyConnectedness filter.
> This time process bar works fine. Since the MedianImageFilter processes very
> fast, the process bar goes to full also very fast.
> What should I do with FuzzyConnectedness then?
> Thank you very much!
> 
> 
> Chunyan Jiang
> 
> -----Ursprungliche Nachricht-----
> Von: Luis Ibanez [mailto:luis . ibanez at kitware . com]
> Gesendet: Donnerstag, 4. Dezember 2003 18:34
> An: jiang
> Cc: ITK
> Betreff: Re: AW: [Insight-users] Process Bar problem in ITK program
> 
> 
> Hi Jiang,
> 
> Could you please do the following simple test :
> 
> Replace the FuzzyConnectedness filter with any
> other filter. For example the itkMedianImageFilter
> and run the application again to see if the progress
> bar in the GUI advances or not.
> 
> This will help to identify if the problem is related
> to your GUI code or to the pace at which the Fuzzy
> Connectedness filter is reporting its progress.
> 
> Please let us know what you find.
> 
> 
> Thanks
> 
> 
>    Luis
> 
> 
> 
> ------------------------
> jiang wrote:
> 
> 
>>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
>>>
>>
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk . org
>>http://www . itk . org/mailman/listinfo/insight-users
>>
> 
> 
> 
> 
>