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

Siemens XA partial volumes in 4D datasets #742

Closed
neurolabusc opened this issue Aug 16, 2023 · 5 comments
Closed

Siemens XA partial volumes in 4D datasets #742

neurolabusc opened this issue Aug 16, 2023 · 5 comments

Comments

@neurolabusc
Copy link
Collaborator

For 4D timeseries (T2* fMRI, DWI) Siemens XA enhanced format DICOM will generate one file for each 3D volume. However, if the series is interrupted, a valid DICOM is generated with fewer slices than other images in the series. For example, for a fMRI series with 48 slices, all complete volumes might report:

(0028,0008) IS [48]  #   2, 1 NumberOfFrames

However, if the series is interrupted, the final volume might only save six slices:

(0028,0008) IS [6]  #   2, 1 NumberOfFrames

Since NIfTI requires each volume in a 4D series have the same number of slices, dcm2niix will currently save the data as two files: one 4D image with 48 slices and one 3D image with 6 slices. However, this requires one of the images gets the a suffix appended to the filename to avoid name clashes. However, since the images are tied, one can not be certain if the complete or partial volumes will get the suffix. A better solution would be to discard partial volumes. There are two solutions:

  1. Complete volumes should have values 0..NumberOfFrames-1 in MultistepIndex (0021,115E). This is not the case for partial or interleaved partial volumes. However, this detection fails for partial volumes with sequential acquisition.
  2. The undocumented element ICE_Dims[20] of
    ICE_Dims (0021,118e) appears to store the number of slices for a complete acquisition (e.g. 48). This is a good solution if this is the consistent usage of this array element:
 (0021,118e) ST [X_1_1_1_1039_1_1_29_1_1_9_1_114_1_1_1_1_2000_2_1_48_1_1] #ICE_Dims
@neurolabusc
Copy link
Collaborator Author

@Jolinda can you test the latest commit to the development branch and close this issue if it resolves your issue.

git clone --branch development https://github.com/rordenlab/dcm2niix.git
cd dcm2niix/console
make
./dcm2niix

This commit will read the extended ICE_dims[20] (0021,118e) to determine the number of frames specified by the sequence. If this differs from the number of frames (0028,0008) stored. If these values differ:

  • A message will be generated, e.g. Warning: Series 7 includes partial volume (issue 742): 6 slices acquired but ICE dims (0021,118e) specifies 48
  • The series number is incremented by 1000. (therefore, for series 7 complete volumes will report being series 7, while the aborted volume will report series 1007).
  • The partial volume will be flagged as being derived. Therefore, the dcm2niix flag -i y will ignore the partial volume and only convert complete volumes.

@Jolinda
Copy link

Jolinda commented Aug 25, 2023

Tested, works perfectly.

@captainnova
Copy link
Collaborator

Hi @neurolabusc, I think we are running into an unintended side effect of this for XA30 DICOM stored in classic mode. (Not recommended, I know, but many hospital systems still aren't compatible with enhanced.)

Some time back our local (but different building) scanner quietly switched from sending enhanced to classic DICOM, and the visible symptom is warning messages from dcm2niix like

Chris Rorden's dcm2niiX version v1.0.20240325  (JP2:OpenJPEG) (JP-LS:CharLS) GCC8.5.0 x86-64 (64-bit Linux)
Found 81 DICOM file(s)
Warning: Series 14 includes partial volume (issue 742): 1 slices acquired but ICE dims (0021,118e) specifies 81 
Warning: Series 14 includes partial volume (issue 742): 1 slices acquired but ICE dims (0021,118e) specifies 81 
Warning: Series 14 includes partial volume (issue 742): 1 slices acquired but ICE dims (0021,118e) specifies 81 

(1 per slice)

and the series number being incremented by 1000, which is the problem we actually care about. Otherwise the output is fine.

We are also receiving non-enhanced DICOM from a different XA30 site, and for that we don't get the problem. It does give the earlier issue 236 warning, but that's OK:

Chris Rorden's dcm2niiX version v1.0.20240325  (JP2:OpenJPEG) (JP-LS:CharLS) GCC8.5.0 x86-64 (64-bit Linux)
Found 1040 DICOM file(s)
Warning: Siemens XA exported as classic not enhanced DICOM (issue 236)
Convert 1040 DICOM as ./MR_8001_Axial_NII_6_(DBSI)_Axial_NII_6_(DBSI)_20240312113551_8001 (120x120x80x13)
Conversion required 16.786994 seconds (0.711800 for core code).

Interestingly, we are not receiving the number of frames (0028,0008) tag from either site. Locally we are getting

(0021, 118e) Private tag data                    ST: 'X_1_1_1_1_1_1_21_1_1_41_1_31_1_1_1_1_7_2_1_81_1_1'

...which matches the 81 slices and supports the pattern you guessed at above. But we are not getting (0021, 118e) from the working site. It seems like two wrongs are better than one here, since both things being missing appear to stop the comparison from going ahead.

Neither site appears to be overanonymized; as far as I can tell the presence or absence of (0021, 118e) and/or (0028, 0008) is a vagary of the various XA30 options. Is it possible to refine the partial volume check in this issue so it only triggers on definite evidence of missing slices, instead of uncertainty?

From trying different dcm2niix versions, this behavior appeared sometime between 2022-10-13 and 2024-02-02, which is consistent with this issue.

@captainnova captainnova reopened this Apr 17, 2024
@Ann1Ko
Copy link

Ann1Ko commented May 14, 2024

Hi! I'm pretty new to fMRI analysis and ran into the same issue that gave me the warning: "Series 10 includes partial volume (issue 742): 35 slices acquired but ICE dims (0021,118e) specifies 48".

So did I understand correctly that when using dcm2niix -i y, this partial volume is simply discarded, which is not critical anyway for my analysis? Thanks! Annika

neurolabusc added a commit that referenced this issue May 23, 2024
 Disable XA partial vol detection for single slice files (#742)
@neurolabusc
Copy link
Collaborator Author

Closed with PR 814

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

4 participants