Skip to content

Draft slice banding metrics - #1461

Draft
tsalo wants to merge 13 commits into
ME-ICA:mainfrom
tsalo:add-slice-banding-metrics
Draft

Draft slice banding metrics#1461
tsalo wants to merge 13 commits into
ME-ICA:mainfrom
tsalo:add-slice-banding-metrics

Conversation

@tsalo

@tsalo tsalo commented Jul 6, 2026

Copy link
Copy Markdown
Member

Closes #1415. This drafts a couple of metrics that might be useful for flagging multiband slice leakage artifacts.

Changes proposed in this pull request:

  • Add spike metric, which looks at kurtosis in a time series to flag components dominated by single large signal spikes.
  • Add slice_banding and slice_leakage metrics, which might help with multiband acceleration artifacts.

tsalo and others added 10 commits May 18, 2026 11:08
Add two TE-dependence-independent artifact metrics that flag
acquisition/motion signatures which can mimic mixed TE-dependence:

- compute_slice_banding: detects multiband/slice-leakage structure in a
  component's spatial weight map (per-axis bandR2 * bandMB).
- compute_spike: Fisher temporal kurtosis of each component time series,
  flagging isolated transients after linear detrending.

Both are registered in metrics.json and computed in collect.generate_metrics
when requested. Includes unit tests for behavior and registration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tsalo tsalo added the enhancement issues describing possible enhancements to the project label Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.07224% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.13%. Comparing base (9ef5a33) to head (90b80ad).

Files with missing lines Patch % Lines
tedana/metrics/collect.py 28.00% 13 Missing and 5 partials ⚠️
tedana/metrics/spatial.py 89.79% 6 Missing and 9 partials ⚠️
tedana/metadata.py 98.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1461      +/-   ##
==========================================
- Coverage   90.29%   90.13%   -0.17%     
==========================================
  Files          31       34       +3     
  Lines        5060     5321     +261     
  Branches      928      986      +58     
==========================================
+ Hits         4569     4796     +227     
- Misses        329      348      +19     
- Partials      162      177      +15     

☔ View full report in Codecov by Harness.
📢 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

tsalo commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

I ran tedana on the first 20 runs of ds006185 (PAFIN fMRIPrep derivatives), then found the run with the component with the highest value for each component and the component with the lowest value in that same run (so we're comparing apples to apples), then plotted the relevant data.

Hopefully this helps give an idea of what these metrics are capturing.

Spike: the component time series

spike

Slice banding: the squared beta map (cropped to 2nd - 98th percentile)

slice_banding

Slice leakage: the squared beta map (cropped to 2nd - 98th percentile)

slice_leakage

Slice leakage, aliasing component: the squared beta map (cropped to 2nd - 98th percentile)

slice_leakage_aliasing_z

Slice leakage, periodicity component: the squared beta map (cropped to 2nd - 98th percentile)

slice_leakage_periodicity_z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement issues describing possible enhancements to the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slice leakage artifact metric

1 participant