Skip to content

FIX: Read .PAR files corresponding to ADC maps #685

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

Merged
merged 3 commits into from
Oct 24, 2018

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Oct 22, 2018

Normally, for any diffusion scan, the data will have multiple volumes (at least two b values must be acquired). However, it is possible to export ADC maps which seem to retain the same general_info section from the original scan's header, but actually only contain a single processed volume. This violates the assumptions that were made in get_bvals_bvecs and causes parrec2nii to fail when converting .PAR/.REC data corresponding to ADC maps.

This PR fixes this by returning (None, None) for bvals and bvecs when there is only a single volume present in the file.

A small (anonymous) .PAR header and test case have been included.

@coveralls
Copy link

coveralls commented Oct 22, 2018

Coverage Status

Coverage increased (+0.001%) to 91.851% when pulling d6310d5 on grlee77:parrec_adc_fix into d5494f3 on nipy:master.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Spotted a couple typos, and do you want to merge master to fix up the Travis failure?

…vecs

For example, post-processed ADC maps will be marked as diffusion scans but only have 3D
data. The b-values and vectors from the original scan are not available in the header in
this case.
@codecov-io
Copy link

codecov-io commented Oct 23, 2018

Codecov Report

Merging #685 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #685      +/-   ##
==========================================
+ Coverage   88.87%   88.88%   +<.01%     
==========================================
  Files          93       93              
  Lines       11447    11449       +2     
  Branches     1891     1892       +1     
==========================================
+ Hits        10174    10176       +2     
  Misses        933      933              
  Partials      340      340
Impacted Files Coverage Δ
nibabel/parrec.py 94.39% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5494f3...d6310d5. Read the comment docs.

@effigies effigies changed the title Fix reading .PAR files corresponding to apparent diffusion coefficient maps FIX: Read .PAR files corresponding to ADC maps Oct 24, 2018
@effigies
Copy link
Member

Great, thanks!

@effigies effigies merged commit 118d305 into nipy:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants