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

Changing the default b0_threshold in gtab #1667

Merged
merged 21 commits into from Dec 6, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions dipy/reconst/ivim.py
Expand Up @@ -215,6 +215,9 @@ def __init__(self, gtab, split_b_D=400.0, split_b_S0=200., bounds=None,
e_s += "The IVIM model requires signal measured at 0 bvalue"
raise ValueError(e_s)

if gtab.b0_threshold > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance to get a test for this behavior in the IVIM tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

@arokem I will create a new issue and create a new PR with the tests for the same!

warnings.warn('The default b0_threshold > 0 and is now set to 50')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this warning.

As I user, I would infer that this means that you have changed my b0_threshold to 50.

I would propose to raise an Error (instead of the warning) with the following string:

"The IVIM model requires a measurement at b==0. As of version 0.15, the default b0_threshold for the GradientTable object is set to 50, so if you used the default settings to initialize the gtab input to the IVIM model, you may have provided a gtab with b0_threshold larger than 0. Please initialize the gtab input with b0_threshold=0"

Copy link
Member Author

Choose a reason for hiding this comment

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

@arokem Thank you so much for this! I shall refactor accordingly!


ReconstModel.__init__(self, gtab)
self.split_b_D = split_b_D
self.split_b_S0 = split_b_S0
Expand Down