-
Notifications
You must be signed in to change notification settings - Fork 24
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
Draft MEDIC dynamic distortion correction method (second attempt) #438
base: master
Are you sure you want to change the base?
Conversation
I cannot figure out how to get the FieldmapWrangler to find MEDIC-style setups (i.e., complex-valued, multi-echo BOLD scans). 😕 |
@tsalo Around L508 in your current medic_entities = {**base_entities, **{'part': 'mag'}}
has_magnitude = tuple()
with suppress(ValueError):
has_magnitude = layout.get(
suffix='bold',
**medic_entities,
)
for mag_img in has_magnitude:
phase_img = layout.get(**{**mag_img.get_entities(), **{'part': 'phase'}})
if not phase_img:
continue
phase_img = phase_img[
try:
e = fm.FieldmapEstimation(
[
fm.FieldmapFile(mag_img.path, metadata=mag_img.get_metadata()),
fm.FieldmapFile(phase_img.path, metadata=phase_img.get_metadata()),
]
)
except (ValueError, TypeError) as err:
_log_debug_estimator_fail(
logger, "potential MEDIC fieldmap", [mag_img, phase_img], layout.root, str(err)
)
else:
_log_debug_estimation(logger, e, layout.root)
estimators.append(e) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #438 +/- ##
===========================================
- Coverage 83.75% 40.30% -43.46%
===========================================
Files 32 33 +1
Lines 2831 2923 +92
Branches 381 387 +6
===========================================
- Hits 2371 1178 -1193
- Misses 390 1667 +1277
- Partials 70 78 +8 ☔ View full report in Codecov by Sentry. |
Thanks @effigies! |
Co-authored-by: Chris Markiewicz <[email protected]>
I created a MEDIC-compliant test dataset (dsD), but it seems like the tests in test_wrangler use skeletons. Should I drop the test dataset and just generate a skeleton in the test file? |
import sdcflows.config as sc | ||
|
||
# Reload is necessary to clean-up the layout config between parameterized runs | ||
reload(sc) | ||
|
||
path = (tmp_path / test_id).absolute() | ||
generate_bids_skeleton(path, config) | ||
with pytest.raises(SystemExit) as wrapped_exit: | ||
# This was set to raise a SystemExit, but was only raising an ImageFileError | ||
with pytest.raises(ImageFileError) as wrapped_exit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was probably expecting valid headers in the images.
Yeah, seems like a good idea. |
Closes #36. An alternative to #435 that installs MEDIC as a dependency instead of implementing the whole tool as a series of interfaces and workflows.
Changes proposed: