Skip to content

Fix yeo7 off-by-1 indexing and MATLAB column_vector compatibility#378

Merged
zihuaihuai merged 1 commit into
masterfrom
fix/yeo7-and-matlab-column-vector
May 4, 2026
Merged

Fix yeo7 off-by-1 indexing and MATLAB column_vector compatibility#378
zihuaihuai merged 1 commit into
masterfrom
fix/yeo7-and-matlab-column-vector

Conversation

@zihuaihuai
Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • Run the Python test suite (pytest brainstat/tests) on a build that exercises RFT correction with at least one peak.
  • Smoke-test in MATLAB R2020a: call SLM.fit on the standard tutorial example and confirm peak_clus returns without error.
  • Re-run the original failing case from Retrieval of yeo7 information has off-by-1 error in python code #347 (peak on the final vertex of the mesh) and confirm _surfstat_to_brainstat_rft completes and assigns a sensible Yeo7 label.

- SLM._surfstat_to_brainstat_rft: vertid is stored 1-based (inherited
  from peak_clus), so subtract 1 before indexing the 0-based yeo7
  array. Previously a peak on the last mesh vertex raised an
  IndexError, and other peaks were silently misindexed (#347).
- peak_clus.column_vector: replace mustBeVector (R2020b+) with an
  explicit isvector check so the validator works on R2019b/R2020a
  (#285).
@zihuaihuai zihuaihuai force-pushed the fix/yeo7-and-matlab-column-vector branch from 3fd9378 to 08c74b9 Compare May 4, 2026 17:26
@zihuaihuai zihuaihuai merged commit b588136 into master May 4, 2026
14 of 17 checks passed
@zihuaihuai zihuaihuai deleted the fix/yeo7-and-matlab-column-vector branch May 4, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MATLAB On the MATLAB implementation Python On the Python implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retrieval of yeo7 information has off-by-1 error in python code [FIX] column_vector uses mustBeVector from MATLAB 2020b+

1 participant