Skip to content

Commit

Permalink
[MAINT] rename test data dir (#988)
Browse files Browse the repository at this point in the history
* fix submodules

* rename test data dir

* readd ignored folders
  • Loading branch information
Remi-Gau authored Apr 21, 2023
1 parent 7912041 commit 3085bec
Show file tree
Hide file tree
Showing 303 changed files with 405 additions and 2,602 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ onsets*_events.mat
## from running tests in root dir
*/group/*
models/*
derivatives/models
derivatives/options

###############################################################################
# python
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = lib/bids-matlab
url = https://github.com/bids-standard/bids-matlab.git
branch = dev
[submodule "lib/spmup"]
path = lib/spmup
url = https://github.com/CPernet/spmup.git
branch = master
[submodule "lib/CPP_ROI"]
path = lib/CPP_ROI
url = https://github.com/cpp-lln-lab/CPP_ROI.git
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/cpp-lln-lab/bidspm/main.svg)](https://results.pre-commit.ci/latest/github/cpp-lln-lab/bidspm/main)
[![miss hit](https://img.shields.io/badge/code%20style-miss_hit-000000.svg)](https://misshit.org/)
[![Documentation Status: main](https://readthedocs.org/projects/bidspm/badge/?version=stable)](https://bidspm.readthedocs.io/en/stable/?badge=stable)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/cpp-lln-lab/bidspm/dev)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/cpp-lln-lab/bidspm/main)
[![tests](https://github.com/cpp-lln-lab/bidspm/actions/workflows/tests.yml/badge.svg)](https://github.com/cpp-lln-lab/bidspm/actions/workflows/tests.yml)
[![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)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/bids_stats_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,12 @@ their datasets.

Several of the [demos](demos) have their own model and you can find several
"dummy" models (without corresponding data) used for testing
[in this folder](https://github.com/cpp-lln-lab/bidspm/tree/main/tests/dummyData/models).
[in this folder](https://github.com/cpp-lln-lab/bidspm/tree/main/tests/data/models).

<!-- markdown-link-check-enable -->

An example of JSON file could look something like that:

```{literalinclude} ../../tests/dummyData/models/model-vislocalizer_smdl.json
```{literalinclude} ../../tests/data/models/model-vislocalizer_smdl.json
:language: json
```
22 changes: 12 additions & 10 deletions tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ tmp

*/*.json

dummyData/derivatives/bidspm-*/jobs
dummyData/derivatives/bidspm-preproc/sub*
data/derivatives/bidspm-*/jobs
data/derivatives/bidspm-preproc/sub*

dummyData/derivatives/bidspm-preproc/desc-skullstripped.json
data/derivatives/bidspm-preproc/desc-skullstripped.json

dummyData/derivatives/bidspm-stats/sub*
dummyData/derivatives/bidspm-stats/derivatives
dummyData/derivatives/bidspm-stats/README
dummyData/derivatives/bidspm-stats/CHANGES
dummyData/derivatives/bidspm-stats/*.json
data/derivatives/bidspm-stats/sub*
data/derivatives/bidspm-stats/derivatives
data/derivatives/bidspm-stats/README
data/derivatives/bidspm-stats/CHANGES
data/derivatives/bidspm-stats/*.json
data/derivatives/bidspm-stats/LICENSE
data/derivatives/bidspm-stats/.gitignore

dummyData/bidspm-raw/sub*
data/bidspm-raw/sub*

dummyData/derivatives/bidspm-roi
data/derivatives/bidspm-roi

test_reports/*.md
15 changes: 8 additions & 7 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ clean: clean_local
mkdir bids-examples && touch bids-examples/.gitkeep

clean_local:
rm -rf dummyData/derivatives/bidspm-preproc/sub-*
rm -rf dummyData/derivatives/bidspm-stats/sub-*
rm -rf dummyData/bidspm-raw/sub-*
rm -rf dummyData/derivatives/bidspm-stats/group
rm -rf dummyData/derivatives/bidspm-*/jobs
rm -rf data/derivatives/bidspm-preproc/sub-*
rm -rf data/derivatives/bidspm-stats/sub-*
rm -rf data/bidspm-raw/sub-*
rm -rf data/derivatives/bidspm-stats/group
rm -rf data/derivatives/bidspm-*/jobs

data: clean
sh createDummyDataSet.sh
rm -rf bids-examples/
git clone https://github.com/bids-standard/bids-examples.git --depth 1
cp bids-examples/synthetic/dataset_description.json bids-examples/synthetic/derivatives/fmriprep
touch bids-examples/.gitkeep
wget -O moae_spm12.zip https://files.de-1.osf.io/v1/resources/3vufp/providers/osfstorage/62ab741be6f3ec09a7e48d13/?zip=
unzip -d ./dummyData/MoAE/derivatives/spm12 moae_spm12.zip
wget --quiet -O moae_spm12.zip https://files.de-1.osf.io/v1/resources/3vufp/providers/osfstorage/62ab741be6f3ec09a7e48d13/?zip=
mkdir -p data/MoAE/derivatives/spm12
unzip -d ./data/MoAE/derivatives/spm12 moae_spm12.zip

clean_openneuro:
rm -rf openneuro/*
Expand Down
20 changes: 10 additions & 10 deletions tests/createDummyDataSet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

# defines where the BIDS data set will be created
start_dir=$(pwd) # relative to starting directory
raw_dir=${start_dir}/dummyData/bidspm-raw
preproc_dir=${start_dir}/dummyData/derivatives/bidspm-preproc
stats_dir=${start_dir}/dummyData/derivatives/bidspm-stats
roi_dir=${start_dir}/dummyData/derivatives/bidspm-roi
raw_dir=${start_dir}/data/bidspm-raw
preproc_dir=${start_dir}/data/derivatives/bidspm-preproc
stats_dir=${start_dir}/data/derivatives/bidspm-stats
roi_dir=${start_dir}/data/derivatives/bidspm-roi

subject_list='ctrl01 blind01 01'
session_list='01 02'
Expand Down Expand Up @@ -231,8 +231,8 @@ for subject in ${subject_list}; do
for run in $(seq 1 2); do

filename=${this_dir}/rp_${basename}_run-${run}${suffix}.txt
cp dummyData/tsv_files/rp.txt "${filename}"
cp dummyData/tsv_files/rp.tsv ${this_dir}/${basename}_run-${run}_desc-confounds_regressors.tsv
cp data/tsv_files/rp.txt "${filename}"
cp data/tsv_files/rp.tsv ${this_dir}/${basename}_run-${run}_desc-confounds_regressors.tsv

for desc in ${desc_label_list}; do
touch ${this_dir}/${basename}_run-${run}_space-individual_desc-${desc}${suffix}.nii
Expand All @@ -259,8 +259,8 @@ for subject in ${subject_list}; do

### derivatives
filename=${this_dir}/rp_sub-${subject}_ses-${ses}_task-${task_name}${suffix}.txt
cp dummyData/tsv_files/rp.txt "${filename}"
cp dummyData/tsv_files/rp.tsv ${this_dir}/sub-${subject}_ses-${ses}_task-${task_name}_desc-confounds_regressors.tsv
cp data/tsv_files/rp.txt "${filename}"
cp data/tsv_files/rp.tsv ${this_dir}/sub-${subject}_ses-${ses}_task-${task_name}_desc-confounds_regressors.tsv

desc_label_list='preproc smth6'
for desc in ${desc_label_list}; do
Expand Down Expand Up @@ -333,7 +333,7 @@ for subject in ${subject_list}; do
this_dir=${stats_dir}/sub-${subject}/task-${task}_space-IXI549Space_FWHM-6
mkdir -p ${this_dir}

cp dummyData/mat_files/SPM.mat ${this_dir}/SPM.mat
cp data/mat_files/SPM.mat ${this_dir}/SPM.mat

touch ${this_dir}/mask.nii

Expand All @@ -354,7 +354,7 @@ for subject in ${subject_list}; do
this_dir=${stats_dir}/sub-${subject}/task-${task}_space-IXI549Space_FWHM-6_node-globalSignal
mkdir -p ${this_dir}

cp dummyData/mat_files/SPM.mat ${this_dir}/SPM.mat
cp data/mat_files/SPM.mat ${this_dir}/SPM.mat

touch ${this_dir}/mask.nii

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SkullStripped": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"GeneratedBy": {
"name": "bidspm",
"Version": "v3.0.0",
"Branch": "concat",
"Commit": "7de59742",
"Description": "spatial_preprocessing-individual-IXI549Space",
"CodeURL": "https://github.com/cpp-lln-lab/bidspm",
"DOI": "https://doi.org/10.5281/zenodo.3554331"
},
"OS": {
"name": "unix",
"version": "Linux version 5.19.0-40-generic (buildd@lcy02-amd64-047) (x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #41~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 31 16:00:14 UTC 2\n",
"platform": {
"name": "MATLAB",
"version": "9.4.0.813654 (R2018a)"
},
"spmVersion": "SPM12 - 7771"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"GeneratedBy": {
"name": "bidspm",
"Version": "v3.0.0",
"Branch": "concat",
"Commit": "7de59742",
"Description": "spatial_preprocessing-individual",
"CodeURL": "https://github.com/cpp-lln-lab/bidspm",
"DOI": "https://doi.org/10.5281/zenodo.3554331"
},
"OS": {
"name": "unix",
"version": "Linux version 5.19.0-40-generic (buildd@lcy02-amd64-047) (x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #41~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 31 16:00:14 UTC 2\n",
"platform": {
"name": "MATLAB",
"version": "9.4.0.813654 (R2018a)"
},
"spmVersion": "SPM12 - 7771"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
matlabbatch{1}.cfg_basicio.cfg_named_file.name = 'Anatomical';
matlabbatch{1}.cfg_basicio.cfg_named_file.files = {{'/home/remi/github/bidspm/tests/data/MoAE/derivatives/bidspm-preproc/sub-01/anat/sub-01_T1w.nii'}};
matlabbatch{2}.spm.spatial.realignunwarp.eoptions.weight = {''};
matlabbatch{2}.spm.spatial.realignunwarp.uwroptions.uwwhich = [2 1];
matlabbatch{2}.spm.spatial.realignunwarp.data.pmscan = {''};
matlabbatch{2}.spm.spatial.realignunwarp.data.scans = {'/home/remi/github/bidspm/tests/data/MoAE/derivatives/bidspm-preproc/sub-01/func/sub-01_task-auditory_bold.nii'};
matlabbatch{3}.spm.spatial.coreg.estimate.ref(1) = cfg_dep('Named File Selector: Anatomical(1) - Files', substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files', '{}',{1}));
matlabbatch{3}.spm.spatial.coreg.estimate.source(1) = cfg_dep('Realign: Estimate & Reslice/Unwarp: Mean Image', substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','meanuwr'));
matlabbatch{3}.spm.spatial.coreg.estimate.other(1) = cfg_dep('Realign: Estimate & Reslice/Unwarp: Realigned Images (Sess 1)', substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','sess', '()',{1}, '.','uwrfiles'));
matlabbatch{4}.cfg_basicio.var_ops.cfg_save_vars.name = 'sub-01_task-auditory_from-scanner_to-T1w_mode-image_xfm.mat';
matlabbatch{4}.cfg_basicio.var_ops.cfg_save_vars.outdir = {'/home/remi/github/bidspm/tests/data/MoAE/derivatives/bidspm-preproc/sub-01/func'};
matlabbatch{4}.cfg_basicio.var_ops.cfg_save_vars.vars.vname = 'transformationMatrix';
matlabbatch{4}.cfg_basicio.var_ops.cfg_save_vars.vars.vcont(1) = cfg_dep('Coregister: Estimate: Coregistration Matrix', substruct('.','val', '{}',{3}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','M'));
matlabbatch{4}.cfg_basicio.var_ops.cfg_save_vars.saveasstruct = false;
matlabbatch{5}.spm.spatial.preproc.channel.write = [false true];
matlabbatch{5}.spm.spatial.preproc.channel.vols(1) = cfg_dep('Named File Selector: Anatomical(1) - Files', substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files', '{}',{1}));
matlabbatch{5}.spm.spatial.preproc.channel.biasreg = 0.001;
matlabbatch{5}.spm.spatial.preproc.channel.biasfwhm = 60;
matlabbatch{5}.spm.spatial.preproc.tissue(1).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,1'};
matlabbatch{5}.spm.spatial.preproc.tissue(1).ngaus = 1;
matlabbatch{5}.spm.spatial.preproc.tissue(1).native = [1 0];
matlabbatch{5}.spm.spatial.preproc.tissue(1).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(2).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,2'};
matlabbatch{5}.spm.spatial.preproc.tissue(2).ngaus = 1;
matlabbatch{5}.spm.spatial.preproc.tissue(2).native = [1 0];
matlabbatch{5}.spm.spatial.preproc.tissue(2).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(3).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,3'};
matlabbatch{5}.spm.spatial.preproc.tissue(3).ngaus = 2;
matlabbatch{5}.spm.spatial.preproc.tissue(3).native = [1 0];
matlabbatch{5}.spm.spatial.preproc.tissue(3).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(4).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,4'};
matlabbatch{5}.spm.spatial.preproc.tissue(4).ngaus = 3;
matlabbatch{5}.spm.spatial.preproc.tissue(4).native = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(4).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(5).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,5'};
matlabbatch{5}.spm.spatial.preproc.tissue(5).ngaus = 4;
matlabbatch{5}.spm.spatial.preproc.tissue(5).native = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(5).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(6).tpm = {'/home/remi/github/spm12/tpm/TPM.nii,6'};
matlabbatch{5}.spm.spatial.preproc.tissue(6).ngaus = 2;
matlabbatch{5}.spm.spatial.preproc.tissue(6).native = [0 0];
matlabbatch{5}.spm.spatial.preproc.tissue(6).warped = [0 0];
matlabbatch{5}.spm.spatial.preproc.warp.mrf = 1;
matlabbatch{5}.spm.spatial.preproc.warp.cleanup = 1;
matlabbatch{5}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];
matlabbatch{5}.spm.spatial.preproc.warp.affreg = 'mni';
matlabbatch{5}.spm.spatial.preproc.warp.fwhm = 0;
matlabbatch{5}.spm.spatial.preproc.warp.samp = 3;
matlabbatch{5}.spm.spatial.preproc.warp.write = [1 1];
matlabbatch{6}.spm.util.imcalc.input(1) = cfg_dep('Segment: Bias Corrected (1)', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','channel', '()',{1}, '.','biascorr', '()',{':'}));
matlabbatch{6}.spm.util.imcalc.input(2) = cfg_dep('Segment: c1 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{1}, '.','c', '()',{':'}));
matlabbatch{6}.spm.util.imcalc.input(3) = cfg_dep('Segment: c2 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{2}, '.','c', '()',{':'}));
matlabbatch{6}.spm.util.imcalc.input(4) = cfg_dep('Segment: c3 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{3}, '.','c', '()',{':'}));
matlabbatch{6}.spm.util.imcalc.output = 'sub-01_space-individual_desc-skullstripped_T1w.nii';
matlabbatch{6}.spm.util.imcalc.outdir = {'/home/remi/github/bidspm/tests/data/MoAE/derivatives/bidspm-preproc/sub-01/anat'};
matlabbatch{6}.spm.util.imcalc.expression = 'i1.*((i2+i3+i4)>0.750000)';
matlabbatch{6}.spm.util.imcalc.options.dtype = 16;
matlabbatch{7}.spm.util.imcalc.input(1) = cfg_dep('Segment: Bias Corrected (1)', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','channel', '()',{1}, '.','biascorr', '()',{':'}));
matlabbatch{7}.spm.util.imcalc.input(2) = cfg_dep('Segment: c1 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{1}, '.','c', '()',{':'}));
matlabbatch{7}.spm.util.imcalc.input(3) = cfg_dep('Segment: c2 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{2}, '.','c', '()',{':'}));
matlabbatch{7}.spm.util.imcalc.input(4) = cfg_dep('Segment: c3 Images', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','tiss', '()',{3}, '.','c', '()',{':'}));
matlabbatch{7}.spm.util.imcalc.output = 'sub-01_space-individual_desc-brain_mask.nii';
matlabbatch{7}.spm.util.imcalc.outdir = {'/home/remi/github/bidspm/tests/data/MoAE/derivatives/bidspm-preproc/sub-01/anat'};
matlabbatch{7}.spm.util.imcalc.expression = '(i2+i3+i4)>0.750000';
matlabbatch{7}.spm.util.imcalc.options.dtype = 16;
Loading

0 comments on commit 3085bec

Please sign in to comment.