Skip to content

Commit 741f67b

Browse files
authored
Merge pull request #634 from Remi-Gau/remi_fix_win_bug
[FIX] use unix format when priting path to screen
2 parents deebe5f + 0e30836 commit 741f67b

18 files changed

+63
-37
lines changed

src/IO/createDerivativeDir.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function createDerivativeDir(opt)
1515

1616
if ~exist(opt.dir.derivatives, 'dir')
1717
spm_mkdir(opt.dir.derivatives);
18-
msg = sprintf('derivatives directory created: %s \n', opt.dir.derivatives);
18+
msg = sprintf('derivatives directory created: %s \n', ...
19+
pathToPrint(opt.dir.derivatives));
1920
end
2021

2122
printToScreen(msg, opt);

src/IO/getData.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
printToScreen(msg, opt);
3434
end
3535

36-
msg = sprintf('Getting data from:\n %s\n', bidsDir);
36+
msg = sprintf('Getting data from:\n %s\n', pathToPrint(bidsDir));
3737
printToScreen(msg, opt);
3838

3939
validationInputFile(bidsDir, 'dataset_description.json');

src/IO/overwriteDir.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function overwriteDir(directory, opt)
33
% (C) Copyright 2021 CPP_SPM developers
44

55
if exist(directory, 'dir') == 7
6-
msg = sprintf('overwriting directory: %s \n', directory);
6+
msg = sprintf('overwriting directory: %s \n', pathToPrint(directory));
77
errorHandling(mfilename(), 'overWritingDir', msg, true, opt.verbosity);
88
rmdir(directory, 's');
99
end

src/IO/saveOptions.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function saveOptions(opt)
2424
jsonFormat.indent = ' ';
2525
spm_jsonwrite(filename, opt, jsonFormat);
2626

27-
printToScreen(sprintf('Options saved in: %s\n\n', filename), opt);
27+
printToScreen(sprintf('Options saved in: %s\n\n', ...
28+
pathToPrint(filename)), opt);
2829

2930
end

src/batches/preproc/setBatchSTC.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
runCounter = runCounter + 1;
116116

117-
printToScreen([files{iFile}, '\n'], opt);
117+
printToScreen([pathToPrint(files{iFile}), '\n'], opt);
118118

119119
end
120120

src/batches/preproc/setBatchSaveCoregistrationMatrix.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
sessions = getInfo(BIDS, subLabel, opt, 'Sessions');
3737
runs = getInfo(BIDS, subLabel, opt, 'Runs', sessions{1});
3838

39-
[fileName, subFuncDataDir] = getBoldFilename( ...
40-
BIDS, ...
39+
[fileName, subFuncDataDir] = getBoldFilename(BIDS, ...
4140
subLabel, sessions{1}, runs{1}, opt);
4241
bf = bids.File(fileName);
4342

@@ -57,8 +56,7 @@
5756
matlabbatch{end}.cfg_basicio.var_ops.cfg_save_vars.vars.vname = 'transformationMatrix';
5857

5958
matlabbatch{end}.cfg_basicio.var_ops.cfg_save_vars.vars.vcont(1) = ...
60-
cfg_dep( ...
61-
'Coregister: Estimate: Coregistration Matrix', ...
59+
cfg_dep('Coregister: Estimate: Coregistration Matrix', ...
6260
returnDependency(opt, 'coregister'), ...
6361
substruct('.', 'M'));
6462

src/batches/stats/setBatchSubjectLevelGLMSpec.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
% If it exists, issue a warning that it has been overwritten
6868
ffxDir = getFFXdir(subLabel, opt);
6969
overwriteDir(ffxDir, opt);
70-
printToScreen(sprintf(' output dir: %s\n', ffxDir), opt);
70+
printToScreen(sprintf(' output dir: %s\n', pathToPrint(ffxDir)), opt);
7171
fmri_spec.dir = {ffxDir};
7272

7373
fmri_spec.fact = struct('name', {}, 'levels', {});

src/bids/getAnatFilename.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
% it could be required to take another one, or several and mean them...
4949
if numel(anat) > 1
5050
msg = sprintf('More than one anat file found:%s\n\nTaking the first one:\n\n %s\n', ...
51-
createUnorderedList(anat), ...
52-
anat{1});
51+
createUnorderedList(pathToPrint(anat)), ...
52+
pathToPrint(anat{1}));
5353
errorHandling(mfilename(), 'severalAnatFile', msg, true, opt.verbosity);
5454
end
5555
anat = anat{1};
5656
anatImage = unzipAndReturnsFullpathName(anat);
5757

58-
msg = sprintf('selecting anat file: %s\n', anat);
58+
msg = sprintf('selecting anat file: %s\n', pathToPrint(anat));
5959
printToScreen(msg, opt);
6060

6161
[anatDataDir, anatImage, ext] = spm_fileparts(anatImage);

src/bids/getBoldFilename.m

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
%
1212
% :param BIDS: returned by bids.layout when exploring a BIDS data set.
1313
% :type BIDS: structure
14-
% :param subLabel: label of the subject ; in BIDS lingo that means that for a file name
14+
%
15+
% :param subLabel: label of the subject ; in BIDS lingo that means that for a file name
1516
% ``sub-02_task-foo_bold.nii`` the subLabel will be the string ``02``
16-
% :type subLabel: string
17+
% :type subLabel: char
18+
%
1719
% :param sessionID: session label (for `ses-001`, the label will be `001`)
18-
% :type sessionID: string
20+
% :type sessionID: char
21+
%
1922
% :param runID: run index label (for `run-001`, the label will be `001`)
20-
% :type runID: string
23+
% :type runID: char
24+
%
2125
% :param opt: Mostly used to find the task name.
2226
% :type opt: structure
2327
%
@@ -43,7 +47,7 @@
4347
% some part of it is in getInfo
4448
if isempty(boldFilename)
4549
msg = sprintf('No bold file found in:\n\t%s\nfor filter:%s\n', ...
46-
BIDS.pth, ...
50+
pathToPrint(BIDS.pth), ...
4751
createUnorderedList(opt.query));
4852

4953
errorHandling(mfilename(), 'emptyInput', msg, false, true);
@@ -52,7 +56,7 @@
5256
% in case files have been unzipped, we do it now
5357
fullPathBoldFilename = unzipAndReturnsFullpathName(boldFilename, opt);
5458

55-
printToScreen(createUnorderedList(fullPathBoldFilename), opt);
59+
printToScreen(createUnorderedList(pathToPrint(fullPathBoldFilename)), opt);
5660

5761
boldFilename = spm_file(fullPathBoldFilename, 'filename');
5862
subFuncDataDir = spm_file(fullPathBoldFilename, 'path');

0 commit comments

Comments
 (0)