Skip to content

dMRI gradient data implementation is inconsistent #316

@jhlegarreta

Description

@jhlegarreta

What happened?

When attempting to run the tests in PR #313, it becomes apparent that the gradient data format is not consistent across the code. The data.filtering.dwi_select_shells functionexpects an Nx4 array, the b-values being the last column in:

bvalues = gradients[:, -1]

However, the rest of the code handles a 4xN array, the b-values being the last row. Note that the transpose of these arrays does not give the other array.

This is not captured by any test.

This becomes apparent when debugging the tests in PR #313. For the avg model and DTI model tests to pass,

bvalues = gradients[:, -1]

needs to be changed to

bvalues = gradients[-1, :]

What command did you use?

pytest test/test_integration.py

What version of the software are you running?

3139500

How are you running this software?

Local installation ("bare-metal")

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

if not shellmask.sum():
>           raise RuntimeError(f"Shell corresponding to index {index} (b={bcenter}) is empty.")
E           RuntimeError: Shell corresponding to index 3 (b=1000.0) is empty.

Additional information / screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions