Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cancelling/aborting the saving of DICOM image stacks (itk::GDCMImageIO::Write) #560

nocnokneo opened this Issue Feb 28, 2019 · 2 comments


None yet
3 participants
Copy link

nocnokneo commented Feb 28, 2019


Using compression when writing a large stack of slices to DICOM can take a significant amount of time. To allow the end user of a ITK-based application to cancel saving a DICOM image stack there needs to be a way in the itk::GDCMImageIO::Write call stack to abort the encoding process somehow. For example, with JPEG encoding, some sort of abort flag would need to reach all the way into loop in gdcm::JPEGCodec::Code that iterates over slices:

1  gdcm::JPEGCodec::Code                                            
2  gdcm::ImageChangeTransferSyntax::TryJPEGCodec                    
3  gdcm::ImageChangeTransferSyntax::Change                          
4  itk::GDCMImageIO::Write                                          
5  itk::ImageFileWriter<itk::Image<unsigned char, 3u>>::GenerateData
6  itk::ImageFileWriter<itk::Image<unsigned char, 3u>>::Write       
7  itk::ImageFileWriter<itk::Image<unsigned char, 3u>>::Update      

Additional Information

Upstream GDCM feature request which must be done first:


This comment has been minimized.

Copy link

blowekamp commented Feb 28, 2019

For reference the itk::ImageIO class is derived from the LightProcessObject which as an AbortGenerateData method. Additionally, a basic ITK process object would call some "progress" reporting methods which would check if the abort flag for the process add been set.

So the way to add the "abort" feature, may be to add a "progress" feature.


This comment has been minimized.

Copy link
Contributor Author

nocnokneo commented Feb 28, 2019

So the way to add the "abort" feature, may be to add a "progress" feature

Yes, that can work as long as the "progress" feature reaches all the way into the various GDCM codecs (e.g. gdcm::JPEGCodec::Code which can easily take a minute for a large dataset)

@thewtex thewtex added the area:IO label Feb 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.