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

Mdr t1 molli #228

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

Conversation

plaresmedima
Copy link

New mdr keyword in T1 class

  • Purpose: introduce a backwards compatible option to perform motion correction.

  • Usage: setting mdr=True in T1() performs motion correction prior to computing the parameter maps. The default is False.

map = T1(pixel_array, TI, affine, mdr=True)

  • Example: output with and without mdr=True (see below - note the sharper kidney outline when mdr=True). This example is generated by a new module test_mdreg.py, current in /tests. This may not be the appropriate place for it as it is not a proper unit test - more of an illustration.

  • New attribute: This PR also introduces a new attribute deformation_field, which has the value None when mdr=False

  • New requirement: This brings in mdreg as a requirement, which ships with elastix and skimage.

  • Note: There is currently still some inline comments that can be removed or shortened once they are addressed. For instance the current version still includes a hack to avoid the problem of autoselecting the wrong model, which still happened in this eample. This needs another solution but cannot be addressed at the level of mdr. There are also questions that are more an issue of design and the general approach in ukat, e.g. whether we expose coregistration options in the API or not.

  • See also Model Driven Registration #164 and MDR #183. The solution here should apply to other classes as well so we should be able to add mdr as an option everywhere with the same API (mdr=True keyword).

t1_mdr

Note this is not a proper test - this file probably belongs elsewhere - maybe can become the basis for a tutorial on motion correction.
@pep8speaks
Copy link

pep8speaks commented Oct 1, 2024

Hello @plaresmedima, thank you for updating!

Line 153:80: E501 line too long (80 > 79 characters)
Line 155:80: E501 line too long (90 > 79 characters)
Line 157:80: E501 line too long (84 > 79 characters)
Line 211:73: W291 trailing whitespace
Line 212:80: W291 trailing whitespace
Line 224:80: E501 line too long (82 > 79 characters)
Line 247:80: E501 line too long (93 > 79 characters)
Line 248:80: E501 line too long (101 > 79 characters)
Line 249:80: E501 line too long (85 > 79 characters)
Line 250:80: E501 line too long (89 > 79 characters)
Line 251:80: E501 line too long (83 > 79 characters)
Line 252:80: E501 line too long (85 > 79 characters)
Line 254:80: E501 line too long (82 > 79 characters)
Line 260:80: E501 line too long (117 > 79 characters)
Line 262:80: E501 line too long (90 > 79 characters)
Line 264:80: E501 line too long (87 > 79 characters)
Line 265:80: E501 line too long (90 > 79 characters)
Line 268:80: E501 line too long (86 > 79 characters)

Comment last updated at 2024-10-02 12:30:44 UTC

@plaresmedima plaresmedima changed the base branch from master to dev October 1, 2024 22:19
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 37.20930% with 27 lines in your changes missing coverage. Please review.

Project coverage is 97.41%. Comparing base (a046195) to head (89051a5).

Files with missing lines Patch % Lines
ukat/mapping/tests/test_mdreg.py 27.58% 21 Missing ⚠️
ukat/mapping/t1.py 57.14% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #228      +/-   ##
==========================================
- Coverage   97.97%   97.41%   -0.57%     
==========================================
  Files          48       49       +1     
  Lines        4445     4484      +39     
==========================================
+ Hits         4355     4368      +13     
- Misses         90      116      +26     

☔ 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants