[Insight-users] itk::ImageSeriesReader Thead-Safe
Alessandro
notinmyhead at gmail.com
Wed Jun 26 04:45:33 EDT 2013
Hello,
I need to read, concurrently a single folder full of different DICOM file. So I do things this way:
1. In the main thread, I resort to GDCMFilenameGenerator to properly "read" the folder and get the UID of the series within it
2. Still in the main thread, I get all filenames (the vector of strings) in each series, making a copy in a single element of std::vector < std::vector < std::string> > >. This way I should be able to perform the reading of each set of files.
3. I run a thread for each set of files (that are stored in different location due to the vector)
Then each single thread instantiate its own ImageSeriesReader and GDCMImageIO but only under OSX the Update() methods seem to work properly, while I cannot see a single reason to crash on Linux...
Thanks.
Ale
Il giorno 25/giu/2013, alle ore 21.02, Bradley Lowekamp ha scritto:
> Hello,
>
> What is your Image file type you are using? What is the ImageIO class used?
>
> Can you please specify what type of thread "safety" you mean? The ITK pipeline is inherently not concurrent thread safe. Meaning that you can not call Update from a single object from multiple threads.
>
> Ingeneral you can create multiple independent pipelines and execute them in different threads. However, there are certain methods in VNL from fortran, and other libraries such as ImageIO third parties that may have some issues.
>
> You can likely share an image as input to multiple pipelines as long as in has no source filter and it's buffered region is the same as the largest possible region.
>
> I hope that helps.
>
> Brad
>
> On Jun 25, 2013, at 3:30 AM, Ale S <notinmyhead at gmail.com> wrote:
>
>> Hello,
>>
>> I wonder if there's any plane to make the itk::ImageSeriesReader thread-safe. I kind of use it a lot and whenever I switch to some boost::thread implementation, the Update method crash on Linux...
>>
>> Thanks,
>> Ale
>> _____________________________________
>> 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