Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly remove GE multiecho bvals/bvecs #728

Merged
merged 5 commits into from
Feb 24, 2024

Conversation

bpinsard
Copy link
Contributor

GE Hyperband (at least some versions of it) multi-echo data get diffusion vector/values in the dicom tags used by dcm2niix to generate bvecs/bvals.

While heudiconv is properly coded to remove such data when there is a single bvec/bval per series, multi-echo data outputs as many as there are echoes causing it to crash.

An error occur processing s398
expected str, bytes or os.PathLike object, not TraitListObject
Traceback (most recent call last):
  File "/app/convert.py", line 54, in convert_pipeline
    heudiconv_workflow(**heudiconv_params)
  File "/usr/local/lib/python3.9/dist-packages/heudiconv/main.py", line 463, in workflow
    prep_conversion(
  File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 258, in prep_conversion
    convert(
  File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 623, in convert
    bids_outfiles = save_converted_files(
  File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 891, in save_converted_files
    if bvals_are_zero(res.outputs.bvals):
  File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 1083, in bvals_are_zero
    with open(bval_file) as f:
TypeError: expected str, bytes or os.PathLike object, not TraitListObject

The current PR fixes that by checking if all files only contain zeros bvals when not suffixed _dwi, and remove all of them appropriately.

FYI @miltoncamachocamacho

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (1d614cd) 81.97% compared to head (bc4ce42) 82.00%.
Report is 7 commits behind head on master.

Files Patch % Lines
heudiconv/convert.py 75.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #728      +/-   ##
==========================================
+ Coverage   81.97%   82.00%   +0.03%     
==========================================
  Files          41       41              
  Lines        4149     4163      +14     
==========================================
+ Hits         3401     3414      +13     
- Misses        748      749       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bpinsard bpinsard changed the title properly remove GE multiecho bvals properly remove GE multiecho bvals/bvecs Jan 11, 2024
heudiconv/convert.py Outdated Show resolved Hide resolved
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
heudiconv/convert.py Outdated Show resolved Hide resolved
@bpinsard bpinsard force-pushed the fix/ge_multiecho_bvals branch from 6c6d644 to bc4ce42 Compare January 23, 2024 17:09
@yarikoptic yarikoptic added the patch Increment the patch version when merged label Feb 24, 2024
@yarikoptic yarikoptic merged commit 7c02e39 into nipy:master Feb 24, 2024
10 checks passed
Copy link

🚀 PR was released in v1.0.2 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants