Commit f284a66e authored by Stephen Smith's avatar Stephen Smith Committed by Duncan Mortimer
Browse files

Updated fix_3_clean.m

parent d1a753ae
......@@ -68,24 +68,24 @@ ICA=functionnormalise(load(sprintf('filtered_func_data.ica/melodic_mix')));
if aggressive == 1
sprintf('aggressive cleanup')
confounds=[confounds ICA(:,DDremove)];
cts = cts - (confounds * (pinv(confounds) * cts));
cts = cts - (confounds * (pinv(confounds,1e-6) * cts));
if DObrainord == 1
BO.cdata = BO.cdata - (confounds * (pinv(confounds) * BO.cdata'))';
BO.cdata = BO.cdata - (confounds * (pinv(confounds,1e-6) * BO.cdata'))';
end
else
sprintf('unaggressive cleanup')
if domot == 1
% aggressively regress out motion parameters from ICA and from data
ICA = ICA - (confounds * (pinv(confounds) * ICA));
cts = cts - (confounds * (pinv(confounds) * cts));
ICA = ICA - (confounds * (pinv(confounds,1e-6) * ICA));
cts = cts - (confounds * (pinv(confounds,1e-6) * cts));
if DObrainord == 1
BO.cdata = BO.cdata - (confounds * (pinv(confounds) * BO.cdata'))';
BO.cdata = BO.cdata - (confounds * (pinv(confounds,1e-6) * BO.cdata'))';
end
end
betaICA = pinv(ICA) * cts; % beta for ICA (good *and* bad)
betaICA = pinv(ICA,1e-6) * cts; % beta for ICA (good *and* bad)
cts = cts - (ICA(:,DDremove) * betaICA(DDremove,:)); % cleanup
if DObrainord == 1
betaICA = pinv(ICA) * BO.cdata'; % beta for ICA (good *and* bad)
betaICA = pinv(ICA,1e-6) * BO.cdata'; % beta for ICA (good *and* bad)
BO.cdata = BO.cdata - (ICA(:,DDremove) * betaICA(DDremove,:))'; % cleanup
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment