[Insight-users] external function termination

Karthik Krishnan Karthik.Krishnan at kitware.com
Tue Jun 6 11:41:10 EDT 2006


Christoph Palm wrote:

>Hi everybody,
>
>I have got a question concerning the termination of a running function.
>
>Is there a way to premature stop a running function from outside the 
>function?
>  
>
In ITK/VTK, the general way to do this is to set the 
AbortGenerateDataFlag using an observer to an  IterationEvent. For 
instance compute intensitve filters will invoke iteration events after 
every iteration. Your Progress bar listents to these iteration events 
(so the user does not go nuts).  At this time, you can set the 
AbortGenerateDataFlag of the calling object and if the filter checks 
this flag during every iteration, you end up aborting.

>I would like to enable the user to abort a function (any current 
>calculation) if he wants to. If this happens, the current calculation 
>should stop immediately and free the allocated memory.
>
>Thanks for any hints!
>
>Christoph
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>  
>


More information about the Insight-users mailing list