Create "How to work with dicoms" draft with pointers #2

Open
msz wants to merge 0 commits from dicom-howto-outline into main
Member

This adds two pages, one for archival and one for conversion.

The goal is mostly to aggregate information that has been scattered over several places and to make it easier to follow up on initial explorations of the problem space.

The intention is to mention things which seemed important. The intention is not to cling to any particular piece of wording, so feel free to re-write as you see fit.

This adds two pages, one for archival and one for conversion. The goal is mostly to aggregate information that has been scattered over several places and to make it easier to follow up on initial explorations of the problem space. The intention is to mention things which seemed important. The intention is not to cling to any particular piece of wording, so feel free to re-write as you see fit.
This adds two pages, one for archival and one for conversion.

The goal is mostly to aggregate information that has been scattered
over several places and to make it easier to follow up on initial
explorations of the problem space. The intention is to mention things
which seemed important. The intention is not to cling to any
particular piece of wording, so feel free to re-write as you see fit.
@ -0,0 +53,4 @@
- https://github.com/ReproNim/containers
- it can be installed as a subdataset: seems large but only the required container needs to be gotten
- heudiconv is in images/nipy/
- https://hub.trr379.de/q02/phantom-mri-bids used dcm2niix v1.0.20240202
Member

Maybe relevant to mention in this context: the heudiconv container provided via repronim/containers includes dcm2niix version v1.0.20240202.

Maybe relevant to mention in this context: the heudiconv container provided via repronim/containers includes [dcm2niix version v1.0.20240202](https://hub.docker.com/layers/nipy/heudiconv/1.3.3/images/sha256-2a8c7e50b9602ce60cccc5b7fb0498b0a426f3dd6245a7c1b2dbffb43c58b134).
@ -0,0 +62,4 @@
- the phantom datasets are not the same: https://hub.trr379.de/q02/phantom-mri-bids/issues/6
- re-scan from Aachen has more sequences than the initial scan, but lacks T2w
- heudiconv fails to parse some Heidelberg dicoms, and dcm2niix raises warnings;
unclear whether this is data issue or software issue: https://hub.trr379.de/q02/phantom-mri-bids/issues/5
Member

unqualified opinion from the side-lines: Could a Heidelberg scientist simply open an issue at dcm2niix, share their data, and ask for advice? I searched a bit through the dcm2niix issues, and there are many scanner or acquisition peculiarities in past issues that were identified pretty fast.

unqualified opinion from the side-lines: Could a Heidelberg scientist simply open an issue at dcm2niix, share their data, and ask for advice? I searched a bit through the dcm2niix issues, and there are many scanner or acquisition peculiarities in past issues that were identified pretty fast.
Author
Member

Much belated response - yes, definitely. They could even share a link to their data in the TRR hub since the phantom dataset is public.

In fact, we could also share the link and open the issue; however I would prefer not to do that before confirming with the acquisition site that this is not a known issue, something expected, or e.g. an anonymization side effect.

Also - note that dcm2niix only issues a warning, it is Python machinery (nibabel) that errors during Heudiconv processing (but the two seem related).

Much belated response - yes, definitely. They could even share a link to their data in the TRR hub since the [phantom dataset](https://hub.trr379.de/q01/phantom-mri-dicom-mannheim) is public. In fact, we could also share the link and open the issue; however I would prefer not to do that before confirming with the acquisition site that this is not a known issue, something expected, or e.g. an anonymization side effect. Also - note that dcm2niix only issues a warning, it is Python machinery (nibabel) that errors during Heudiconv processing (but the two seem related).
@ -0,0 +67,4 @@
### Conversion: technical issues
These are open questions:
Member

I don't have an account on the TRR hub, so I can only comment here. Regarding the mutually exclusive RepetitionTime and AcquisitionDuration fields: I'm also not sure, but my bet is on heudiconv.
Looking at the Dicom that's the source of an anatomical image, both RepetitionTime and AcquisitionDuration are set.
dcm2niix only writes out RepetitionTime (see here), but heudiconv seems to loop over non-specified information in the headers in this function. There is a logging call, if there are debugging logs available by chance they could confirm

    lgr.debug(
        "Embedding into %s based on dicoms[0]=%s for nifti %s",
        scaninfo,
        item_dicoms[0],
        outname,
    )
    ```
I don't have an account on the TRR hub, so I can only comment here. Regarding the mutually exclusive RepetitionTime and AcquisitionDuration fields: I'm also not sure, but my bet is on heudiconv. Looking at [the Dicom](https://hub.trr379.de/q01/phantom-mri-dicom-aachen/src/branch/main/Kopf_Q01_20250120_132533.200000/Q01_anat_T1w_sag_0p8mm_5_MR/1.dcm) that's the source of [an anatomical image](https://hub.trr379.de/q02/phantom-mri-bids/src/branch/main/sub-a/anat/sub-a_T1w.json), both RepetitionTime and AcquisitionDuration are set. dcm2niix only writes out RepetitionTime (see [here](https://github.com/rordenlab/dcm2niix/blob/f6d7a0018d9d268ed1d084faafdedfadcbbb830b/BIDS/README.md?plain=1#L24)), but heudiconv seems to loop over non-specified information in the headers in [this function](https://github.com/nipy/heudiconv/blob/c5e9b1908a29eaf42eadec91592134cc8186735b/heudiconv/dicoms.py#L695). There is a logging call, if there are debugging logs available by chance they could confirm ``` lgr.debug( "Embedding into %s based on dicoms[0]=%s for nifti %s", scaninfo, item_dicoms[0], outname, ) ```
Member

I found that interesting to read, thanks a lot. My comments are more of unqualified remarks from the side that want to explore the problem out of curiosity, not remarks on this PR (which I like). My comments would fit in better on the TRR hub, but I don't have an account there.

I found that interesting to read, thanks a lot. My comments are more of unqualified remarks from the side that want to explore the problem out of curiosity, not remarks on this PR (which I like). My comments would fit in better on the TRR hub, but I don't have an account there.
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin dicom-howto-outline:dicom-howto-outline
git switch dicom-howto-outline

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff dicom-howto-outline
git switch dicom-howto-outline
git rebase main
git switch main
git merge --ff-only dicom-howto-outline
git switch dicom-howto-outline
git rebase main
git switch main
git merge --no-ff dicom-howto-outline
git switch main
git merge --squash dicom-howto-outline
git switch main
git merge --ff-only dicom-howto-outline
git switch main
git merge dicom-howto-outline
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trr379/docs.trr379.de!2
No description provided.