Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion brainstat/stats/SLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ def _surfstat_to_brainstat_rft(self) -> None:
)
yeo_names, _ = fetch_yeo_networks_metadata(7)
yeo_names.insert(0, "Undefined")
yeo7_index = yeo7[self.P["peak"]["vertid"][i]]
# vertid is stored as 1-based (inherited from SurfStat /
# MATLAB conventions in peak_clus); subtract 1 before
# indexing the 0-based yeo7 array (see #347).
vertid = self.P["peak"]["vertid"][i]
yeo7_index = yeo7[vertid - 1] if vertid is not None else None
if "yeo7" not in self.P["peak"]:
self.P["peak"]["yeo7"] = []
self.P["peak"]["yeo7"].append(np.take(yeo_names, yeo7_index))
Expand Down
6 changes: 4 additions & 2 deletions brainstat_matlab/stats/@SLM/peak_clus.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@

function v_col = column_vector(v)
% Converts the input vector to a column vector.
arguments
v {mustBeVector}
% Note: mustBeVector was introduced in MATLAB R2020b; an explicit check
% is used here to keep compatibility with R2019b and R2020a (see #285).
if ~isempty(v) && ~isvector(v)
error('column_vector:NotAVector', 'Input must be a vector.');
end
v_col = v(:);
end
Loading