Commit 5dac73e1 authored by Sam Harrison's avatar Sam Harrison
Browse files

Switch ground truth tests to `dual_regression`

Keeps everything consistent, and relative performances easier to interpret.
parent 78f73df3
......@@ -334,24 +334,40 @@ for n = 1:params.nRepeats
Pg = Pg + P{s};
end
Pg = Pg / params.S;
% Add dummy noise maps for any extras inferred
if params.iN > params.N
Pg = [Pg, zeros([params.V, params.iN - params.N])];
end
% Add dummy maps for any extras inferred
%if params.iN > params.N
% Pg = [Pg, zeros([params.V, params.iN - params.N])];
%end
% Save
mapFile = fullfile(repeatDir, 'GT_Pg.nii.gz');
save_avw( ...
reshape(Pg, 10, 10, params.V / 100, params.N), ...
mapFile, 'f', [1 1 1 1]);
gt_params = params; gt_params.iN = gt_params.N;
% Dual-reg from ground truth group maps
[gtdr_P, gtdr_A] = runDR(D, Pg, params);
gtdr_pcA = calculateNetmats(gtdr_A, params);
%[gtdr_P, gtdr_A] = runDR(D, Pg, params);
dualregDir = fullfile(repeatDir, 'GT_Pg.dr');
system(sprintf( ...
'sh Methods/DualRegression.sh %s %s %s', ...
dualregDir, niftiDir, mapFile));
% `t` means thresholded as per Bijsterbosch et al., eLife, 2019
[gtdr_P, gtdr_A, gtdr_Pt, gtdr_At] ...
= loadDualRegression(dualregDir, gt_params);
gtdr_pcA = calculateNetmats(gtdr_A, gt_params);
gtdr_pcAt = calculateNetmats(gtdr_At, gt_params);
scores.GTg_DR(n) = calculateDecompositionAccuracy( ...
P, gtdr_P, A, gtdr_A, pcA, gtdr_pcA, params);
P, gtdr_P, A, gtdr_A, pcA, gtdr_pcA, gt_params);
scores.GTg_DRt(n) = calculateDecompositionAccuracy( ...
P, gtdr_Pt, A, gtdr_At, pcA, gtdr_pcAt, gt_params);
% Repeat, but now 'clean' dual regression (i.e. from PA, not D)
[gtdr_P, gtdr_A] = runDR(PA, Pg, params);
gtdr_pcA = calculateNetmats(gtdr_A, params);
%[gtdr_P, gtdr_A] = runDR(PA, Pg, params);
%gtdr_pcA = calculateNetmats(gtdr_A, params);
scores.GTg_PADR(n) = calculateDecompositionAccuracy( ...
P, gtdr_P, A, gtdr_A, pcA, gtdr_pcA, params);
%scores.GTg_PADR(n) = calculateDecompositionAccuracy( ...
% P, gtdr_P, A, gtdr_A, pcA, gtdr_pcA, params);
%Ground truth linear model
%scores.GT.PA(n) = calculateBoldRecovery(PA, makePA(P,A,params), params);
......
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