[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:
.niiinstead of.nii.gzand produces invalid file extensions after movingdcmconfig.jsonwith"compress": "n", but heudiconv is oblivious about that changeI added some code that tries to catch these corner cases in
convert.pyniiniiif the user supplieddcmconfigas stated abovenii.gzfile extension snippets inbids.pyand infer the effective extension by checking if a bids_file (json) has an accompanyingniiornii.gzfileI think this should also fix #365 and #576.
Tests were only run manually with a
dcmconfigfile and without, and with source data of mixed file length (>4GB and <4GB). Conversion works fine, validator is happy andscans.tsvnow contain.niiand.nii.gzrespectively.But I am very nervous about this, because I assume other side effects by just switch
outtypefromnii.gztoniimid conversion.