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
29 changes: 29 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[codespell]
# *.gii files are GIFTI XML surface meshes (canlab_canonical_brains): treat as data.
# docs_sphinx_old is legacy pre-built Sphinx output, External/ is vendored third-party code.
skip = .git,.git-meta,.svn,*.pdf,*.svg,*.js,_build,*.html,*.rtf,*.rtf.svn-base,*.gii,*.nii,*.mat,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ico,External,docs_sphinx_old
check-hidden = true
# Skip URLs (don't "fix" typos in third-party links) and base64-embedded image data
# left behind by MATLAB live-script export in docs/markdown_tutorials/*.m.
ignore-regex = https?://\S+|^% data: \{"dataType":"image".*
# Whitelist short variable names, MATLAB function/built-in names, proper names, and
# domain abbreviations that codespell would otherwise flag. Case-insensitive.
# ons, ans, fpr, ttests, myu, whos, ser, htmp, fwe, dout -- pre-existing stats vars
# ttest -- MATLAB hypothesis-test function, used as identifier & in docs everywhere
# indx, alph, te, ist, selt, multy, shft, delt, dum, datin, fixin, runn, nneeded,
# figurestyle, cxan, losin, commun, pres, ues -- variable names confirmed in source
# assignin, evalin -- MATLAB built-in functions
# inout -- canlab_results_fmridisplay montage layout option ('leftright inout')
# ment -- hyphen-broken "displace-\nment" in comment (movement_regressors.m)
# sepulcre, shepard, shure, claus, lew -- proper names (Yeo atlas; Shepard interpolation; researchers)
# nd -- often 2nd, also matches Nd/ND chemical symbol
# ore -- short for "or" in some places; appears in surface .gii-derived comments
# fo -- variable name (`fo = gcf`) in make_figure_into_orthviews.m
# atmost -- variable name in OptimizeDesign11/GA3/Sobol/sobol.m
# sessons -- local "session ons" variable in Statistics_tools/Support_functions/spm2delta.m
# lightening -- real word (making lighter), used for white-matter brightness in mean_image.m
# prctiles -- struct field of descriptives() output (public API, documented in docs/)
# atleast, whch, whn, includ -- variable names (renaming would break code; "atleast" -> "at least" would be a syntax error)
# efficency -- legacy function file name OptimizeDesign11/core_functions/efficency.m (sibling efficiency.m is the newer version; both retained)
# ony, nam, tha, thre, firt, jus -- ambiguous variable/string fragments in context
ignore-words-list = ons,ans,fpr,ttests,myu,whos,ser,htmp,fwe,dout,ttest,indx,alph,te,ist,selt,multy,shft,delt,dum,datin,fixin,runn,nneeded,figurestyle,cxan,losin,commun,pres,ues,assignin,evalin,inout,ment,sepulcre,shepard,shure,claus,lew,nd,ore,fo,atmost,sessons,lightening,prctiles,atleast,whch,whn,includ,efficency,ony,nam,tha,thre,firt,jus
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
- name: Codespell
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2.2
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/atlas.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
labels_4
labels_5
references
space_description = ''; % set this to something compatable with the allowed_sourcespace from render_on_surface for automatic projections to supported surfaces when plotting.
space_description = ''; % set this to something compatible with the allowed_sourcespace from render_on_surface for automatic projections to supported surfaces when plotting.
property_descriptions = { ...
'atlas_name: a short description or name of the atlas' ...
'probability_maps: voxels x regions matrix with probability values for each region' ...
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/extract_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
% respectively. This is useful for visualizing and assessing pattern
% weights, i.e., when the input data image is a weight pattern map.
% It can tell you how strong the contribution of each region is to
% prediction (high weight values) and how homogenous it is (pos vs.
% prediction (high weight values) and how homogeneous it is (pos vs.
% negative energy/rmsvs).
% RMSVs are expressed in weights / cm^3 of brain tissue, and volume is
% regularized by adding 1 cm^3 to avoid unstable results with small
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/merge_atlases.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@

% concatenating sparse matrices first is much faster than converting to full and the
% concatenating full matrices so instead of doing a double conversion
% and concatenating, try concatenating sparse matricies if either of
% and concatenating, try concatenating sparse matrices if either of
% them are sparse and then converting to full
%atlas_obj.probability_maps = [full(atlas_obj.probability_maps) full(atlas_obj_to_add.probability_maps)];
if issparse(atlas_obj.probability_maps) || issparse(atlas_obj_to_add.probability_maps)
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/montage.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
% fmridisplay or edit code for defaults as example).
%
% **'montagetype':**
% 'full' for full montages of axial and saggital slices.
% 'full' for full montages of axial and sagittal slices.
% 'full hcp' for full montage, but with surfaces and volumes from
% HCP data.
% 'compact' [default] for single-figure parasagittal and axial slices.
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/probability_maps_to_region_index.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
dropped_ind = find(~ismember(1:n_regions,n_maps));

% note, labels must be last in this list or else it would end up being
% asigned to the labels variable which is needed subsequently
% assigned to the labels variable which is needed subsequently
fnames = {'probability_maps', 'labels_2','labels_3','labels_4',...
'labels_5','label_descriptions','labels'};
assert(strcmp(fnames{end},'labels'));
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/reorder_atlas_regions.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
% Programmers' notes:
% Created by Tor Wager
% 12/2019: Tor fixed bug in reordering; probability_maps field was not
% preivously being considered, which resulted in wrong ordering when
% previously being considered, which resulted in wrong ordering when
% present. .dat is rebuilt from probability_maps if available.
% 3/2025 Updated help and added labelgroups option

Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@atlas/threshold.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@

% Identifies any fragmented parcels, splits them in two and postfixes
% _fragN to the label name, retaining corresponding probabilities for
% each regoin. N is the fragment index, frag1 is the largest and subsequent
% each region. N is the fragment index, frag1 is the largest and subsequent
% parcels are in order of size.
function obj = spin_off_frag(obj)
obj = obj.replace_empty();
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@brainpathway/brainpathway.m
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
function [obj_subset, region_objects, region_indices] = cluster_region_subset_by_connectivity(obj, varargin)
% [obj_subset, region_objects, region_indices] = cluster_region_subset_by_connectivity(obj, Group#, [# clusters])
%
% Takes a subset of parcels idenfied based on obj.node_clusters
% Takes a subset of parcels identified based on obj.node_clusters
% and clusters them based on profiles
% of pairwise connectivity with other regions. Returns a new
% object based on the target subset.
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@brainpathway/degree_calc.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% b2 = degree_calc(b2)
%
% Method for brainpathway
% uses node_clusters to caculate overall, within-cluster(network), and
% uses node_clusters to calculate overall, within-cluster(network), and
% between-cluster degree
%
% NOTE: Currently uses region averages (.region), update to use nodes!
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@brainpathway_multisubject/compute_HDIs.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
%% compute BCT measures on ref group
refgroup = bct_toolbox_undirected_graph_metrics(refgroup, thresh, varargin{:});

%% for each subject, regress on mean referece group to get an HDI (i.e., the slope)
%% for each subject, regress on mean reference group to get an HDI (i.e., the slope)

for i=1:size(bs.connectivity.regions.r,3)

Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@canlab_dataset/get_descriptives.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

function [Min_value, Max_value, Mean_value, St_Dev, myIQR, NaN_count, text_vals] = get_descriptives_var(D, vname)

% intialize
% initialize
[Min_value, Max_value, Mean_value, St_Dev, myIQR, NaN_count] = deal(NaN);
text_vals = [];

Expand Down
4 changes: 2 additions & 2 deletions CanlabCore/@canlab_dataset/plot_var.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
% plots across events with standard error shading
% - the grouping variable's description, if it exists, will
% be split along commas, and those values will be used as
% column lables
% column labels
%
% **eventmeans:**
% calculate and plot subject means across event-level variables
Expand All @@ -64,7 +64,7 @@
%
% **other:**
% other varargin are passed directly to barplot_columns. So
% for example, '95CI' will make 95% confidence interals, instead
% for example, '95CI' will make 95% confidence intervals, instead
% of SE bars.
%
%
Expand Down
4 changes: 2 additions & 2 deletions CanlabCore/@fmri_data/canlab_connectivity_preproc.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
% spikes., Consistent with principles in Lindquist 2019
% "sequential filtering" paper. See more notes below.
% 08/01/19: Wani reversed Tor and Marianne's revision above
% after dicussion with Tor and others. Spikes should be removed
% after discussion with Tor and others. Spikes should be removed
% before "low-pass filtering" the nuisance covariates, and
% added to the covariates later (see Ciric et al., 2018)
% Lindquist et al., 2019 did not address the issue related to
Expand Down Expand Up @@ -571,7 +571,7 @@
% time series data appropriately, accounting for filtering.
%
% 8/1/2019: Wani reversed this to the previous version after
% dicussion with Tor and others. Spikes should be removed
% discussion with Tor and others. Spikes should be removed
% before "low-pass filtering" the nuisance covariates, and
% added to the covariates later (see Ciric et al., 2018)

Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@fmri_data/evaluate_spatial_scale.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
%
% Phil: created, Dec 2018
%
% TODOs: - change outcome metric to optionally incude accuracy/AUC/etc.
% TODOs: - change outcome metric to optionally include accuracy/AUC/etc.
% - change outcome to optionally reflect % of noise ceiling
% - account for regions that have small number of voxels
% ..
Expand Down
4 changes: 2 additions & 2 deletions CanlabCore/@fmri_data/fmri_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
% new_obj.volInfo = MC_Setup.volInfo;
% new_obj.dat = MC_Setup.unweighted_study_data(:, sym_cons);
%
% You can create an fmri_data object with extacted image data.
% You can create an fmri_data object with extracted image data.
% - Let "imgs" be a string array or cell array of image names
% - This command creates an object with your (4-D) image data:
% - fmri_dat = fmri_data(imgs);
Expand Down Expand Up @@ -453,7 +453,7 @@
end

% convert dat to single if needed
% this is esp relevant for converstion of atlas to fmri_data
% this is esp relevant for conversion of atlas to fmri_data
% because atlas has integer data type by default. this is
% to prevent a range of issues that can occur when using
% the fmri_data object later on and dat field is an
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@fmri_data/hrf_fit.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
%
% A. **Fit HRF using IL-function**
% Choose mode (deterministic/stochastic)
% - 0 - deterministic aproach
% - 0 - deterministic approach
% - 1 - simulated annealing approach
%
% Please note that when using simulated annealing approach you
Expand Down
16 changes: 8 additions & 8 deletions CanlabCore/@fmri_data/model_brain_pathway.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@

% ..
% Programmers' notes:
% 10/10/2019 Wrote funcion (Phil Kragel)
% 10/10/2019 Wrote function (Phil Kragel)
% 4/14/2020 Major overhaul and documentation (Phil Kragel and Tor Wager)
% 4/15/2020 Add more documentation (Phil Kragel)
% 9/16/2020 Tor Wager - update documentation
Expand Down Expand Up @@ -307,7 +307,7 @@

% Convert data into cell arrays for cross-validation
% Each cell contains a Voxels x Images matrix for the corresponding fold
% For 10-fold, images will be devided into 10 cells
% For 10-fold, images will be divided into 10 cells

% note by kodiweera: convert to a cell array before the cross validation loop. I took this loop out of the main loop below to make the the program little faster as this is repeatedlty run during the k-fold validation.
% Convert to cell array, one cell per subject
Expand Down Expand Up @@ -766,17 +766,17 @@

istat = stats.latent_correlation_interaction_ttest;

stats_report{3} = sprintf('The interaction between on-targed (expected) and off-target pathways was %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{3} = sprintf('The interaction between on-targed (expected) and off-target pathways was %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

istat = stats.latent_correlation_pathway_one_ttest;

stats_report{4} = sprintf('Pathway 1 on-target vs. off-target correlations were %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{4} = sprintf('Pathway 1 on-target vs. off-target correlations were %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

istat = stats.latent_correlation_pathway_two_ttest;

stats_report{5} = sprintf('Pathway 2 on-target vs. off-target correlations were %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{5} = sprintf('Pathway 2 on-target vs. off-target correlations were %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

stats_report{6} = ' ';
Expand All @@ -803,17 +803,17 @@

istat = stats.simple_correlation_interaction_ttest;

stats_report{wh_last + 3} = sprintf('The interaction between on-targed (expected) and off-target pathways was %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{wh_last + 3} = sprintf('The interaction between on-targed (expected) and off-target pathways was %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

istat = stats.simple_correlation_pathway_one_ttest;

stats_report{wh_last + 4} = sprintf('Pathway 1 on-target vs. off-target correlations were %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{wh_last + 4} = sprintf('Pathway 1 on-target vs. off-target correlations were %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

istat = stats.simple_correlation_pathway_two_ttest;

stats_report{wh_last + 5} = sprintf('Pathway 2 on-target vs. off-target correlations were %s signficant, t(%3.1f) = %3.2f, p = %3.6f.', ...
stats_report{wh_last + 5} = sprintf('Pathway 2 on-target vs. off-target correlations were %s significant, t(%3.1f) = %3.2f, p = %3.6f.', ...
sigstr{(istat.p < 0.05) + 1}, istat.df(1), istat.tstat(1), istat.p(1));

stats_report{wh_last + 6} = ' ';
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@fmri_data/model_mpathi.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@

% Convert data into cell arrays for cross-validation
% Each cell contains a Voxels x Images matrix for the corresponding fold
% For 10-fold, images will be devided into 10 cells
% For 10-fold, images will be divided into 10 cells


for xval_i=1:max(indices)
Expand Down
4 changes: 2 additions & 2 deletions CanlabCore/@fmri_data/plot.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [wh_outlier_uncorr, wh_outlier_corr, X] = plot(fmridat, varargin)
% Custom plots for fmri_data object. Includes mulitple plots and outlier detection.
% Custom plots for fmri_data object. Includes multiple plots and outlier detection.
%
% :Usage:
% ::
Expand Down Expand Up @@ -79,7 +79,7 @@
% of each image are equal. If the variances are all of approximately the same scale,
% the diagonal will be a single color.
%
% Correlation Matrix $\frac{{X}'X}{n-1}$, colums of X are Z-scored, n is number of rows in X
% Correlation Matrix $\frac{{X}'X}{n-1}$, columns of X are Z-scored, n is number of rows in X
% This plot shows the correlation between each image and the others.
% Now, the main diagonal will always be one because each image is
% perfectly correlated with itself. The off-diagonals should be positive
Expand Down
Loading
Loading