[WIP] Handle dcm2niix not compressing nifti files #802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, we were hit by rordenlab/dcm2niix#124, when converting a very long epi scan.
It seems that:
.nii
instead of.nii.gz
and produces invalid file extensions after movingdcmconfig.json
with"compress": "n"
, but heudiconv is oblivious about that changeI added some code that tries to catch these corner cases in
convert.py
nii
nii
if the user supplieddcmconfig
as stated abovenii.gz
file extension snippets inbids.py
and infer the effective extension by checking if a bids_file (json) has an accompanyingnii
ornii.gz
fileI think this should also fix #365 and #576.
Tests were only run manually with a
dcmconfig
file and without, and with source data of mixed file length (>4GB and <4GB). Conversion works fine, validator is happy andscans.tsv
now contain.nii
and.nii.gz
respectively.But I am very nervous about this, because I assume other side effects by just switch
outtype
fromnii.gz
tonii
mid conversion.