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

Clip negative values in extrapolation interfaces #213

Merged
merged 5 commits into from
Mar 11, 2025
Merged

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Mar 10, 2025

Closes #212.

Changes proposed in this pull request

  • Clip negative extrapolated values in DipyReconInterface to 0.
  • Clip negative extrapolated values in BrainSuiteShoreReconstruction to 0.
  • Change S0 from 0 to 1000 in DipyReconInterface.

@tsalo tsalo added the bug Something isn't working label Mar 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 48.74%. Comparing base (cae58e0) to head (42aa728).

Files with missing lines Patch % Lines
qsirecon/interfaces/dipy.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #213      +/-   ##
==========================================
- Coverage   48.75%   48.74%   -0.02%     
==========================================
  Files          56       56              
  Lines        7423     7425       +2     
  Branches     1015     1015              
==========================================
  Hits         3619     3619              
- Misses       3586     3588       +2     
  Partials      218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@mattcieslak mattcieslak left a comment

Choose a reason for hiding this comment

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

Thank you!!

@@ -385,6 +387,8 @@ def _extrapolate_scheme(self, scheme_name, runtime, fit_obj, mask_array, mask_im
shore_array = fit_obj._shore_coef[mask_array]
output_data = np.zeros(mask_array.shape + (len(prediction_gtab.bvals),))
output_data[mask_array] = np.dot(shore_array, prediction_shore.T)
# Clip negative values
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for s0=1000 here because it was fit with the original s0

@tsalo tsalo merged commit d15f73d into main Mar 11, 2025
26 checks passed
@tsalo tsalo deleted the clip-extrapolation branch March 11, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3dSHORE_reconstruction extrapolation introduces negative values
3 participants