-
Notifications
You must be signed in to change notification settings - Fork 228
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
Segmentation fault #633
Comments
Sounds like your CSA header is corrupted, MicroDICOM does not read the CSA header. Can you send the troublesome image to my institutional email. The other options to troubleshoot are to use dcm2niix in ogorrheic ( I also find compiling with the address sanitizer helpful:
|
Thanks for the quick reply. I've tried with the address sanitizer and get the following:
I also added -v 2 which gave the following additional output:
I've asked the data owner if I can have permission to share a DICOM file from this session - will get back to you if that's possible. |
The output of dcm2niix should work if you can get DICOM files where the CSA header is not corrupted. |
Ok, I will go back to the team that acquired the data and find out how they have anonymised these sessions - it may be a particular site doing something odd. I have also sent you an example DICOM file if that's helpful in confirming this. Thanks for the help |
hi @mcraig-ibme, just wanted to chime in and say that I have also experienced errors like this before due to clinical data being aggressively anonymized before sharing with us. it might take some negotiating with the team that is sharing the data to get the anonymization just right. |
@mcraig-ibme thanks for sending a sample image. The binary data of the CSA header has been corrupted. Each tag of this header should be precisely 192 bytes, but with your dataset all of the fields are a variable amount longer than 192. Using a hex editor you can see that every occurrence of 0xCD has been replaced 0xC38D. Perhaps some tool assumes these are strings and trying to convert ASCII acutes to Unicode characters. |
Sounds plausible. We have requested a repeat send of this data set and will try to debug from there. |
I have tried to make dcm2niix a bit more resilient for reading CSA tags. It will abort reading a CSA header if the n_tags exceeds 128. I assume the nipy documentation is correct. Since this is a proprietary Siemens format, it is theoretically possible that some valid Siemens images violate this assumption. Any images which exceed the limit should generate an error message that directs users to this issue. I am closing this issue as it reflects a corrupted DICOM file rather than a limitation with dcm2niix. |
We were getting spurious https://nipy.org/nibabel/dicom/siemens_csa.html suggests that the number of CSA tags should be between 1 and 128, but places no limit on the number of items a CSA tag may have, other than that the tag should fit inside the overall length of the CSA buffer. Unfortunately f7f376a checked the number of items per CSA tag instead of the number of CSA tags. PR coming shortly. |
PR merged, closing issue. |
Describe the bug
Segmentation fault trying to convert certain DICOM files
To reproduce
dcm2niix -o nifti 53
where 53 contains DICOMs from a certain scan session (all the scans in this session are failing to convert)
I have opened the DICOM files in MicroDICOM and they display OK
Output log
Run in gdb on fresh source build generating the following log
Version
Current Github code
dcm2niiX version v1.0.20220720 GCC9.3.0 x86-64 (64-bit Linux)
Also tried using development branch code, same error and backtrace
The text was updated successfully, but these errors were encountered: