Fix yeo7 off-by-1 indexing and MATLAB column_vector compatibility#378
Merged
Conversation
This was referenced May 4, 2026
- 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).
3fd9378 to
08c74b9
Compare
This was referenced May 4, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SLM._surfstat_to_brainstat_rftwas indexing the 0-basedyeo7array with the 1-basedvertidproduced bypeak_clus, causing anIndexErrorwhen a peak landed on the last mesh vertex and silently mis-labeling Yeo networks for every other peak. Subtract 1 before indexing. Closes Retrieval of yeo7 information has off-by-1 error in python code #347.column_vector(helper inpeak_clus.m) used themustBeVectorvalidator, which is only available in MATLAB R2020b+. Replaced with an explicitisvectorcheck so R2019b/R2020a still work. Closes [FIX] column_vector uses mustBeVector from MATLAB 2020b+ #285.Test plan
pytest brainstat/tests) on a build that exercises RFT correction with at least one peak.SLM.fiton the standard tutorial example and confirmpeak_clusreturns without error._surfstat_to_brainstat_rftcompletes and assigns a sensible Yeo7 label.