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

dcm2niix splits BOLD series (enhanced DICOM, Siemens Prisma XA30) into 2 series #599

Closed
osamaNYUAD opened this issue Apr 18, 2022 · 11 comments

Comments

@osamaNYUAD
Copy link

dcm2niix splits bold time series into 2 separate files, although both files belong to the same bold run. All the dcm files in the folder are the same size, and they belong to the same run, and although in this case dcm2niix finds 398 files, it outputs them into 2 separate files (containing 93 and 305 files respectively). Any suggestion how we can avoid this unwanted behavior?

dcm2niix /Users/oa22/Desktop/dicom_from_prisma/Brain_Protocols/func-bold_task-BETS_run-01_14
Chris Rorden's dcm2niiX version v1.0.20211006 Clang12.0.5 x86-64 (64-bit MacOS)
Found 398 DICOM file(s)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 93 DICOM as /Users/oa22/Desktop/dicom_from_prisma/Brain_Protocols/func-bold_task-BETS_run-01_14/func-bold_task-BETS_run-01_1_0014 (80x80x44x93)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 305 DICOM as /Users/oa22/Desktop/dicom_from_prisma/Brain_Protocols/func-bold_task-BETS_run-01_14/func-bold_task-BETS_run-01_1_0014a (80x80x44x305)
Conversion required 13.120417 seconds (12.737073 for core code).

@neurolabusc
Copy link
Collaborator

I do not have access to a XA scanner. If you want detailed feedback, can you please send a link for a Dropbox/GoogleDrive DICOM archive to my institution email address. However, I do urge you to take a careful look at issue 236. Specifically, Siemens notes that classic images are only for Having the option to export data in interoperability format will provide room to continue developmental activities for our research partners and give the chance to more third party processing software vendors to catch on. These images are limited relative to the enhanced export. This is an inherent limitation of the images, not dcm2niix and will be seen in other tools. Moving forward, I urge you to consider enhanced data export.

@osamaNYUAD
Copy link
Author

osamaNYUAD commented Apr 25, 2022 via email

@neurolabusc
Copy link
Collaborator

@osamaNYUAD this is a limitation with your DICOM images, not dcm2niix. Specifically, the dataset explicitly uses to different Series Instance UIDs (0020,000E), explicitly requiring that these images should not be combined as a single series. I am not sure why this was done, I suggest you work closely with your Siemens Research Collaboration Manager to rectify the situation. You could always make a fork of dcm2niix that ignores this tag, but the probability for unintended consequences would be very high, and therefore you would only want to use it on corrupted datasets.

@osamaNYUAD
Copy link
Author

osamaNYUAD commented Apr 26, 2022 via email

@osamaNYUAD
Copy link
Author

osamaNYUAD commented Apr 28, 2022 via email

@neurolabusc
Copy link
Collaborator

neurolabusc commented Apr 28, 2022

You can see the issue yourself by renaming instead of converting the DICOMs, and using 0020,000E for the folder name:

$ dcm2niix -r y -f %s_%j/%r.dcm ~/issue599

Note that dcm2niix segments instances 1..93 into one folder and 94..398 into another.

$ dcmdump +F +P 0020,000E ~/issue599/14_1.3.12.2.1107.5.2.43.166043.2022041113414823450655743.0.0.0/1.dcm
# dcmdump (1/1): ~/issue599/14_1.3.12.2.1107.5.2.43.166043.2022041113414823450655743.0.0.0/1.dcm
(0020,000e) UI [1.3.12.2.1107.5.2.43.166043.2022041113293118947653042.0.0.0] #  60, 1 SeriesInstanceUID
(0020,000e) UI [1.3.12.2.1107.5.2.43.166043.30000022041109193489100003194] #  58, 1 SeriesInstanceUID
(0020,000e) UI [1.3.12.2.1107.5.2.43.166043.2022041113414823450655743.0.0.0] #  60, 1 SeriesInstanceUID
$ dcmdump +F +P 0020,000E ~/issue599/14_1.3.12.2.1107.5.2.43.166043.30000022041109193489100003194/94.dcm
# dcmdump (1/1): ~/issue599/14_1.3.12.2.1107.5.2.43.166043.30000022041109193489100003194/94.dcm
(0020,000e) UI [1.3.12.2.1107.5.2.43.166043.2022041113293118947653042.0.0.0] #  60, 1 SeriesInstanceUID
(0020,000e) UI [1.3.12.2.1107.5.2.43.166043.30000022041109193489100003194] #  58, 1 SeriesInstanceUID

You can see that SQs are added that modify the 0020,000e. The first 93 images include a SQ with that reports UID change is due to COERCE:

(0400,0561) SQ (Sequence with explicit length #=1)      # 216, 1 OriginalAttributesSequence
  (fffe,e000) na (Item with explicit length #=5)          # 208, 1 Item
    (0400,0550) SQ (Sequence with explicit length #=1)      #  94, 1 ModifiedAttributesSequence
      (fffe,e000) na (Item with explicit length #=2)          #  86, 1 Item
        (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
        (0020,000e) UI [1.3.12.2.1107.5.2.43.166043.2022041113414823450655743.0.0.0] #  60, 1 SeriesInstanceUID
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
    (0400,0562) DT [20220411151445.03881]                   #  20, 1 AttributeModificationDateTime
    (0400,0563) LO [Siemens Healthcare syngo Transfer Framework] #  44, 1 ModifyingSystem
    (0400,0564) LO (no value available)                     #   0, 0 SourceOfPreviousValues
    (0400,0565) CS [COERCE]                                 #   6, 1 ReasonForTheAttributeModification
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem

For enhanced DICOMs, dcm2niix will use the final reported value of 0020,000e, regardless of whether it is in the main body or a SQ. I really do not understand why Siemens issues two different series UIDs for the same series.

I note that Philips and Canon enhanced DICOMs each pack all images from a series into a single file. In contrast, Siemens enhanced saves each 3D volume as a separate file. So solutions might be to assume that either the first usage of a UID should be used for the file, or the UID that is in the main body (instead of a SQ) should be used. Either of these solutions would work for your data, but without knowing the rationale of why multiple UIDs are generated, it is hard to know if either method is reliable. We really need some insight for what is happening here.

@neurolabusc
Copy link
Collaborator

@osamaNYUAD can you test the current development branch (v1.0.20220429). This version will ignore all DICOM tags in the Original Attributes SQ 0400,0561. I do not understand why only some images were modified, but ignoring the original values prior to modification seems justified.

@osamaNYUAD
Copy link
Author

osamaNYUAD commented Apr 30, 2022 via email

@neurolabusc
Copy link
Collaborator

Assuming you are using MacOS/Linux:

$ git clone --branch development https://github.com/rordenlab/dcm2niix
$ cd dcm2niix/console
$ make
./dcm2niix
Chris Rorden's dcm2niiX version v1.0.20220429  Clang12.0.5 ARM (64-bit MacOS)

If you are using Windows, you can get a precompiled version from AppVeyor.

@osamaNYUAD
Copy link
Author

osamaNYUAD commented Apr 30, 2022 via email

@ricardomar
Copy link

ricardomar commented Jun 27, 2022

Thank you @neurolabusc . That worked for me as well.

Ricardo

Assuming you are using MacOS/Linux:

$ git clone --branch development https://github.com/rordenlab/dcm2niix
$ cd dcm2niix/console
$ make
./dcm2niix
Chris Rorden's dcm2niiX version v1.0.20220429  Clang12.0.5 ARM (64-bit MacOS)

If you are using Windows, you can get a precompiled version from AppVeyor.

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

3 participants