Skip to content

feat: Add workflow arguments for metadata estimates and fallback TRT #479

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

Merged
merged 5 commits into from
May 15, 2025

Conversation

effigies
Copy link
Member

Follow-up to #477.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 67.74194% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.04%. Comparing base (f3b32fc) to head (76326a8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
sdcflows/workflows/base.py 55.55% 3 Missing and 1 partial ⚠️
sdcflows/workflows/apply/correction.py 33.33% 1 Missing and 1 partial ⚠️
sdcflows/workflows/fit/pepolar.py 0.00% 1 Missing and 1 partial ⚠️
sdcflows/workflows/fit/syn.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #479      +/-   ##
==========================================
- Coverage   84.32%   84.04%   -0.29%     
==========================================
  Files          30       30              
  Lines        2846     2870      +24     
  Branches      367      374       +7     
==========================================
+ Hits         2400     2412      +12     
- Misses        376      384       +8     
- Partials       70       74       +4     

☔ 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.

effigies added a commit to effigies/fmriprep that referenced this pull request Jan 29, 2025
oesteban
oesteban previously approved these changes Mar 26, 2025
Copy link
Member

@oesteban oesteban left a comment

Choose a reason for hiding this comment

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

Looks reasonable :)

@effigies
Copy link
Member Author

I've got a broken nipreps/fmriprep#3423 that is paired with this. I figure I should get that working before merging this. Was aiming for 25.0, but it was delayed enough.

effigies added a commit to effigies/fmriprep that referenced this pull request May 13, 2025
oesteban
oesteban previously approved these changes May 13, 2025
Comment on lines +280 to +292
msg = "Missing readout timing information for <%s>. %s"
extra = "Explicit fallback must be provided."
have_trt = False
try:
get_trt(self.metadata, in_file=self.path)
except ValueError as exc:
raise MetadataError(
f"Missing readout timing information for <{self.path}>."
) from exc
have_trt = True
except ValueError:
with suppress(ValueError):
get_trt(self.metadata, in_file=self.path, use_estimate=True)
extra = "Estimated timing is available."

if not have_trt:
logger.warning(msg, self.path, extra)
Copy link
Member Author

Choose a reason for hiding this comment

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

@oesteban Your review of changes to this class would be appreciated. I didn't see an obvious way to thread config options into __attrs_post_init__, so instead I settled for emitting warnings at object creation time. This may push errors down into runtime that would currently be caught. I'll see about having fMRIPrep run the check at workflow build time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, best place to put it was in the sdcflows preproc workflow generator.

@effigies effigies merged commit 3b9ff3a into nipreps:master May 15, 2025
16 of 18 checks passed
effigies added a commit that referenced this pull request May 15, 2025
2.13.0 (May 15, 2025)

Feature release in the 2.13.x series.

This release addresses some longstanding issues with the SyN-SDC workflow,
improving the registration quality in adult humans by utilizing a spatial prior,
as well as allowing Laplacians to be up- or down-weighted in the cost function,
making it more usable across species.

Additionally, this release allows for the use of ``EstimatedTotalReadoutTime`` or
``EstimatedEchoSpacing``, or a manually provided fallback ``TotalReadoutTime`` value,
permitting the use of SDCFlows on datasets that do not have reliable timing information
without introducing incorrect metadata into the datasets.

* fix(syn): Re-enable priors respecting ``sd_priors`` argument (#488)
* feat: Add workflow arguments for metadata estimates and fallback TRT (#479)
* feat(syn): Update totalFieldVarianceInVoxel space based on voxel resolution (#487)
* feat(syn): Allow changing laplacians weights in SyN registration metric (#484)
* test(syn): Add a test to exercise SyN workflow creation and check parameters (#486)
effigies added a commit that referenced this pull request May 15, 2025
2.13.0 (May 15, 2025)

Feature release in the 2.13.x series.

This release addresses some longstanding issues with the SyN-SDC workflow,
improving the registration quality in adult humans by utilizing a spatial prior,
as well as allowing Laplacians to be up- or down-weighted in the cost function,
making it more usable across species.

Additionally, this release allows for the use of ``EstimatedTotalReadoutTime`` or
``EstimatedEchoSpacing``, or a manually provided fallback ``TotalReadoutTime`` value,
permitting the use of SDCFlows on datasets that do not have reliable timing information
without introducing incorrect metadata into the datasets.

* fix(syn): Re-enable priors respecting ``sd_priors`` argument (#488)
* feat: Add workflow arguments for metadata estimates and fallback TRT (#479)
* feat(syn): Update totalFieldVarianceInVoxel space based on voxel resolution (#487)
* feat(syn): Allow changing laplacians weights in SyN registration metric (#484)
* test(syn): Add a test to exercise SyN workflow creation and check parameters (#486)
@oesteban
Copy link
Member

@effigies sorry for not having had a look in time -- thanks for this!

@effigies effigies deleted the enh/estimated-trt branch May 16, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants