Skip to content
Open
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
2 changes: 1 addition & 1 deletion CanlabCore/@fmri_data/robfit_parcelwise.m
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
else
% MAFDR
if doverbose, fprintf('%s\nApplying MAFDR correction\n', names{i}); end
[FDRq(:, i), ~, pIO] = mafdr(pvalues(:, i));
[~, FDRq(:, i), pIO] = mafdr(pvalues(:, i));
sig_q05 = FDRq < 0.05;
% P-threshold for FDR q < 0.05 for each map
pthr_i = max(pvalues(FDRq(:, i) < 0.05, i));
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@predictive_model/bootstrap.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

if verbose, fprintf('bootstrap: %d samples', nboot); end
every = max(1, ceil(nboot / 20));
for b = 1:nboot
parfor b = 1:nboot
if verbose && mod(b, every) == 0, fprintf('.'); end

if isempty(groups)
Expand Down
2 changes: 1 addition & 1 deletion CanlabCore/@predictive_model/permutation_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
end
every = max(1, ceil(nperm / 20));

for i = 1:nperm
parfor i = 1:nperm
if verbose && mod(i, every) == 0, fprintf('.'); end

switch perm_scheme
Expand Down
25 changes: 23 additions & 2 deletions CanlabCore/@region/table.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@
% November 2022: Autolabel now accepts 'atlas_obj' argument. Michael Sun
% September 2024: add "noverbose" option. Zizhuang Miao
% September 2024: add "publication" option based on mine and Zizhuang's code. Michael Sun
% August 2026: made improvements to retain Z_descrip from input region object. Lukas VO


n_cols = 140; % 140 good for HTML reports
sep_str = repmat('_', 1, n_cols); % see textwrap
Z_descrip = cl.Z_descrip;
val_descrip = cl.val_descrip;

k = 0;
dosep = true;
Expand Down Expand Up @@ -158,6 +161,16 @@
% separate pos and neg
[poscl, negcl] = posneg_separate(cl);

for preg = 1:size(poscl, 2)
poscl(preg).Z_descrip = Z_descrip;
poscl(preg).val_descrip = val_descrip;
end

for nreg = 1:size(negcl, 2)
negcl(nreg).Z_descrip = Z_descrip;
negcl(nreg).val_descrip = val_descrip;
end

cl = [poscl negcl];
ispos = [true(1, length(poscl)) false(1, length(negcl))]; % logical for splitting combined cl later

Expand Down Expand Up @@ -294,9 +307,17 @@

% Z = get_max_Z(cl);
if show_min % show minimum value
Z = get_min(cl, 'Z', 'minVal'); % use function because may be empty, handle if so
if ~isempty(Z_descrip)
Z = get_min(cl, 'Z', ['min' Z_descrip]); % use function because may be empty, handle if so
else
Z = get_min(cl, 'Z', 'minZ');
end
else % default behavior: max Z / signed max
Z = get_signed_max(cl, 'Z', 'minP'); % use function because may be empty, handle if so
if ~isempty(Z_descrip)
Z = get_signed_max(cl, 'Z', ['max' Z_descrip]); % use function because may be empty, handle if so
else
Z = get_signed_max(cl, 'Z', 'maxZ');
end
end

results_table = [Region Volume XYZ Z Atlas_coverage];
Expand Down
11 changes: 6 additions & 5 deletions CanlabCore/Statistics_tools/searchlight_disti_Lukas.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

%% -------------------- Defaults --------------------
r = 3;
P = 100;
P = 200;
alg = 'cv_svm';
fixedC = [];
cv_assign = [];
Expand Down Expand Up @@ -211,20 +211,21 @@
else
% Enforce constraint q >= p (as in SAS proc multtest)
for j = 1:length(TFCE_q_voxel_fdr)
if TFCE_q_voxel_fdr(j) < p_unc(j)
TFCE_q_voxel_fdr(j) = p_unc(j);
if TFCE_q_voxel_fdr(j) < TFCE_p_voxel(j)
TFCE_q_voxel_fdr(j) = TFCE_p_voxel(j);
end
end

end

tfce_stat_img_fdr = tfce_stat_img;
if exist('TFCE_p_voxel','var')

if aprioriprob > 0.99 % Benjamini-Hochberg result
tfce_stat_img_fdr.dat = TFCE_p_voxel_fdr;
tfce_stat_img_fdr.dat_descrip = ['fdr corrected TFCE p-values based on ' num2str(P) ' permutations'];
tfce_stat_img_fdr.p = TFCE_p_voxel_fdr;
tfce_stat_img_fdr.p_type = ['fdr corrected TFCE p-values based on ' num2str(P) ' permutations'];
else
else % Storey result
tfce_stat_img_fdr.dat = TFCE_q_voxel_fdr;
tfce_stat_img_fdr.dat_descrip = ['fdr corrected TFCE q-values based on ' num2str(P) ' permutations'];
tfce_stat_img_fdr.p = TFCE_q_voxel_fdr;
Expand Down
Loading