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
4 changes: 4 additions & 0 deletions src/IO/overwriteDir.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function overwriteDir(directory, opt)
%
% USAGE::
%
% overwriteDir(directory, opt)
%
% (C) Copyright 2021 CPP_SPM developers

Expand Down
5 changes: 4 additions & 1 deletion src/batches/saveMatlabBatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ function saveMatlabBatch(matlabbatch, batchType, opt, subLabel) %#ok<INUSL>
end

jobsDir = fullfile(opt.dir.jobs, subLabel);
[~, ~, ~] = mkdir(jobsDir);
spm_mkdir(jobsDir);

batchFileName = returnBatchFileName(batchType, '.mat');
batchFileName = fullfile(jobsDir, batchFileName);

msg = sprintf('\nSaving job in:\n\t%s', pathToPrint(opt.dir.jobs));
printToScreen(msg, opt);

save(batchFileName, 'matlabbatch', '-v7');

saveSpmScript(batchFileName);
Expand Down
2 changes: 1 addition & 1 deletion src/batches/stats/setBatchFactorialDesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
icell(1).scans{end + 1, 1} = file;

printProcessingSubject(iSub, subLabel, opt);
msg = sprintf(' %s\n\n', char(file));
msg = sprintf(' %s\n\n', pathToPrint(char(file)));
printToScreen(msg, opt);

end
Expand Down
14 changes: 12 additions & 2 deletions src/group_level/findSubjectConImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
ffxDir = getFFXdir(subLabel, opt);
load(fullfile(ffxDir, 'SPM.mat'));

printToScreen(sprintf('\n\nFor subject: %s', subLabel), opt);

for iCon = 1:numel(contrastName)

% find which contrast of that subject has the name of the contrast
Expand All @@ -56,7 +58,8 @@

if isempty(conIdx)

msg = sprintf('Skipping subject %s. Could not find a contrast named %s\nin %s.\n', ...
msg = sprintf(['\n\nSkipping subject %s. ', ...
'Could not find a contrast named %s\nin %s.\n'], ...
subLabel, ...
contrastName{iCon}, ...
fullfile(ffxDir, 'SPM.mat'));
Expand All @@ -77,7 +80,14 @@
end

fileName = sprintf('con_%0.4d.nii', conIdx);
file{iCon, 1} = validationInputFile(ffxDir, fileName, smoothPrefix);
fileName = validationInputFile(ffxDir, fileName, smoothPrefix);

msg = sprintf('\ncontrast "%s" in image:\n\t%s', ...
contrastName{iCon}, ...
pathToPrint(fileName));
printToScreen(msg, opt);

file{iCon, 1} = fileName;

end

Expand Down
3 changes: 3 additions & 0 deletions src/workflows/saveAndRunWorkflow.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
%
% :param matlabbatch: list of SPM batches
% :type matlabbatch: structure
%
% :param batchName: name of the batch
% :type batchName: string
%
% :param opt: structure or json filename containing the options. See
% ``checkOptions`` and ``loadAndCheckOptions``.
% :type opt: structure
%
% :param subLabel: subject label
% :type subLabel: string
%
Expand Down