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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* [FIX] Fix vismotion demo (#1070) @Remi-Gau
* [FIX] Exclude from GLM specification events with onsets longer than the run duration (#1060) @Remi-Gau
* [FIX] remove dummies from preproc dataset and not raw dataset when using CLI (#1057) @Remi-Gau
* [FIX] skip smoothing when running bidspm prepoc in dryRun (#1054) @Remi-Gau
Expand Down
4 changes: 2 additions & 2 deletions demos/vismotion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ all submodules.
datalad install \
-d . \
-s https://github.com/cpp-lln-lab/bidspm.git \
--branch dev \
-r \
code/bidspm
```
Expand All @@ -44,7 +43,7 @@ initialize them manually, and update your dataset with that update

```bash
cd code/bidspm
git checkout dev
git checkout main
git submodule update --init --recursive && git submodule update --recursive
cd ..
datalad save -m 'update bidspm submodules'
Expand All @@ -65,6 +64,7 @@ This will install the data:
datalad install -d . \
-s git@gin.g-node.org:/cpp-lln-lab/Trento_VisMotionLocalizer_MR_raw.git \
--recursive \
--jobs 12 \
inputs/raw
```

Expand Down
9 changes: 6 additions & 3 deletions demos/vismotion/step_1_preprocess.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
clear;
clc;

addpath(fullfile(pwd, '..', '..'));
this_dir = fileparts(mfilename('fullpath'));
bidspm_dir = fullfile(this_dir, '..', '..');
addpath(bidspm_dir);
bidspm();

this_dir = fileparts(mfilename('fullpath'));
root_dir = fullfile(this_dir, '..', '..', '..', '..');
root_dir = fullfile(returnHomeDir(), 'visual_motion_localiser');

bids_dir = fullfile(root_dir, 'inputs', 'raw');
output_dir = fullfile(root_dir, 'outputs', 'derivatives');

mkdir(output_dir);

bidspm(bids_dir, output_dir, 'subject', ...
'action', 'preprocess', ...
'task', {'visMotion'}, ...
Expand Down
16 changes: 9 additions & 7 deletions demos/vismotion/step_2_stats.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@
clear;
clc;

addpath(fullfile(pwd, '..', '..'));
this_dir = fileparts(mfilename('fullpath'));
bidspm_dir = fullfile(this_dir, '..', '..');
addpath(bidspm_dir);
bidspm();

this_dir = fileparts(mfilename('fullpath'));
root_dir = fullfile(returnHomeDir(), 'visual_motion_localiser');

model_file = fullfile(this_dir, 'models', 'model-visMotionLoc_smdl.json');
root_dir = fullfile(this_dir, '..', '..', '..', '..');
bids_dir = fullfile(root_dir, 'inputs', 'raw');
output_dir = fullfile(root_dir, 'outputs', 'derivatives');
preproc_dir = fullfile(root_dir, 'outputs', 'derivatives', 'bidspm-preproc');

%% subject level

bidspm(bids_dir, output_dir, 'subject', ...
'action', 'stats', ...
'preproc_dir', preproc_dir, ...
'model_file', model_file, ...
'options', opt);
'model_file', model_file);

%% dataset level

bidspm(bids_dir, output_dir, 'dataset', ...
'action', 'stats', ...
'preproc_dir', preproc_dir, ...
'model_file', model_file, ...
'options', opt);
'model_file', model_file);
85 changes: 53 additions & 32 deletions demos/vismotion/vismotion_demo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# fail whenever something is fishy, use -x to get verbose logfiles
set -e -u
set -e -u -x

# IMPORTANT
#
Expand All @@ -10,52 +10,73 @@ set -e -u
#
# What I used (see the line below) is very likely not where MATLAB lives on your computer
#
# /usr/local/MATLAB/R2017a/bin/matlab
# /usr/local/MATLAB/R2018a/bin/matlab

# create dataset in the home dir
datalad create -c yoda ~/visual_motion_localiser
cd ~/visual_motion_localiser
yoda_dir=~/visual_motion_localiser

# get bidspm code from the dev branch
source="https://github.com/cpp-lln-lab/bidspm.git"
# create a new dataset if it doesn't exist
if [ ! -d ${yoda_dir} ]; then

# for debugging uncomment the following lines
# root_directory="${PWD}/../.."
# source=${root_directory}
# create dataset in the home dir
datalad create -c yoda ${yoda_dir}
cd ${yoda_dir}

datalad install \
-d . \
--source ${source} \
--branch dev \
--recursive \
code/bidspm
# get data
datalad install -d ${yoda_dir} \
--source git@gin.g-node.org:/cpp-lln-lab/Toronto_VisMotionLocalizer_MR_raw.git \
--get-data \
--jobs 12 \
inputs/raw

# TODO: implement via bidspm bids app CLI only
# cd code/bidspm
# pip install .
# cd ../..
datalad create -d ${yoda_dir} outputs/derivatives/bidspm-preproc
datalad create -d ${yoda_dir} outputs/derivatives/bidspm-stats

# get data
datalad install -d . \
--source git@gin.g-node.org:/cpp-lln-lab/Toronto_VisMotionLocalizer_MR_raw.git \
--get-data \
inputs/raw
fi

datalad create -d . outputs/derivatives/bidspm-preproc
datalad create -d . outputs/derivatives/bidspm-stats
# install bidspm if it doesn't exist
if [ ! -d "${yoda_dir}/code/bidspm" ]; then

cd code/bidspm/demos/vismotion
echo "installing bidspm in ${yoda_dir}/code/bidspm"

# get bidspm code
source="https://github.com/cpp-lln-lab/bidspm.git"

# for debugging uncomment the following lines

# # directory of this script
# script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# root_directory="${script_directory}/../.."
# # absolute path of root directory
# root_directory="$(readlink -f ${root_directory})"
# source=${root_directory}

echo "from ${source}"

datalad install \
-d ${yoda_dir} \
--source ${source} \
--recursive \
${yoda_dir}/code/bidspm

# TODO: implement via bidspm bids app CLI only
# cd code/bidspm
# pip install .
# cd ../..

fi

cd ${yoda_dir}/code/bidspm/demos/vismotion

# FIX ME
/usr/local/MATLAB/R2017a/bin/matlab \
/usr/local/MATLAB/R2018a/bin/matlab \
-nodisplay -nosplash -nodesktop \
-r "run('step_1_preprocess.m');exit;"

datalad save -d ../../../.. -m 'preprocessing done' --recursive
datalad save -d ${yoda_dir} -m 'preprocessing done' --recursive

# FIX ME
/usr/local/MATLAB/R2017a/bin/matlab \
/usr/local/MATLAB/R2018a/bin/matlab \
-nodisplay -nosplash -nodesktop \
-r "run('step_2_stats.m');exit;"

datalad save -d ../../../.. -m 'stats done' --recursive
datalad save -d ${yoda_dir} -m 'stats done' --recursive
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"sphinxarg.ext",
]
matlab_src_dir = os.path.dirname(os.path.abspath("../../src"))
matlab_short_links = True
matlab_auto_link = "basic"
primary_domain = "mat"

# Add any paths that contain templates here, relative to this directory.
Expand Down
3 changes: 1 addition & 2 deletions src/IO/convertRealignParamToTsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
%
% :type rmInput: logical
% :param rmInput: Optional. Default to ``false``.
Expand Down
2 changes: 1 addition & 1 deletion src/IO/createDerivativeDir.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function createDerivativeDir(opt)
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%

% (C) Copyright 2019 bidspm developers
Expand Down
2 changes: 1 addition & 1 deletion src/IO/getData.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
% :param bidsDir: the directory where the data is ; default is :
% ``fullfile(opt.dataDir, '..', 'derivatives', 'bidspm')``
Expand Down
2 changes: 1 addition & 1 deletion src/IO/saveAndRunWorkflow.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
% :type opt: structure
%
% :param subLabel: subject label
Expand Down
2 changes: 1 addition & 1 deletion src/IO/saveOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function saveOptions(opt)
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%

% (C) Copyright 2020 bidspm developers
Expand Down
2 changes: 1 addition & 1 deletion src/QA/computeDesignEfficiency.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
% :type tsvFile: char
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
%
Expand Down
2 changes: 1 addition & 1 deletion src/QA/mriqcQA.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function mriqcQA(opt, suffix)
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
% EXAMPLE::
%
Expand Down
5 changes: 2 additions & 3 deletions src/QA/plotRoiTimeCourse.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
%
% plotRoiTimeCourse(tsvFile, verbose, 'colors', colors, 'roiName', roiName)
%
% :param tsvFile: obligatory argument.
% Content of TSV is organized in a "BIDS" way.
% :param tsvFile: Content of TSV is organized in a "BIDS" way.
% Must be ``(t + 1) X c`` with t = time points and c = conditions.
% The + 1 for the row dimension is because of the headers
% giving the name of the condition.
Expand All @@ -25,7 +24,7 @@
% :type roiName: char
%
%
% See also: bidsRoiBasedGLM(varargin)
% See also: bidsRoiBasedGLM
%

% (C) Copyright 2022 bidspm developers
Expand Down
10 changes: 6 additions & 4 deletions src/QA/realignQA.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
function [confoundsTsv, figureHandle] = realignQA(varargin)
%
% implement different quality control fMRI realigned
% Implement different quality control fMRI realigned.
%
% [confoundsTsv, figureHandle] = realignQA(boldFile, motionFile, ...
% 'radius', 50, ...
% 'visible', 'on')
% USAGE::
%
% [confoundsTsv, figureHandle] = realignQA(boldFile, motionFile, ...
% 'radius', 50, ...
% 'visible', 'on')
%
%
% Adapted from Cyril Pernet's spmup
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchCoregistration.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
% :param ref: Reference image
% :type ref: char
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchCoregistrationFmap.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% See also: bids.layout, getData.
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
% :param subLabel:
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchCoregistrationFuncToAnat.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
% See also: bids.layout, getData
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
% :param subLabel: subject label
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchCreateVDMs.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% See also: bids.layout, getData.
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
% :param subLabel: subject label
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchGenerateT1map.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% :type BIDS: structure
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
% :param subLabel: subject label
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchNormalizationSpatialPrepro.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
% :param voxDim:
% :type opt: array
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchRealign.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
% See also: bids.layout, getData.
%
% :param opt: Options chosen for the analysis.
% See also: ``checkOptions()`` and ``loadAndCheckOptions()``.
% See checkOptions.
% :type opt: structure
%
% :param subLabel: subject label
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchRenameSegmentParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
%
% :returns: - :matlabbatch: (cell) The matlabbatch ready to run the spm job
Expand Down
2 changes: 1 addition & 1 deletion src/batches/preproc/setBatchReslice.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
%
% :type opt: structure
% :param opt: Options chosen for the analysis.
% See also: checkOptions
% See checkOptions.
%
% :param referenceImg: Reference image (only one image)
% :type referenceImg: char or cellstring
Expand Down
Loading