dcmqi (DICOM for Quantitative Imaging) is a free, open source C++ library for conversion between imaging research formats and the standard DICOM representation for image analysis results
I recently looked into the performance issue with writing segmentations
(and other objects based on functional groups).
As I thought, the main speed issue is the checking of the functional
group structure. It's possible to speed this up (I think) by changing
the way functional groups are organized and accessed in memory and I put
it on my list to enhance this in the future.
For now, I did two things:
For some objects the checking has been performed twice, including
segmentations, i.e. updating to new code will speed up writing by
factor ~2.
Also, if you use the same code over and over again to produce the
segmentation objects, you probably do not require to check the
correctness of the functional groups at all. In such cases it only makes
sense to use the checking when you develop your own code and test with
some instances.
As an impliciation I think it is useful to just optionally disable the
checks. That's now possible too and makes writing even large
segmentation objects very fast.
Following on email from @michaelonken: