[ITK-users] Multithreading of a pipeline
Jim Miller
millerjv at gmail.com
Tue May 20 12:04:29 EDT 2014
Threading in ITK is done within a filter at the discretion of the filter designer. Wrt your pipeline, the BinaryThreshold will thread itself across processors. On the other hand, I think the GrayscaleDilate is currently using a very fast single threaded implementation (faster than the naive multithreaded algorithm).
Note, there is a SliceBySlice filter that makes running 2D pipelines on 3D data sets easy to set up. It does all the data management for you. However, it will not add threading over the slices. It just runs them sequentially.
One though is whether you need to extract the the slices to process. Obviously a binary threshold will produce the same answer whether run in 3D or sequentially in 2D. With proper construction of you structuring elements, the morphology operators can run in 3D as if they are running sequentially in 2D. These strategies may improve the threading load.
Jim
> On May 20, 2014, at 10:01 AM, Mirco Serra <mirco9091 at hotmail.it> wrote:
>
> Hi guys,
>
> I need your help to better understand the multithreading in ITK. In fact, I'm trying to use it to speed up a pipeline that would take ages otherwise, but I keep getting errors. In particular, what I need to do is to extract an image from a 3D dataset (using ExtractImageFilter), apply a grayscale dilation (using GrayscaleDilateImageFilter) and then a thresholding (with BinaryThresholdImageFilter). This operation has to be repeated on all the axial images of the dataset, so I'm using a simple for loop along z. Since my datasets may be very big (up to 500 images), without using a multithread the system takes a very long time. Do you think a multithreading might help me reduce the computational time? Do you have any example I could follow fort that?
>
> Many many thanks,
> Mirco
> _____________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140520/3fd12348/attachment.html>
More information about the Insight-users
mailing list