Skip to content

Commit

Permalink
Merge pull request #51 from fishpm/master
Browse files Browse the repository at this point in the history
topup & tedana
  • Loading branch information
CPernet authored Sep 6, 2023
2 parents aa57960 + 5a9b8ac commit 162f696
Show file tree
Hide file tree
Showing 5 changed files with 800 additions and 439 deletions.
6 changes: 4 additions & 2 deletions QA/spmup_spatialcorr.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
% --------------------------
% Copyright (C) SPMUP Team

if exist('nanmean','file') == 0
error('you do not have stats toolbox to perform this operation, sorry')
if exist('nansum','file') ~= 2
% error('you do not have stats toolbox to perform this operation, sorry')
end

%% check inputs
Expand Down Expand Up @@ -97,6 +97,7 @@
parfor i = 1:size(Y,4)
S = squeeze(Y(:,:,:,i)); % take one volume
vols = reshape(S,[size(Y,1)*size(Y,2),n]); % reshape each slice as vectors
vols(isnan(vols)) = 0; % handle images with NaNs (e.g., tedana output)
all_r = corr(vols); % all correlations between slices
idx = 2:n+1:numel(all_r); % take only one above diag (12,23,34,..)
r(i,:) = all_r(idx);
Expand Down Expand Up @@ -138,6 +139,7 @@
parfor i = 1:size(Y,3)
S = squeeze(Y(:,:,i,:)); % take one slice all volumes
vols = reshape(S,[size(Y,1)*size(Y,2),n]); % reshape slices as vectors
vols(isnan(vols)) = 0; % handle images with NaNs (e.g., tedana output)
all_r = corr(vols); % all correlations between volumes
idx = 2:n+1:numel(all_r); % take only one above diag (12,23,34,..)
r(i,:) = all_r(idx);
Expand Down
6 changes: 3 additions & 3 deletions QA/spmup_volumecorr.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
% --------------------------
% Copyright (C) SPMUP Team

if exist('nanmean','file') == 0
error('you do not have stats toolbox to perform this operation, sorry')
if exist('nansum','file') ~= 2
% error('you do not have stats toolbox to perform this operation, sorry')
end

%% check inputs
Expand Down Expand Up @@ -163,4 +163,4 @@
end

r_outliers = r_outliers';
r_course = r_course';
r_course = r_course';
Loading

0 comments on commit 162f696

Please sign in to comment.