Skip to content

Commit

Permalink
Guess temporal order (rordenlab/dcm2niix#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Aug 20, 2021
1 parent 7a1d505 commit bb5bb7c
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 18 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## About

`dcm_qa_philips_asl_enh` is a simple DICOM to NIfTI validator script and dataset. This repository is similar to [dcm_qa](https://github.com/neurolabusc/dcm_qa), but includes data from Philips MRI scanners. Specifically, this dataset uses [Arterial Spin Labeling (ASL)](https://crnl.readthedocs.io/asl/index.html). For ASL data from a Siemens scanner see [dcm_qa_asl](https://github.com/neurolabusc/dcm_qa_asl). The twin of this repository is [`dcm_qa_philips_asl`](https://github.com/neurolabusc/dcm_qa_philips_asl): this repository includes **enhanced** DICOMs (with an entire series saved in a single file), instead of **classic** DICOMs (where each 2D image is a separate file).
`dcm_qa_philips_asl` is a simple DICOM to NIfTI validator script and dataset. This repository is similar to [dcm_qa](https://github.com/neurolabusc/dcm_qa), but includes data from Philips MRI scanners. Specifically, this dataset uses [Arterial Spin Labeling (ASL)](https://crnl.readthedocs.io/asl/index.html). For ASL data from a Siemens scanner see [`dcm_qa_asl`](https://github.com/neurolabusc/dcm_qa_asl).

The image in this repsoitory were exported as enhanced DICOMs, to see the same datastet saved in classic format see [`dcm_qa_philips_asl`](https://github.com/neurolabusc/dcm_qa_philips_asl).

## Details

Expand Down Expand Up @@ -44,25 +46,29 @@ Philips ASL scans seem to suggest a [cardiac gated trigger](https://github.com/r
(0018,1060) DS [300] # 4, 1 TriggerTime
(0018,9085) CS [VCG] # 4, 1 CardiacSignalSource
```
To deal with this, dcm2niix will ignore the reported trigger time if the [Acquisition Contrast (0008,9209)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0008,9209)) tag reports `PERFUSION`.
To deal with this, dcm2niix will not treat `TriggerTime` as a cardiac phase if the [Acquisition Contrast (0008,9209)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0008,9209)) tag reports `PERFUSION`. This dataset demonstrates that each ASL phase is assigned a unique trigger time, presumably reflecting the label delay.


## Ordering of Volumes

dcm2niix will convert raw Philips ASL data as a single 4D NIfTI image. The 3D volumes are concatenated based on the factors of (a) repeat number, (b) phase number, and (c) whether the volume was a control or included a label. To analyze the data (e.g. with [FSL's BASIL](https://users.fmrib.ox.ac.uk/~chappell/asl_primer/ex1GUI/index.html), you will need to specify the order of these factors.
dcm2niix will convert a Philips ASL DICOM series as a single 4D NIfTI image. The 3D volumes are concatenated based on the factors of (a) repeat number, (b) phase number, and (c) whether the volume was a control or included a label. To analyze the data (e.g. with [FSL's BASIL](https://users.fmrib.ox.ac.uk/~chappell/asl_primer/ex1GUI/index.html), you will need to specify the order of these factors.

For enhanced DICOMs, this order is explicitly set by the [Dimension Index Values (0020,9157)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0020,9157)) tag. Therefore, for enhanced data you may want to check the DICOM header to determine the order.

The situation is tricky for classic DICOM. Philips often assigns [instance number (0020,0013)](https://dicom.innolitics.com/ciods/ct-image/general-image/00200013) randomly, with no set relationship to these factors. dcm2niix will always stack classic DICOM volumes in the same order: (a) repeat number, (b) phase number, (c) control or label. This order was chosen so that the classic DICOMs match the enhanced DICOMs for the provided datasets.

Here is a concrete example. consider an ASL sequence with three repeats and two phases. The order of the twelve volumes will be:
- PhaseNumber (2001,1008) distinguishes phase number, as does TriggerTime (0018,1060).
- MRImageLabelType (2005,1429) distinguishes control from label images.
- MRImageDynamicScanBeginTime (2005,10a0) and TemporalPositionIdentifier (0020,0100) are identical for all Control/Label pairs and all phases, so they distinguishes the repeat.

For enhanced DICOMs, the [Dimension Index Values (0020,9157)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0020,9157)) tag can distinguish volume type (phase, control/label, repeat), but does not match the temporal order. Classic DICOMs do not report 0020,9157 and Philips often assigns [instance number (0020,0013)](https://dicom.innolitics.com/ciods/ct-image/general-image/00200013) randomly, with no set relationship to these factors.

dcm2niix (from version v1.0.20210819) will always stack Philips ASL volumes in the same order. Regardless of whether the DICOMs were saved in enhanced or classic order. The order attempts to order the volumes in temporal order, but users need to be aware that the Philips DICOM data do not provide sufficient information to determine whether control or label images were acquired first.

Here is a concrete example for the volume order generated by dcm2niix. Consider an ASL sequence with three repeats and two phases. The order of the twelve volumes will be:

| Volume | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|--------|---|---|---|---|---|---|---|---|---|----|----|----|
|Repeat | 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
|Phase | 1 | 1 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 2 | 2 | 2 |
|Label | C | C | C | C | C | C | L | L | L | L | L | L |

|Phase | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
|Label | C | C | L | L | C | C | L | L | C | C | L | L |
|Repeat | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 3 |

## License

Expand All @@ -71,6 +77,7 @@ The code and images are covered by the [2-clause BSD license](https://opensource
## Versions

* 5-August-2021 Initial public release
* 20-August-2021 Estimated temporal order


## Running
Expand All @@ -82,4 +89,4 @@ If you have problems you can edit the first few lines of the `batch.sh` script s
## Useful Links

- dcm2niix's handling of these files is described [here](https://github.com/rordenlab/dcm2niix/tree/master/Philips).
- Identical images saved in Classic DICOM are [here](https://github.com/neurolabusc/dcm_qa_philips_asl).

2 changes: 1 addition & 1 deletion Ref/201_pCASL_enhanced_real.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/201_pCASL_enhanced_real.nii
Binary file not shown.
Binary file removed Ref/201_pCASL_enhanced_real.nii.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Ref/202_SOURCE_-_pCASL_enhanced.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/202_SOURCE_-_pCASL_enhanced.nii
Binary file not shown.
Binary file removed Ref/202_SOURCE_-_pCASL_enhanced.nii.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Ref/301_ASL_MultiPhase_enhanced_real.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/301_ASL_MultiPhase_enhanced_real.nii
Binary file not shown.
Binary file removed Ref/301_ASL_MultiPhase_enhanced_real.nii.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Ref/302_SOURCE_-_ASL_MultiPhase_enhanced.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/302_SOURCE_-_ASL_MultiPhase_enhanced.nii
Binary file not shown.
Binary file removed Ref/302_SOURCE_-_ASL_MultiPhase_enhanced.nii.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Ref/401_3D_pCASL_6mm_enhanced_real.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/401_3D_pCASL_6mm_enhanced_real.nii
Binary file not shown.
Binary file removed Ref/401_3D_pCASL_6mm_enhanced_real.nii.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion Ref/402_SOURCE_-_3D_pCASL_6mm_enhanced.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
0 ],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.202100805"
"ConversionSoftwareVersion": "v1.0.20210819"
}
Binary file added Ref/402_SOURCE_-_3D_pCASL_6mm_enhanced.nii
Binary file not shown.
Binary file removed Ref/402_SOURCE_-_3D_pCASL_6mm_enhanced.nii.gz
Binary file not shown.

0 comments on commit bb5bb7c

Please sign in to comment.