Skip to content

Commit 25da066

Browse files
authored
[FIX] fix demo vismotion (#1070)
* [DATALAD] Recorded changes * [DATALAD] Added subdataset * [DATALAD] Recorded changes * [DATALAD] Recorded changes * [DATALAD] Recorded changes * [DATALAD] Recorded changes * update changelog
1 parent 3d6e599 commit 25da066

File tree

108 files changed

+199
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+199
-171
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5757

5858
### Fixed
5959

60+
* [FIX] Fix vismotion demo (#1070) @Remi-Gau
6061
* [FIX] Exclude from GLM specification events with onsets longer than the run duration (#1060) @Remi-Gau
6162
* [FIX] remove dummies from preproc dataset and not raw dataset when using CLI (#1057) @Remi-Gau
6263
* [FIX] skip smoothing when running bidspm prepoc in dryRun (#1054) @Remi-Gau

demos/vismotion/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ all submodules.
3434
datalad install \
3535
-d . \
3636
-s https://github.com/cpp-lln-lab/bidspm.git \
37-
--branch dev \
3837
-r \
3938
code/bidspm
4039
```
@@ -44,7 +43,7 @@ initialize them manually, and update your dataset with that update
4443

4544
```bash
4645
cd code/bidspm
47-
git checkout dev
46+
git checkout main
4847
git submodule update --init --recursive && git submodule update --recursive
4948
cd ..
5049
datalad save -m 'update bidspm submodules'
@@ -65,6 +64,7 @@ This will install the data:
6564
datalad install -d . \
6665
-s [email protected]:/cpp-lln-lab/Trento_VisMotionLocalizer_MR_raw.git \
6766
--recursive \
67+
--jobs 12 \
6868
inputs/raw
6969
```
7070

demos/vismotion/step_1_preprocess.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
clear;
44
clc;
55

6-
addpath(fullfile(pwd, '..', '..'));
6+
this_dir = fileparts(mfilename('fullpath'));
7+
bidspm_dir = fullfile(this_dir, '..', '..');
8+
addpath(bidspm_dir);
79
bidspm();
810

9-
this_dir = fileparts(mfilename('fullpath'));
10-
root_dir = fullfile(this_dir, '..', '..', '..', '..');
11+
root_dir = fullfile(returnHomeDir(), 'visual_motion_localiser');
1112

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

16+
mkdir(output_dir);
17+
1518
bidspm(bids_dir, output_dir, 'subject', ...
1619
'action', 'preprocess', ...
1720
'task', {'visMotion'}, ...

demos/vismotion/step_2_stats.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,28 @@
33
clear;
44
clc;
55

6-
addpath(fullfile(pwd, '..', '..'));
6+
this_dir = fileparts(mfilename('fullpath'));
7+
bidspm_dir = fullfile(this_dir, '..', '..');
8+
addpath(bidspm_dir);
79
bidspm();
810

9-
this_dir = fileparts(mfilename('fullpath'));
11+
root_dir = fullfile(returnHomeDir(), 'visual_motion_localiser');
12+
1013
model_file = fullfile(this_dir, 'models', 'model-visMotionLoc_smdl.json');
11-
root_dir = fullfile(this_dir, '..', '..', '..', '..');
1214
bids_dir = fullfile(root_dir, 'inputs', 'raw');
1315
output_dir = fullfile(root_dir, 'outputs', 'derivatives');
1416
preproc_dir = fullfile(root_dir, 'outputs', 'derivatives', 'bidspm-preproc');
1517

18+
%% subject level
19+
1620
bidspm(bids_dir, output_dir, 'subject', ...
1721
'action', 'stats', ...
1822
'preproc_dir', preproc_dir, ...
19-
'model_file', model_file, ...
20-
'options', opt);
23+
'model_file', model_file);
2124

2225
%% dataset level
2326

2427
bidspm(bids_dir, output_dir, 'dataset', ...
2528
'action', 'stats', ...
2629
'preproc_dir', preproc_dir, ...
27-
'model_file', model_file, ...
28-
'options', opt);
30+
'model_file', model_file);

demos/vismotion/vismotion_demo.sh

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

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

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

15-
# create dataset in the home dir
16-
datalad create -c yoda ~/visual_motion_localiser
17-
cd ~/visual_motion_localiser
15+
yoda_dir=~/visual_motion_localiser
1816

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

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

26-
datalad install \
27-
-d . \
28-
--source ${source} \
29-
--branch dev \
30-
--recursive \
31-
code/bidspm
24+
# get data
25+
datalad install -d ${yoda_dir} \
26+
--source [email protected]:/cpp-lln-lab/Toronto_VisMotionLocalizer_MR_raw.git \
27+
--get-data \
28+
--jobs 12 \
29+
inputs/raw
3230

33-
# TODO: implement via bidspm bids app CLI only
34-
# cd code/bidspm
35-
# pip install .
36-
# cd ../..
31+
datalad create -d ${yoda_dir} outputs/derivatives/bidspm-preproc
32+
datalad create -d ${yoda_dir} outputs/derivatives/bidspm-stats
3733

38-
# get data
39-
datalad install -d . \
40-
--source [email protected]:/cpp-lln-lab/Toronto_VisMotionLocalizer_MR_raw.git \
41-
--get-data \
42-
inputs/raw
34+
fi
4335

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

47-
cd code/bidspm/demos/vismotion
39+
echo "installing bidspm in ${yoda_dir}/code/bidspm"
40+
41+
# get bidspm code
42+
source="https://github.com/cpp-lln-lab/bidspm.git"
43+
44+
# for debugging uncomment the following lines
45+
46+
# # directory of this script
47+
# script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
48+
# root_directory="${script_directory}/../.."
49+
# # absolute path of root directory
50+
# root_directory="$(readlink -f ${root_directory})"
51+
# source=${root_directory}
52+
53+
echo "from ${source}"
54+
55+
datalad install \
56+
-d ${yoda_dir} \
57+
--source ${source} \
58+
--recursive \
59+
${yoda_dir}/code/bidspm
60+
61+
# TODO: implement via bidspm bids app CLI only
62+
# cd code/bidspm
63+
# pip install .
64+
# cd ../..
65+
66+
fi
67+
68+
cd ${yoda_dir}/code/bidspm/demos/vismotion
4869

4970
# FIX ME
50-
/usr/local/MATLAB/R2017a/bin/matlab \
71+
/usr/local/MATLAB/R2018a/bin/matlab \
5172
-nodisplay -nosplash -nodesktop \
5273
-r "run('step_1_preprocess.m');exit;"
5374

54-
datalad save -d ../../../.. -m 'preprocessing done' --recursive
75+
datalad save -d ${yoda_dir} -m 'preprocessing done' --recursive
5576

5677
# FIX ME
57-
/usr/local/MATLAB/R2017a/bin/matlab \
78+
/usr/local/MATLAB/R2018a/bin/matlab \
5879
-nodisplay -nosplash -nodesktop \
5980
-r "run('step_2_stats.m');exit;"
6081

61-
datalad save -d ../../../.. -m 'stats done' --recursive
82+
datalad save -d ${yoda_dir} -m 'stats done' --recursive

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"sphinxarg.ext",
4444
]
4545
matlab_src_dir = os.path.dirname(os.path.abspath("../../src"))
46+
matlab_short_links = True
47+
matlab_auto_link = "basic"
4648
primary_domain = "mat"
4749

4850
# Add any paths that contain templates here, relative to this directory.

src/IO/convertRealignParamToTsv.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
%
1313
% :type opt: structure
1414
% :param opt: Options chosen for the analysis.
15-
% See also: checkOptions
16-
% ``checkOptions()`` and ``loadAndCheckOptions()``.
15+
% See checkOptions.
1716
%
1817
% :type rmInput: logical
1918
% :param rmInput: Optional. Default to ``false``.

src/IO/createDerivativeDir.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function createDerivativeDir(opt)
88
%
99
% :type opt: structure
1010
% :param opt: Options chosen for the analysis.
11-
% See also: checkOptions
11+
% See checkOptions.
1212
%
1313

1414
% (C) Copyright 2019 bidspm developers

src/IO/getData.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
%
99
% :type opt: structure
1010
% :param opt: Options chosen for the analysis.
11-
% See also: checkOptions
11+
% See checkOptions.
1212
%
1313
% :param bidsDir: the directory where the data is ; default is :
1414
% ``fullfile(opt.dataDir, '..', 'derivatives', 'bidspm')``

src/IO/saveAndRunWorkflow.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
%
1515
% :type opt: structure
1616
% :param opt: Options chosen for the analysis.
17-
% See also: checkOptions
17+
% See checkOptions.
1818
% :type opt: structure
1919
%
2020
% :param subLabel: subject label

0 commit comments

Comments
 (0)