[Insight-users] variogram / cancel update method

Luis Ibanez luis.ibanez at kitware.com
Tue Aug 3 09:47:57 EDT 2004


Hi Glenn,

The process for aborting is closely related to the Progress report
and/or the Iteration report. When your filter is running (e.g. in
the GenerateData() method. You should be invoking Progress events
and/or Iteration events from time to time.

The GUI that listens to these events should offer the user a "Cancel"
button where she/he can click in order to stop the execution of the
filter. The Callback of such button just need to invoke in the ITK
filter the method:

               filter->SetAbortGenerateData(true);

This will stop the execution of the filter.

Note that before attempting to run the pipeline again. You must
invoke the method ResetPipeline() since many filters will be in
the middle of their Update() process.


Question:

    The Variogram code that you sent, is it intended as a contribution
    to ITK, or just for the purpose of demonstrating the problem that
    your are facing ?



Please let us know,


    Thanks



         Luis




---------------------------------
Glenn Pierce wrote:

> Hi
> 
> I have developed a variogram filter that still needs a bit of tidying
> work. I have attached it.
> 
> This variogram is very processor intensive. 
> In the worst case O(N^2), where N is the number of pixels of an image.
> (In reality there are optimisations I have placed in means the
> performance is quite a bit better than this). However for large images
> it would still be slow. 
> 
> 
> For my main project I am calling the update method of the variogram
> filter in a separate thread, and wanted to allow users to cancel the
> execution.
> 
> For this reason I wondered if there is an accepted way in ITK or any
> examples to cancel the update method or in my case tell the variogram
> filter to stop the loop in the update method ?
> 
> 
> Thanks for the help
> 
> Glenn
> 
> 
>





More information about the Insight-users mailing list