Skip to content

Commit

Permalink
Merge pull request #15 from bids-apps/test_latest
Browse files Browse the repository at this point in the history
[MAINT] run latest image in CI
  • Loading branch information
Remi-Gau authored May 22, 2023
2 parents 9508e9e + 5f07e65 commit 924e78e
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 17 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: test latest image

on:
push:
branches: ['*']
schedule:
- cron: 0 0 1 * *
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

test_latest_image:

strategy:
matrix:
dataset: ['1', '2']
fail-fast: false

runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y tree
- name: pull docker image
run: docker pull bids/dparsf:latest

- name: print help and version
run: |
docker run -t --rm --read-only \
bids/dparsf:latest --help
docker run -t --rm --read-only \
bids/dparsf:latest -v
- name: get data
run: |
wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/utils/get_data_from_osf.sh
bash get_data_from_osf.sh ds114_test${{ matrix.dataset }}
- name: prepare output dir
run: |
mkdir -p ${HOME}/outputs${{ matrix.dataset }}
- name: participant 01
run: |
docker run -t --rm \
-v ${HOME}/data/ds114_test${{ matrix.dataset }}:/bids_dataset \
-v ${HOME}/outputs${{ matrix.dataset }}:/outputs \
bids/dparsf:latest \
/bids_dataset /outputs participant \
--participant_label 01
- name: participant 02
run: |
docker run -t --rm \
-v ${HOME}/data/ds114_test${{ matrix.dataset }}:/bids_dataset \
-v ${HOME}/outputs${{ matrix.dataset }}:/outputs \
bids/dparsf:latest \
/bids_dataset /outputs participant \
--participant_label 02
- name: check output
run: tree ${HOME}/outputs${{ matrix.dataset }}
117 changes: 100 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,119 @@

This is a docker version of DPARSF V4.3, working for BIDS data structure.

1. Prepare your data in BIDS structure, e.g., https://github.com/INCF/BIDS-examples/tree/master/ds003. Please reserve the TR information within the NIfTI header. Or you have to define TR information in Config_DPARSF.m with --config option.
1. Prepare your data in BIDS structure, e.g., https://github.com/INCF/BIDS-examples/tree/master/ds003.
Please reserve the TR information within the NIfTI header.
Or you have to define TR information in Config_DPARSF.m with --config option.

2. Build the container:

```bash
sudo docker build -t dparsfdocker .
```

3. Process your data:
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant
You can also process a subset of subjects. (As DPARSF will parallel processing the participants automatically, and DPARSF use DARTEL to generate a GROUP TEMPLATE for spatial normalization, it's not recommended that you process only 1 subject at at time).
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant --participant_label 01 02 04 05 07 09 10

4. If you want to customize your processing, please setup a .m file (Config_DPARSF.m is an example) according to the instructions at: http://rfmri.org/content/configurations-dparsfarun. Then use --config to specify the path. E.g.,
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant --participant_label 01 02 04 05 07 09 10 --config /inputs/Config_DPARSF.m
```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant
```

You can also process a subset of subjects.
(As DPARSF will parallel processing the participants automatically,
and DPARSF use DARTEL to generate a GROUP TEMPLATE for spatial normalization,
it's not recommended that you process only 1 subject at at time).

```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant \
--participant_label 01 02 04 05 07 09 10
```

1. If you want to customize your processing, please setup a .m file (Config_DPARSF.m is an example)
according to the instructions at: http://rfmri.org/content/configurations-dparsfarun.
Then use --config to specify the path.

```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant \
--participant_label 01 02 04 05 07 09 10 \
--config /inputs/Config_DPARSF.m
```

2. Advanced Usage: if you want to parallel computing at a higher level
for all the processing except for DARTEL create template
(which should be based on all the subjects),
you can use the Config templates as (PLEASE REMEMBER TO SET UP THE CORRECT TR in the Config!!!):

5. Advanced Usage: if you want to parallel computing at a higher level for all the processing except for DARTEL create template (which should be based on all the subjects), you can use the Config templates as (PLEASE REMEMBER TO SET UP THE CORRECT TR in the Config!!!):
(1) First run all the processing before DARTEL create template.
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs particiapant_pre --participant_label 01 --config /inputs/Config_DPARSF_Step1.m
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs particiapant_pre --participant_label 02 --config /inputs/Config_DPARSF_Step1.m
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs particiapant_pre --participant_label 03 --config /inputs/Config_DPARSF_Step1.m

```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs particiapant_pre \
--participant_label 01 \
--config /inputs/Config_DPARSF_Step1.m
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs particiapant_pre \
--participant_label 02 \
--config /inputs/Config_DPARSF_Step1.m
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs particiapant_pre \
--participant_label 03 \
--config /inputs/Config_DPARSF_Step1.m
```

(2) Then run DARTEL create template at the group level.
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs group_dartel --participant_label 01 02 03 --config /inputs/Config_DPARSF_Step2.m
(3) Finally run all the processing after DARTEL template created.
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant_post --participant_label 01 --config /inputs/Config_DPARSF_Step3.m
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant_post --participant_label 02 --config /inputs/Config_DPARSF_Step3.m
sudo docker run -i --rm -v /data/MyDataBIDS:/inputs:ro -v /data/DPARSFResults:/outputs dparsfdocker /inputs /outputs participant_post --participant_label 03 --config /inputs/Config_DPARSF_Step3.m

```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs group_dartel \
--participant_label 01 02 03 \
--config /inputs/Config_DPARSF_Step2.m
```

(3) Finally run all the processing after DARTEL template created.

```bash
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant_post \
--participant_label 01 \
--config /inputs/Config_DPARSF_Step3.m
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant_post \
--participant_label 02 \
--config /inputs/Config_DPARSF_Step3.m
sudo docker run -i --rm \
-v /data/MyDataBIDS:/inputs:ro \
-v /data/DPARSFResults:/outputs \
dparsfdocker /inputs /outputs participant_post \
--participant_label 03 \
--config /inputs/Config_DPARSF_Step3.m
```

Please report any issues to http://rfmri.org/DPABIDiscussion.
Please Cite:
Yan, C.G., Zang, Y.F., 2010. DPARSF: A MATLAB Toolbox for "Pipeline" Data Analysis of Resting-State fMRI. Front Syst Neurosci 4, 13.
Yan, C.G., Wang, X.D., Zuo, X.N., Zang, Y.F., 2016. DPABI: Data Processing & Analysis for (Resting-State) Brain Imaging. Neuroinformatics 14, 339-351.

- Yan, C.G., Zang, Y.F., 2010. DPARSF: A MATLAB Toolbox for "Pipeline"
Data Analysis of Resting-State fMRI. Front Syst Neurosci 4, 13.
- Yan, C.G., Wang, X.D., Zuo, X.N., Zang, Y.F., 2016.
DPABI: Data Processing & Analysis for (Resting-State) Brain Imaging. Neuroinformatics 14, 339-351.

**NOTE: DPARSF docker version is based on DPARSF Stand-Alone version (http://rfmri.org/DPABI_Stand-Alone), users SHOULD joint the R-fMRI Maps Project (http://rfmri.org/maps) if the docker or OpenNeuro version is used! Users are assumed have agreed with the terms in the user agreement if using these two versions.**

0 comments on commit 924e78e

Please sign in to comment.