ITK icon indicating copy to clipboard operation
ITK copied to clipboard

BUG: code crashes when DICOM with 12 bits allocated is processed

Open Purushoth24051999 opened this issue 3 months ago • 4 comments

PR Checklist

  • [x] No API changes were made (or the changes have been approved)
  • [x] No major design changes were made (or the changes have been approved)
  • [ ] Added test (or behavior not changed)
  • [ ] Updated API documentation (or API not changed)
  • [ ] Added license to new files (if any)
  • [ ] Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • [ ] Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for further development details if necessary.

Purushoth24051999 avatar Oct 17 '25 08:10 Purushoth24051999

This PR maybe/probably should have been made against upstream.

dzenanz avatar Oct 17 '25 12:10 dzenanz

This PR maybe/probably should have been made against upstream.

@dzenanz

I've tried malaterre/GDCM

by building with ITK_USE_SYSTEM_ITK as ON and linked External GDCM as you suggested it works fine for 12 bits allocated and NRRD file is generated without any issues

But I have few questions here, According to DICOM standard Bits allocated can be either 1 or multiples of 8 else it is invalid but here instead of throwing error the handling made in malaterre/GDCM proceed to NRRD generation is it acceptable.

If so, I have modified this PR according to malaterre/GDCM to change contents of gdcmRAWCodec.cxx and gdcmBitmap.cxx files please review it.

Purushoth24051999 avatar Oct 22 '25 06:10 Purushoth24051999

It would be ideal if @malaterre tagged a new version. Meanwhile, I will open a PR to update bundled GDCM from 3.2.1 to 3.2.2.

dzenanz avatar Oct 22 '25 15:10 dzenanz

PR #5568 opened.

dzenanz avatar Oct 22 '25 15:10 dzenanz