Closed ajschadler12 closed 2 years ago
Dealing with fieldmaps is tricky as they are stored in so many (sequence and vendor-dependent) ways. I would have to add an if-clausule to catch your use case, but I have no access to or experience with GE data. Can you possibly provide me with test data?
p.s. A single slice just from the fieldmap series (both RO directions) will do
Here is a full acquisition. The scan is of myself, so I have no qualms with sharing.
dcm2niix versions greater than v1.0.20211006 should support GE ABCD pepolar research sequences like this. By default, it will save two files, with volumes of each PE grouped. The json files differ in only two fields:
PE-1 | PE-2 |
---|---|
"PhaseEncodingPolarityGE": "Unflipped" | "PhaseEncodingPolarityGE": "Flipped" |
"PhaseEncodingDirection": "j-" | "PhaseEncodingDirection": "j" |
Ok, I made a fix for the crash, will have to work on proper handling of PhaseEncodingPolarityGE
a bit more...
I think it should work now, you can test it with:
pip install --upgrade git+https://github.com/Donders-Institute/bidscoin # Add --force-reinstall if needed
The previous fix (438b8a0) solved the issue of crashing.
The fix you just submitted, 1d0f8f2 unfortunately is causing a crash at the very end of the conversion:
Traceback (most recent call last):
File "/home/ajschadler12/.local/bin//bidscoiner", line 8, in <module>
sys.exit(main())
File "/home/ajschadler12/.local/lib/python3.10/site-packages/bidscoin/bidscoiner.py", line 376, in main
bidscoiner(rawfolder = args.sourcefolder,
File "/home/ajschadler12/.local/lib/python3.10/site-packages/bidscoin/bidscoiner.py", line 200, in bidscoiner
module.bidscoiner_plugin(sesfolder, bidsmap, bidssession)
File "/home/ajschadler12/.local/lib/python3.10/site-packages/bidscoin/plugins/dcm2niix2bids.py", line 277, in bidscoiner_plugin
ext = ''.join(extrafile[0].suffixes)
IndexError: list index out of range
Ah, yes, I see (it didn't come up when I tested just the fieldmap). Can you try again?
That did it!
Incidentally, when I tried just testing the fieldmap, bidsmapper recognized the sequence as a P-file instead of a DICOM. (if that is a bug, can open a separate issue...)
That's p7 detection is done by the spec2nii2bids plugin (that you can probably remove from your bidsmap?). I think the p-file always has a .7
file extension, but one of your DICOM files also has that same extension. Doing a deeper check is slower, perhaps I should leave the spec2nii2bids plugin as an optional plugin instead of a default one...
The current implementation does not give full control over the dir
label but I think I will leave like it is for now (as it's complicated due to BIDScoin's design to handle two sequences from one seriesfolder as separate series).
I think it should be fine for now. Users can use bulk-rename utilities to change "Flipped" or "Unflipped" to the desired direction
Is your feature request related to a problem? Please describe. When dcm2niix converts an ABCD-style GE pepolar sequence (i.e. blip-up and blip-down as single spin-echo series), it normally splits it into two separate files. The bidsmap editor can only assign a single mapping for these sequences, when really a pair is needed (i.e. same label, with differing
dir-
labels).This causes bidscoin to crash with a
KeyError
when writing toparticipants.tsv
:Describe the solution you'd like Either the program should be able to reverse the
dir-
label when it detects a GE ABCD pepolar sequence or the user needs the option to specify if a mapping corresponds to a split file, and how the split file should be treated.