Skip to content

Conversation

@tsalo
Copy link
Member

@tsalo tsalo commented May 27, 2025

Closes #536.

Changes proposed in this pull request

  • For multiband ASL data, determine if slice times within bands are monotonically increasing. If so, pass the slice spacing and multiband factor to BASIL.

@tsalo tsalo added the enhancement New feature or request label May 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.08%. Comparing base (5bbe278) to head (7269326).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
+ Coverage   75.91%   76.08%   +0.17%     
==========================================
  Files          38       38              
  Lines        4082     4107      +25     
==========================================
+ Hits         3099     3125      +26     
+ Misses        983      982       -1     

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

@tsalo
Copy link
Member Author

tsalo commented May 28, 2025

@tientong98 the two ruff commands I use are:

pipx run ruff format .
pipx run ruff check . --fix

Copy link
Member Author

@tsalo tsalo left a comment

Choose a reason for hiding this comment

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

Just a couple of very minor suggestions.

tien-tong and others added 2 commits May 28, 2025 14:42
@tsalo tsalo marked this pull request as ready for review May 28, 2025 19:18
@tsalo tsalo requested a review from Copilot May 28, 2025 19:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors slice-timing handling for multiband ASL by extracting it into a utility and wiring slice-spacing and multiband factors into the BASIL interface.

  • Extract inline slice-timing logic into prepare_basil_kwargs
  • Update the ASL workflow to call prepare_basil_kwargs(metadata)
  • Extend BASILCBF interface with a sliceband input trait

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
aslprep/workflows/asl/cbf.py Replaced inline slice-timing code with a call to prepare_basil_kwargs
aslprep/utils/asl.py Added prepare_basil_kwargs to compute slice_spacing and sliceband
aslprep/tests/test_utils_asl.py Added parametrized tests for prepare_basil_kwargs
aslprep/interfaces/cbf.py Introduced sliceband trait to _BASILCBFInputSpec
Comments suppressed due to low confidence (2)

aslprep/utils/asl.py:314

  • The code references np but the module does not import NumPy. Add import numpy as np at the top of this file to avoid a NameError.
slicetime_diffs = np.unique(np.round(np.diff(band_slice_times), 10))

aslprep/utils/asl.py:347

  • The returned key slice_spacing does not match the _BASILCBFInputSpec trait slicedt. Rename the key to slicedt (or map it before passing) so that the value is correctly applied to the interface.
return basil_kwargs

Copy link
Contributor

@aptinis aptinis left a comment

Choose a reason for hiding this comment

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

Reading the docs I think the interpretation of sliceband is the number of slices in each band and not the MB factor.

@tsalo
Copy link
Member Author

tsalo commented May 29, 2025

The changes look good to me, but since I created the PR I can't review it.

@tien-tong tien-tong self-requested a review May 29, 2025 17:43
@tsalo tsalo merged commit c1429bb into main May 29, 2025
26 checks passed
@tsalo tsalo deleted the mb-basil branch May 29, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorporate sliceband in oxford_asl call for multiband ASL

5 participants