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

Consider increasing the number of significant digits in the ImagingFrequency tag #685

Closed
po09i opened this issue Mar 4, 2023 · 3 comments

Comments

@po09i
Copy link

po09i commented Mar 4, 2023

Describe the bug

The ImagingFrequency tag of the BIDS Json sidecar has a limited number of significant digits.
Screen Shot 2023-03-03 at 7 47 01 PM

This introduces limitations since that tag only stores the approximate B0 frequency used during a scan. This is very limiting for a particular application I am doing where I need to know the exact frequency used during a scan.

Since the DICOM tag has the significant digits up to Hz, I was wondering why the ImagingFrequency tag is truncated and if there is a good reason for it. If not, I would suggest increasing the number of significant digits to match the source (DICOM) so that no information is loss during the conversion of that tag.

To reproduce

Run dcm2niix on any MRI data. (I tried Siemens and Philips data)

Expected behavior

ImagingFrequency tag to have significant digits up to the same level as the original DICOM files.

Version

Please report the complete version string:

  • Chris Rorden's dcm2niiX version v1.0.20220720 Clang13.0.1 x86-64 (64-bit MacOS)
    v1.0.20220720
@po09i po09i changed the title Increase the number of significant digits in the ImagingFrequency tag Consider increasing the number of significant digits in the ImagingFrequency tag Mar 4, 2023
@neurolabusc
Copy link
Collaborator

It is unfortunate that both DICOM and BIDS use decimal strings rather than IEEE binary floats for storing many values including imaging frequency 0018,0084. As Kernighan and Plauger note Floating point numbers are like piles of sand; every time you move one you lose a little sand and pick up a little dirt.

What value does the input DICOM image provide?

dcmdump --search 0018,0084 /path/to/dicom.dcm

@neurolabusc
Copy link
Collaborator

I note that with enhanced DICOM Transmitter Frequency (0018,9098) is provided as a double precision binary. If you test the developmental branch, you will find enhanced precision, but you may need enhanced DICOM to see optimal precision.

@po09i
Copy link
Author

po09i commented Mar 4, 2023

Thank you for your quick replies.

What value does the input DICOM image provide?

dcmdump --search 0018,0084 /path/to/dicom.dcm
(0018,0084) DS [123.260423]                             #  10, 1 ImagingFrequency

Using the development branch, I now see the same precision as the DICOM files:

Screen Shot 2023-03-04 at 9 39 35 AM

Thanks a lot for the quick changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants