Skip to content

Commit

Permalink
Answer some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaRenauld committed Jan 24, 2024
1 parent cc84f04 commit 264f83d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
22 changes: 11 additions & 11 deletions scilpy/gradients/bvec_bval_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,33 @@ def check_b0_threshold(min_bval, args):
b0_thr = args.b0_threshold
if b0_thr > DEFAULT_B0_THRESHOLD:
logging.warning(
'Warning: Your defined b0 threshold (option --{}) is {}. This is '
'suspicious. We recommend using volumes with bvalues no higher '
'than {} as b0s.'.format(b0_thr, b0_thr, DEFAULT_B0_THRESHOLD))
'Your defined b0 threshold is {}. This is suspicious. We '
'recommend using volumes with bvalues no higher than {} as b0s'
.format(b0_thr, DEFAULT_B0_THRESHOLD))

if min_bval < 0:
logging.warning(
'Warning: Your dataset contains negative b-values (minimal bvalue '
'of {}). This is suspicious. We recommend you check your data.')
'of {}). This is suspicious. We recommend you check your data.'
.format(min_bval))

if min_bval > b0_thr:
if args.skip_b0_validation:
logging.warning("GOT {} > {}".format(min_bval, b0_thr))

Check warning on line 109 in scilpy/gradients/bvec_bval_tools.py

View check run for this annotation

Codecov / codecov/patch

scilpy/gradients/bvec_bval_tools.py#L109

Added line #L109 was not covered by tests
logging.warning(
'Warning: Your minimal bvalue ({}), is above the threshold '
'defined with --{}: {}.\n'
'Since --skip_b0_validation was specified, the script will'
'Your minimal bvalue ({}), is above the threshold ({})\n'
'Since --skip_b0_validation was specified, the script will '
'proceed with a b0 threshold of {}.'
.format(min_bval, b0_thr, b0_thr, min_bval))
.format(min_bval, b0_thr, min_bval))
return min_bval

Check warning on line 115 in scilpy/gradients/bvec_bval_tools.py

View check run for this annotation

Codecov / codecov/patch

scilpy/gradients/bvec_bval_tools.py#L115

Added line #L115 was not covered by tests
else:
raise ValueError(
'The minimal bvalue ({}) is is above the threshold '
'defined with --{}: {}.\n.No b0 volumes can be found.\n'
'The minimal bvalue ({}) is is above the threshold ({})\n'

Check warning on line 118 in scilpy/gradients/bvec_bval_tools.py

View check run for this annotation

Codecov / codecov/patch

scilpy/gradients/bvec_bval_tools.py#L117-L118

Added lines #L117 - L118 were not covered by tests
'No b0 volumes can be found.\n'
'Please check your data to ensure everything is correct.\n'
'You may also increase the threshold or use '
'--skip_b0_validation'
.format(min_bval, b0_thr, b0_thr, min_bval))
.format(min_bval, b0_thr))
return b0_thr


Expand Down
4 changes: 3 additions & 1 deletion scilpy/io/btensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def generate_btensor_input(in_dwis, in_bvals, in_bvecs, in_bdeltas,
"""Generate b-tensor input from an ensemble of data, bvals and bvecs files.
This generated input is mandatory for all scripts using b-tensor encoding
data. Also generate the powder-averaged (PA) data if set.
toDo. Add a way to include a different b0_threshold than the tolerance.
For the moment, this does not enable the use of a b0_threshold different
than the tolerance.
Parameters
----------
Expand Down
11 changes: 8 additions & 3 deletions scilpy/reconst/frf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,14 @@ def compute_msmt_frf(data, bvals, bvecs, btens=None, data_dti=None,
1D bvals array with shape (N,)
bvecs : ndarray
2D bvecs array with shape (N, 3)
btens: ?
data_dti: ?
bvals_dti: ?
btens: ndarray 1D
btens array with shape (N,), describing the btensor shape of every
pair of bval/bvec.
data_dti: ndarray 4D
Input diffusion volume with shape (X, Y, Z, M), where M is the number
of DTI directions.
bvals_dti: ndarray 1D
bvals array with shape (M,)
bvecs_dti: ?
btens_dti: ?
mask : ndarray, optional
Expand Down

0 comments on commit 264f83d

Please sign in to comment.