Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7e5571c
add smoothing for anat files
mwmaclean Oct 13, 2022
506f6ba
setBatchSmoothingAnat.m
mwmaclean Oct 14, 2022
1b39a34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2022
24f6497
lint
Remi-Gau Oct 14, 2022
cb20f32
removed cfg files
mwmaclean Oct 14, 2022
0ba46cc
fix merge
mwmaclean Oct 14, 2022
24fc0f7
fix tests
Remi-Gau Oct 18, 2022
53434c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2022
2c04df4
add test for smooth anat batch
Remi-Gau Oct 18, 2022
6136a1a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2022
fdae22c
Merge pull request #758 from mwmaclean/add_anat-smooth
Remi-Gau Oct 18, 2022
5763ed1
add res label to entitites for smoothin anat files
Remi-Gau Oct 18, 2022
6104797
adapt lesion detection to use CSF
Remi-Gau Oct 18, 2022
67a4bac
add renaming of lesion detection output
Remi-Gau Oct 18, 2022
597b73a
improve renaming of lesion segmentation output
Remi-Gau Oct 19, 2022
aa5cb7a
Merge pull request #761 from cpp-lln-lab/lesion
Remi-Gau Oct 19, 2022
d925050
only smooth preproc file in main preprocessing pipeline
Remi-Gau Oct 19, 2022
f95fffd
Merge branch 'main' into dev
Remi-Gau Oct 30, 2022
21e8457
coerce into cell to allow unzipping
Remi-Gau Oct 30, 2022
0dfabd0
fix failing test
Remi-Gau Oct 30, 2022
d02770c
fix failing tests
Remi-Gau Oct 30, 2022
9fc785f
update bids matlab
Remi-Gau Oct 30, 2022
d11b893
update warning in roi basd GLM
Remi-Gau Oct 30, 2022
bad0b34
update bids matlab
Remi-Gau Oct 30, 2022
37ba722
update doc
Remi-Gau Oct 31, 2022
623fc0c
update octache
Remi-Gau Oct 31, 2022
b2dd75a
update submodules
Remi-Gau Nov 2, 2022
957981d
recursively use submodules in CI
Remi-Gau Nov 2, 2022
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
11 changes: 8 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "weekly"
interval: 'monthly'

- package-ecosystem: 'gitsubmodule'
directory: '/'
schedule:
interval: 'monthly'
2 changes: 1 addition & 1 deletion .github/workflows/run_system_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
fetch-depth: 0

- name: Get moae fmriprep data from OSF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_system_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
fetch-depth: 0

- name: Get moae fmriprep data from OSF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
fetch-depth: 0

- name: Install SPM
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
fetch-depth: 0

- name: Install SPM
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*_report.md

src/batches/cfg

# General
.DS_Store

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"url": "https://bids-standard.github.io/stats-models/BIDSStatsModel.json"
}
],
"esbonio.sphinx.confDir": ""
"files.associations": {"*.m": "matlab"}
}
1 change: 1 addition & 0 deletions bidspm.m
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ function preprocess(args)
end
bidsSpatialPrepro(opt);
if opt.fwhm.func > 0 && ~opt.anatOnly
opt.query.desc = 'preproc';
bidsSmoothing(opt);
end

Expand Down
2 changes: 1 addition & 1 deletion lib/CPP_ROI
Submodule CPP_ROI updated 466 files
2 changes: 1 addition & 1 deletion scripts/reslice_mid_brain.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

roiFiles = bids.query(BIDSroi, 'data', 'sub', subLabel, 'label', 'V1d', 'hemi', 'R');

referenceImg bids.query(BIDS, 'data', 'space', 'individual', 'desc', 'mean', 'suffix', 'bold');
referenceImg = bids.query(BIDS, 'data', 'space', 'individual', 'desc', 'mean', 'suffix', 'bold');

printProcessingSubject(iSub, subLabel);

Expand Down
6 changes: 5 additions & 1 deletion src/IO/unzipAndReturnsFullpathName.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
errorHandling(mfilename(), 'emptyInput', msg, false, true);
end

if ~iscell(fullpathName)
fullpathName = cellstr(fullpathName);
end

for iFile = 1:size(fullpathName, 1)

