Open octomike opened 2 weeks ago
Attention: Patch coverage is 66.66667%
with 8 lines
in your changes missing coverage. Please review.
Project coverage is 81.76%. Comparing base (
900ccdc
) to head (bed3f11
).
Files with missing lines | Patch % | Lines |
---|---|---|
heudiconv/convert.py | 58.82% | 7 Missing :warning: |
heudiconv/bids.py | 85.71% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @octomike I totally forgot about that
I wonder -- did you try dcm2niix
built with -dmyDisableGzSizeLimits
as @neurolabusc suggested us to try (in 2017!)? I think I might just try to enable that flag for neurodebian builds of dcm2niix
as for this particular PR: have you considered simply adding code which would just add a check that produced by dcm2niix .nii.gz is actually not compressed, and if so -- double check that it is ok'ish (opens up using nibabel and can access last volume? just to ensure that it is not totally borked conversion exiting early with 1
... just to be safe), rename/compress from within heudiconv python process using gzip "battery included"?
Hi @octomike I totally forgot about that
* [(Silently) produces .nii (not .nii.gz) despite -z i switch rordenlab/dcm2niix#124](https://github.com/rordenlab/dcm2niix/issues/124)
I wonder -- did you try
dcm2niix
built with-dmyDisableGzSizeLimits
as @neurolabusc suggested us to try (in 2017!)? I think I might just try to enable that flag for neurodebian builds of dcm2niix
I just did and the warning (Warning: Saving uncompressed data: internal compressor unable to process such large files.
) went away, but it still produced uncompressed nifits (silently now).
After digging through the dcm2niix code a litte, it appears as if https://github.com/rordenlab/dcm2niix/commit/3c7f26be#diff-210e732ea7e4240e3ca012e3668da51f0e389a975fbc5b0edab430afbe27e314R9926 disabled pigz compression altogether, but that's the only code path to compress something if this define is set.
What a mess :see_no_evil:
So, we were hit by https://github.com/rordenlab/dcm2niix/issues/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.