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

How does dcm2niix determine SBREF dicom files? #816

Closed
John-Chin opened this issue Apr 29, 2024 · 3 comments
Closed

How does dcm2niix determine SBREF dicom files? #816

John-Chin opened this issue Apr 29, 2024 · 3 comments

Comments

@John-Chin
Copy link

I am wondering how dcm2niix determines/distinguishes SBREF dicom files from BOLD dicom files.

I am working with a dataset where in the raw data, the dicom tags of SeriesDescription, ProtocolName, NumberOfFrames, and ImageType all do not give hint whether the dicom is part of an sbref image or bold image. (This was in part due to the naming protocol before the actual scanning).

Yet somehow, when I run dcm2niix to convert the dicom files to nifti, it correctly identifies and separates the multi-echo bold runs from the SBREF - and it does so by adding the number 10 before the SeriesNumber.

Ex:
bold file: _fMRI_cmrr_mbep2d_bold_3echo_MB=1_2.2s_TR_PE=32_20240321101542_29_e3
SBREF: _fMRI_cmrr_mbep2d_bold_3echo_MB=1_2.2s_TR_PE=32_20240321101542_1029_e3

Do we know how dcm2niix can tell the difference behind the scenes? It would be helpful for me as I am trying to filter out the SBREF dicoms from my raw dicom dataset. Thanks.

@neurolabusc
Copy link
Collaborator

The single-band reference is useful because it has more contrast and signal than the subsequent multi-band image. However, you want to save them separately as they do not share the TR, T1-weighting, etc of the subsequent multi-band images. dcm2niix uses ICE_Dims to detect scans. Following Siemens convention for derived images, the series number for SBRef images is incremented by +1000 to disambiguate from the other series.

@John-Chin
Copy link
Author

Thank you for your quick response.

Do you know how I could access the ICE_DIMS tag manually?
I've tried the below

 dataset = pydicom.dcmread(filepath)
 print(dataset[0x0021,0x1106])

and have gotten the error:

Traceback (most recent call last):
  File "dicom_loop.py", line 66, in <module>
    print_dicom_metadata(directory)
  File "dicom_loop.py", line 43, in print_dicom_metadata
    print(dataset[0x0021,0x1106])
  File "/home/lsanlab/.local/lib/python3.7/site-packages/pydicom/dataset.py", line 852, in __getitem__
    data_elem = self._dict[tag]
KeyError: (0021, 1106)

So it seems like my dicom files do not have this 0021,1106 tag (as described in the link you shared). Although this might be because our manufacturer model is 'MAGNETOM Prisma Fit' so I am probably using V-series dicoms (not X-series)?..

I am a bit new to sorting out dicom file types, so thank you for your help. Also, if you have any other ideas on how to manually exclude SBRef dicom files from a dataset, please pitch in. Right now my idea is just to loop through all the dicom files in the dataset, and remove files that match a certain "SBRef-identifying" criteria. (The only trouble here is finding the right criteria..)

@neurolabusc
Copy link
Collaborator

The Prisma can run either V-generation (e.g. VE11) or XA (XA30). I would reach out to the Siemens Research Collaboration Manager affiliated with your center to gain insight. You can convert the main DICOM header to a text file with gdcmdump:

 gdcmdump img.dcm > hdr.txt

For V-generation, the proprietary CSA header includes a lot of details:

 gdcmdump --csa img.dcm > hdr.txt

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