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

Improving T1 Model Selection #227

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

alexdaniel654
Copy link
Member

@alexdaniel654 alexdaniel654 commented Sep 30, 2024

Proposed changes

Pre-processing steps (registration, EPI distortion correction etc) can often cause quite a lot of slightly negative numbers, this then means the T1 mapping code assumes the data has been magnitude corrected. After multiple people have had issues when trying to debug this behaviour we've decided it makes sense to add a flag when instantiating the class to select if the data should be fit to a magnitude corrected model or absolute model.

auto model selection now considers data to have been magnitude corrected if 5% of the voxels of the first inversion are less than -0.05 x the 95th percentile of the signal in the final inversion time i.e. the number of negative voxels required for the signal to be considered magnitude corrected has increased and the threshold at which voxels are considered negative is now based on the dynamic range of the data so floating point errors shouldn't cause voxels with an intensity of -1E-6 to be considered negative any more.

Should close #225

Checklists

  • I have read and followed the CONTRIBUTING document
  • This pull request is from and to the dev branch
  • I have added tests that demonstrate the feature/fix works
  • I have added necessary documentation (if appropriate)
  • I have updated documentation which becomes obsolete after my changes (if appropriate)
  • I have added/updated a notebook to demonstrate the changes (if appropriate)
  • Files added follow the repository structure (if appropriate)

@alexdaniel654 alexdaniel654 self-assigned this Sep 30, 2024
@alexdaniel654 alexdaniel654 added the type:enhancement 🛠️ Improvements to existing features label Sep 30, 2024
@pep8speaks
Copy link

pep8speaks commented Sep 30, 2024

Hello @alexdaniel654, thank you for updating!

Line 72:17: E129 visually indented line with same indent as next logical line

Comment last updated at 2024-09-30 12:57:07 UTC

@alexdaniel654 alexdaniel654 added this to the v0.8.0 milestone Sep 30, 2024
Because codecov isn't working... again...
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.96%. Comparing base (9d02642) to head (e11d70e).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
ukat/mapping/t1.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #227      +/-   ##
==========================================
- Coverage   97.97%   97.96%   -0.02%     
==========================================
  Files          48       48              
  Lines        4445     4470      +25     
==========================================
+ Hits         4355     4379      +24     
- Misses         90       91       +1     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement 🛠️ Improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change T1 model selection to be an explicit flag rather than automatic
2 participants