How can I use ITK quickly reads DICOM file sequence and reconstructs it?
Can I use multi thread or Segmented reading?
And now I just read dicom file sequence by ITK::ImageReader::SetDirectoryName and update()
I am not sure which fraction of the time is spent analyzing DICOM tags in order to determine which file belongs to which series. If that is a large percentage, you cannot gain much by parallelizing the second part, which is reading the files into a 3D volume. Also, your read speed might be limited by the hard disk, in which case you will gain nothing by parallelizing the reading and might even lose some speed. Maybe @mathieu.malaterre, @zivy or @blowekamp could comment?
The GDCM does seem to use a bit of CPU, so some performance benefits could be gained from parallel reading.
I have had some difficulties using multi-threads to concurrently read with the GDCMImageIO, leading me to believe it it not concurrent thread safe.
Recently I have been using SimpleITK with heavy weight processes and Image pickling to concurrently read large number of DICOM x-rays with success and improved performance.
Processing all the meta-data to reconstruct the volume from the slices would be tricky to accommodate all cases.
thank you very much! I will try!
Actual DICOM reading performance does not matter as much as the perceived performance, i.e., ātime to first imageā.
If you want to improve the user experience then I would recommend not to spend time with multithreading or other algorithmic optimizations, as DICOM readers are already fairly optimized, so you can only expect very modest performance improvement (at best maybe 2-3x faster loading). Instead, show the first image very quickly (it means 100x faster āloadingā). While the user is busy looking at that first image, you can load the full volume in the background, maybe progressively showing more slices as they arrive.