[directory, filename, ext] = spm_fileparts(fullpathName(iFile, :));
[directory, filename, ext] = spm_fileparts(fullpathName{iFile});

if strcmp(ext, '.gz') && ~opt.dryRun

Expand Down
4 changes: 4 additions & 0 deletions src/batches/preproc/setBatchSmoothing.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

% (C) Copyright 2019 bidspm developers

if isempty(images)
return
end

printBatchName('smoothing images', opt);

matlabbatch{end + 1}.spm.spatial.smooth.data = images;
Expand Down
87 changes: 87 additions & 0 deletions src/batches/preproc/setBatchSmoothingAnat.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
function matlabbatch = setBatchSmoothingAnat(matlabbatch, BIDS, opt, subLabel)
%
% Creates a batch to smooth the anat files of a subject
%
% USAGE::
%
% matlabbatch = setBatchSmoothingAnat(matlabbatch, BIDS, opt, subLabel)
%
% :param matlabbatch:
% :type matlabbatch: structure
%
% :type BIDS: structure
% :param BIDS: dataset layout.
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% :type opt: structure
%
% :param subLabel:
% :type subLabel:
%
% :returns: - :matlabbatch: (structure)
%
%
% See also: bidsSmoothing, setBatchSmoothing
%

% (C) Copyright 2022 bidspm developers

printBatchName('smoothing anat images', opt);

opt.query.space = opt.space;
opt = mniToIxi(opt);

% identify sessions for this subject
[sessions, nbSessions] = getInfo(BIDS, subLabel, opt, 'Sessions');

allFiles = [];

for iSes = 1:nbSessions

[runs, nbRuns] = getInfo(BIDS, subLabel, opt, 'Runs', sessions{iSes});

for iRun = 1:nbRuns

opt.bidsFilterFile.t1w.ses = sessions{iSes};
opt.bidsFilterFile.t1w.run = runs{iRun};

fieldsToTransfer = {'space', 'desc', 'label', 'res'};
for i = 1:numel(fieldsToTransfer)
field = fieldsToTransfer{i};
if isfield(opt.query, field)
opt.bidsFilterFile.t1w.(field) = opt.query.(field);
end
end

tolerant = true;
nbImgToReturn = Inf;
[anatImage, anatDataDir] = getAnatFilename(BIDS, opt, subLabel, nbImgToReturn, tolerant);

if isempty(anatImage)
break
end

anatImage = cellstr(anatImage);
anatDataDir = cellstr(anatDataDir);

for iFile = 1:numel(anatImage)
files{iFile, 1} = validationInputFile(anatDataDir{iFile}, ...
anatImage{iFile}); %#ok<*AGROW>
end

% add the files to list
allFilesTemp = cellstr(char(files));
allFiles = [allFiles; allFilesTemp];

end
end

% Prefix = FWHM
matlabbatch = setBatchSmoothing(matlabbatch, ...
opt, ...
allFiles, ...
opt.fwhm.func, ...
[spm_get_defaults('smooth.prefix'), num2str(opt.fwhm.func)]);

end
15 changes: 9 additions & 6 deletions src/batches/preproc/setBatchSmoothingFunc.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function matlabbatch = setBatchSmoothingFunc(matlabbatch, BIDS, opt, subLabel)
%
% Short description of what the function does goes here.
% Creates a batch to smooth the bold files of a subject
%
% USAGE::
%
Expand All @@ -17,8 +17,8 @@
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% :type opt: structure
%
% :param subLabel:
% :type subLabel:
% :param subLabel: subject label
% :type subLabel: char
%
% :returns: - :matlabbatch: (structure)
%
Expand All @@ -30,7 +30,11 @@

printBatchName('smoothing functional images', opt);

opt.query.desc = 'preproc';
desc = 'preproc';
if isfield(opt.query, 'desc') && ~isempty(opt.query.desc)
desc = opt.query.desc;
end
opt.query.desc = desc;
opt.query.space = opt.space;
opt = mniToIxi(opt);

Expand All @@ -45,8 +49,7 @@

for iRun = 1:nbRuns

[fileName, subFuncDataDir] = getBoldFilename( ...
BIDS, ...
[fileName, subFuncDataDir] = getBoldFilename(BIDS, ...
subLabel, sessions{iSes}, runs{iRun}, opt);

% TODO remove this extra check
Expand Down
Loading