[Insight-users] Multi-threading a filter

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Nov 28 08:52:48 EST 2012


Hello Jack,

I didn't realize that filter was not multi-threaded. I think it should be too.

There is a similar filter in the Review module:

https://github.com/Kitware/ITK/blob/master/Modules/Nonunit/Review/include/itkHessianToObjectnessMeasureImageFilter.hxx


What strikes me as different in the Vesselness filter is that is used the SymmetricEigenValueFilter. Executing that filter should not be run inside ThreadedGenerateData, as it would cause concurrent execution of the same filter, which would be bad.

I would adopt the Objectness's usage of the SymmetricEigenAnalysis calculator in the ThreadedGenerateData method.

Brad

On Nov 28, 2012, at 7:16 AM, Jack Lee <jack.lee at kcl.ac.uk> wrote:

> Hi there,
> 
> I am trying to implement a multithreaded version of the 
> itkHessian3DToVesselnessMeasureImageFilter.hxx. To do this, I've 
> followed these steps (sorry it's a bit messy):
> 
> 1) Created
> ThreadedGenerateData(const OutputImageRegionType &region, ThreadIdType 
> threadId)
> 
> 2) changed the iterators' second parameter from
> 
> it = ImageRegionConstIterator< EigenValueOutputImageType >(
> eigenImage, eigenImage->GetRequestedRegion() );
> 
> to
> 
> it = ImageRegionConstIterator< EigenValueOutputImageType >(
> eigenImage, region );
> 
> and similarly with
> 
> oit = ImageRegionIterator< OutputImageType >( output, region );
> 
> 3) commented out the line    this->AllocateOutputs();
> 
> 
> This code segfaults, sometimes with error messages indicating that 
> ImageConstIterator is trying to access indices outside the buffered 
> region, and other times just with a silent core dump. If anybody can 
> explain to me what is wrong with the changes made above (or, indeed 
> steps I might have missed out) I'd appreciate it very much.
> 
> Best wishes,
> Jack
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list