nipy / heudiconv

Flexible DICOM conversion into structured directory layouts
https://heudiconv.readthedocs.io
Other
232 stars 125 forks source link

ReproIn name for siemens GRE fieldmap? one name in cockpit makes dicoms with two SeriesIds (mag and phase) #763

Open WillForan opened 2 months ago

WillForan commented 2 months ago

Summary

We collect a GRE fieldmap like that on issue #158 (phantom DICOM and nifti attached!, and here's a quick mp4 video scrolling through what they look like is).

I'd like to name the acquisition on the scanner inline with the ReproIn spec so the reproin.py heuristic can just "do the right thing"™ . But the single gre fieldmap series on the scanner produces dicoms with two series numbers: the first for the magnitude images and the second for the phase.

image

I think the ideal name would be like fmap-magnitude_acq.... or fmap-phasediff_acq... but which ever we pick will mean half are labeled wrong.


I tried a copy of the dicoms with the protocol (tag 0018,1030) changed to the under-specified fmap-_acq-fl2

dicom_hinfo -no_name\
    -tag 0020,0011 -tag 0018,0081 -tag 0008,0031  -tag 0018,1030 -tag 0051,1016\
   reproin_renamed/* | sort |uniq -c

     28 5 2.46 203727.656000 fmap-_acq-fl2 M/ND
     28 5 4.92 203727.656000 fmap-_acq-fl2 M/ND
     28 5 8.61 203727.656000 fmap-_acq-fl2 M/ND
     28 6 2.46 203727.872000 fmap-_acq-fl2 P/ND
     28 6 4.92 203727.872000 fmap-_acq-fl2 P/ND
     28 6 8.61 203727.872000 fmap-_acq-fl2 P/ND

and get close

heudiconv -f reproin -o bids/ --files reproin_renamed/

find bids/ -name '*nii.gz'|perl -pe 's,.*?/sub[^/]*/,,'
 fmap/sub-testbr_acq-fl2_magnitude_heudiconv290_e1.nii.gz
 fmap/sub-testbr_acq-fl2_phasediff_heudiconv858_e2_ph.nii.gz
 fmap/sub-testbr_acq-fl2_phasediff_heudiconv858_e3_ph.nii.gz
 fmap/sub-testbr_acq-fl2_phasediff_heudiconv858_e1_ph.nii.gz
 fmap/sub-testbr_acq-fl2_magnitude_heudiconv290_e2.nii.gz
 fmap/sub-testbr_acq-fl2_magnitude_heudiconv290_e3.nii.gz

Platform details:

Choose one:

tsalo commented 2 months ago

What about fmap_... (no dash)?

WillForan commented 3 weeks ago

no - (eg fmap_acq-rest) works well! but the output still has heudiconv*_e1 instead of _echo-1. Or maybe it should be magintude1? And I think these are phase instead of phasediff(?)

mag and phase screenshot phantom

tree -P '*nii.gz'   -I '*_dicom'
.
└── fmap
    ├── sub-testbr_acq-dwi_magnitude_heudiconv710_e1.nii.gz
    ├── sub-testbr_acq-dwi_magnitude_heudiconv710_e2.nii.gz
    ├── sub-testbr_acq-dwi_magnitude_heudiconv710_e3.nii.gz
    ├── sub-testbr_acq-dwi_phasediff_heudiconv025_e1_ph.nii.gz
    ├── sub-testbr_acq-dwi_phasediff_heudiconv025_e2_ph.nii.gz
    └── sub-testbr_acq-dwi_phasediff_heudiconv025_e3_ph.nii.gz