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

Inconsistent bvals and bvecs #82

Closed
dlevitas opened this issue Feb 25, 2020 · 6 comments · Fixed by #100
Closed

Inconsistent bvals and bvecs #82

dlevitas opened this issue Feb 25, 2020 · 6 comments · Fixed by #100
Assignees
Labels
bug Something isn't working effort: low This task does not seem time consuming impact: high This contribution/idea will help a lot of people
Milestone

Comments

@dlevitas
Copy link

dlevitas commented Feb 25, 2020

  • dmriprep version: 0.2.2
  • Python version: 3.6.8
  • Operating System: Red Hat Enterprise Linux Server 7.7 (Maipo)

Description

I am getting an error message regarding the bvals and bvecs my data. My dataset is BIDS compliant (per the BIDS online validator; version 1.4.2). This is my first foray into dmriprep, so I'm not really sure how to troubleshoot this issue.

What I Did

I used the following dmriprep singularity command (container created from singularity version 2.6.1):

export SINGULARITYENV_TEMPLATEFLOW_HOME=/N/dcwan/projects/irf/templateflow

unset PYTHONPATH; singularity run -B /N/dcwan/projects/irf/templateflow:/opt/templateflow /N/dcwan/projects/irf/containers/dmriprep-0.2.2.simg \
		$bids_root_dir $bids_root_dir/derivatives						\
		participant														\
		--skip-bids-validation 											\
		--participant-label 01 											\
		--fs-license-file $FREESURFER_HOME/license.txt 					\
		--output-spaces fsaverage:den-10k MNI152NLin6Asym:res-2			\
		--nprocs 8												\
		--stop-on-first-crash 											\
		--resource-monitor 												\
		--low-mem 														\
		--mem_mb 35000 												\
		--use-plugin $bids_root_dir/dmriprep_plugin_01.yml 			\
		--verbose 														\
		-w $bids_root_dir/derivatives
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/legacymultiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 479, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 585, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 678, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 382, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/interfaces/vectors.py", line 75, in _run_interface
    b0_threshold=self.inputs.b0_threshold,
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 57, in __init__
    self.generate_rasb()
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 141, in generate_rasb
    self.normalize()
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 135, in normalize
    b_scale=self._b_scale)
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 248, in normalize_gradients
    (b0s.sum(), b0_vecs.sum()))
ValueError: Inconsistent bvals and bvecs (5, 0 low-b, respectively).
@oesteban
Copy link
Member

I can confirm this replicates with ds001771 (see new smoke test #91). I'll be working on this with you, @dPys - if you'd like.

@oesteban oesteban added the bug Something isn't working label Mar 23, 2020
@oesteban oesteban added this to the 0.3.0 milestone Mar 23, 2020
@oesteban oesteban added impact: high This contribution/idea will help a lot of people effort: low This task does not seem time consuming labels Mar 23, 2020
@oesteban
Copy link
Member

This is the error in detail (here and here):

Node: dmriprep_wf.single_subject_36_wf.dwi_preproc_acq_AP_wf.gradient_table
Working directory: /work/dmriprep_wf/single_subject_36_wf/dwi_preproc_acq_AP_wf/gradient_table

Node inputs:

b0_threshold = 50.0
b_scale = True
bvec_norm_epsilon = 0.1
dwi_file = /data/sub-36/dwi/sub-36_acq-AP_dwi.nii.gz
in_bval = /data/sub-36/dwi/sub-36_acq-AP_dwi.bval
in_bvec = /data/sub-36/dwi/sub-36_acq-AP_dwi.bvec
in_rasb = <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 397, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/interfaces/vectors.py", line 77, in _run_interface
    b0_threshold=self.inputs.b0_threshold,
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 97, in __init__
    self.generate_rasb()
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 183, in generate_rasb
    self.normalize()
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 176, in normalize
    b_scale=self._b_scale,
  File "/usr/local/miniconda/lib/python3.7/site-packages/dmriprep/utils/vectors.py", line 334, in normalize_gradients
    (b0s.sum(), b0_vecs.sum()))
ValueError: Inconsistent bvals and bvecs (7, 0 low-b, respectively).

@oesteban
Copy link
Member

@dPys

@dPys
Copy link
Collaborator

dPys commented Mar 24, 2020

This should now be resolved with 8b365f8
@oesteban @dlevitas

@oesteban
Copy link
Member

Hey @dPys, could we address this in a separate PR?

@dPys
Copy link
Collaborator

dPys commented Mar 25, 2020

Sounds good @oesteban . Should I open a new one or add it as a rider to #76 ?

oesteban added a commit to oesteban/dmriprep that referenced this issue Apr 6, 2020
We raised a ValueError whenever the number of b-vals and all-zero b-vecs
didn't match. Few lines later, we would overwrite nonzero b-vecs to
match the b-vals, but that step was never reached. This PR allows the
function to just throw a warning instead.

Resolves: nipreps#82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort: low This task does not seem time consuming impact: high This contribution/idea will help a lot of people
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants