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
8 changes: 8 additions & 0 deletions .github/workflows/run_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ jobs:
- name: Install validators
run: make install

- name: Get moae fmriprep data from OSF
run: |
mkdir -p demos/MoAE/inputs/
cd demos/MoAE/inputs/
wget https://osf.io/vufjs/download
unzip download
mv moae_fmriprep fmriprep

- name: Install SPM
run: |
git clone https://github.com/spm/spm12.git --depth 1
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/run_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ jobs:
- name: Install validators
run: make install

- name: Get moae fmriprep data from OSF
run: |
mkdir -p demos/MoAE/inputs/
cd demos/MoAE/inputs/
wget https://osf.io/vufjs/download
unzip download
mv moae_fmriprep fmriprep

- name: Install SPM
run: |
git clone https://github.com/spm/spm12.git --depth 1
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
[![codecov](https://codecov.io/gh/cpp-lln-lab/bidspm/branch/main/graph/badge.svg?token=PMQYH0DIPX)](https://codecov.io/gh/cpp-lln-lab/bidspm)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3554331.svg)](https://doi.org/10.5281/zenodo.3554331)
[![GitHub last commit](https://img.shields.io/github/last-commit/cpp-lln-lab/bidspm)](https://github.com/cpp-lln-lab/bidspm.git)
[![HitCount](https://hits.dwyl.com/cpp-lln-lab/bidspm.svg?style=flat-square&show=unique)](http://hits.dwyl.com/cpp-lln-lab/bidspm)
[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](https://github.com/cpp-lln-lab/bidspm#contributors)

<!-- [![HitCount](https://hits.dwyl.com/cpp-lln-lab/bidspm.svg?style=flat-square&show=unique)](http://hits.dwyl.com/cpp-lln-lab/bidspm) -->


# bidspm

Expand Down
17 changes: 17 additions & 0 deletions demos/face_repetition/face_rep_03_roi_analysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
preproc_dir = fullfile(opt.dir.derivatives, 'bidspm-preproc');

opt.bidsFilterFile.roi.space = 'individual';
opt.bidsFilterFile.roi.label = 'V1d';

model_file = fullfile(this_dir, 'models', 'model-faceRepetition_smdl.json');

Expand All @@ -52,3 +53,19 @@
'options', opt, ...
'fwhm', 0, ...
'skip_validation', skip_validation);

opt.bidsFilterFile.roi.space = 'individual';
opt.bidsFilterFile.roi.label = 'V1v';

return

bidspm(bids_dir, output_dir, 'subject', ...
'action', 'stats', ...
'participant_label', {'01'}, ...
'preproc_dir', preproc_dir, ...
'model_file', model_file, ...
'roi_based', true, ...
'space', {'individual'}, ...
'options', opt, ...
'fwhm', 0, ...
'skip_validation', skip_validation);
5 changes: 5 additions & 0 deletions src/QA/plotRoiTimeCourse.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@

tsvFile = args.Results.tsvFile;
timeCourse = bids.util.tsvread(tsvFile);
if ~isstruct(timeCourse)
tmp = struct('this_condition', timeCourse);
timeCourse = tmp;
clear tmp;
end
conditionNames = fieldnames(timeCourse);

visible = 'off';
Expand Down
5 changes: 2 additions & 3 deletions src/bids/getROIs.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@
errorHandling(mfilename(), 'noSubject', msg, false, opt.verbosity > 0);
end

filter = struct('sub', regexify(subLabel), ...
'space', space, ...
'suffix', 'mask');
filter = opt.bidsFilterFile.roi;
filter.sub = regexify(subLabel);

if ~isempty(roiNames)
if iscell(roiNames)
Expand Down
2 changes: 1 addition & 1 deletion src/workflows/roi/bidsRoiBasedGLM.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

timeCourse = {};
dt = [];
percentSignalChange = [];
percentSignalChange = struct('absMax', [], 'max', []);

for iCon = 1:numel(eventSpec)

Expand Down
57 changes: 57 additions & 0 deletions tests/tests_workflows/stats/test_bidsRoiBasedGLM.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,60 @@ function test_bidsRoiBasedGLM_checks()
assertExceptionThrown(@() bidsRoiBasedGLM(opt), 'bidsRoiBasedGLM:roiBasedAnalysis');

end

function test_bidsRoiBasedGLM_run()
%
% integration test:
% - also makes sure that previous results are not deleted
%

opt = setOptions('MoAE-fmriprep', '01');

opt.query.space = opt.space;

opt.dir.input = opt.dir.fmriprep;

opt.versbosity = 0;

bidsCopyInputFolder(opt, 'unzip', true);

opt.model.file = fullfile(getMoaeDir(), ...
'models', ...
'model-MoAE_smdl.json');

opt.model.bm = BidsModel('file', opt.model.file);
opt.model.bm.Input.space = opt.space;

opt.glm.roibased.do = true;
opt.dryRun = false;
opt.fwhm.func = 0;

bidsFFX('specify', opt);

% rmdir(fullfile(pwd, 'options'), 's');

opt.dir.roi = fullfile(opt.dir.derivatives, 'bidspm-roi');

opt.roi.atlas = 'wang';
opt.roi.name = {'V1v', 'V1d'};
opt.roi.space = opt.space;

opt.bidsFilterFile.roi.space = 'MNI';

bidsCreateROI(opt);

opt.roi.name = {'.*V1v'};

bidsRoiBasedGLM(opt);

opt.roi.name = {'.*V1d'};

bidsRoiBasedGLM(opt);

timecourseFiles = spm_select('FPListRec', opt.dir.stats, '^.*timecourse.tsv$');

assertEqual(size(timecourseFiles, 1), 4);

delete('skipped_roi_*.tsv');

end
11 changes: 11 additions & 0 deletions tests/utils/setOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
opt.results(1).name = 'listening';
opt.results(2).name = 'listening_inf_baseline';

elseif strcmp(task, 'MoAE-fmriprep')

task = {'auditory'};

opt.space = {'MNI152NLin6Asym'};

opt.dir.raw = fullfile(getMoaeDir(), 'inputs', 'raw');
opt.dir.fmriprep = fullfile(getMoaeDir(), 'inputs', 'fmriprep');
opt.dir.derivatives = fullfile(getMoaeDir(), 'outputs', 'derivatives');
opt.dir.stats = fullfile(opt.dir.derivatives, 'bidspm-stats');

elseif strcmp(task, 'MoAE-preproc')

task = {'auditory'};
Expand Down