Skip to content

Commit a5221c0

Browse files
committed
README update
1 parent 05a8050 commit a5221c0

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ optional arguments:
3333

3434
The script can be run serially on a BIDS dataset or in parallel at subject/session level. The three methods of running the script have been described below with example commands:
3535

36+
**NOTE:** In the example commands below, <path/to/BIDS/input/dataset> and <path/to/desired/output/directory> are placeholders for paths to input and output directories respectively.
37+
3638
#### Option 1: Serially
3739
If you have a small dataset with less than 10 subjects, then it might be easiest to run the defacing algorithm serially.
3840

@@ -44,35 +46,38 @@ python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/o
4446
If you have dataset with over 10 subjects, then it might be more practical to run the pipeline in parallel for every subject in the dataset using the `-p/--participant-id` option as follows:
4547

4648
```bash
47-
python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/output/directory> -p sub-<index>
49+
python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/defacing/output/directory> -p sub-<index>
4850
```
4951

5052
a. Assuming these scripts are run on the NIH HPC system, the first step would be to create a `swarm` file:
5153

5254
```bash
5355
for i in `ls -d <path/to/BIDS/input/dataset>*`; do \
5456
SUBJ=$(echo $i | sed 's|<path/to/BIDS/input/dataset>||g' ); \
55-
echo "python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/output/directory> -s $SUBJ"; \
57+
echo "python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/defacing/output/directory> -s $SUBJ"; \
5658
done > defacing_parallel_subject_level.swarm
5759
```
5860
Purpose: Loop through the dataset and find all subject directories to construct `dsst_defacing_wf.py` command with `-p/--participant-id` option.
5961

6062
b. Run the swarm file with following command to start a swarm job
6163
```bash
62-
swarm -f .defacing_parallel_subject_level.swarm --module afni,fsl --merge-output --logdir swarm_log
64+
swarm -f defacing_parallel_subject_level.swarm --module afni,fsl --merge-output --logdir swarm_log
6365
```
6466

6567
#### Option 3: In parallel at session level
6668
If the input dataset has multiple sessions per subject, then run the pipeline on every session in the dataset parallelly. Similar to Option 2, the following commands loop through the dataset to find subject and session IDs to create a `swarm` file to be run on NIH HPC systems.
6769

6870
```bash
69-
for i in `ls -d <path/to/BIDS/input/dataset>*`; do \
70-
SUBJ=$(echo $i | sed 's|<path/to/BIDS/input/dataset>||g' ); \
71-
echo "python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/output/directory> -s $SUBJ"; \
72-
done > defacing_parallel_subject_level.swarm
71+
for i in `ls -d <path/to/BIDS/input/dataset>*`; do
72+
SUBJ=$(echo $i | sed "s|<path/to/BIDS/input/dataset>/||g" );
73+
for j in `ls -d <path/to/BIDS/input/dataset>/${SUBJ}/*`; do
74+
SESS=$(echo $j | sed "s|<path/to/BIDS/input/dataset>/${SUBJ}/||g" )
75+
echo "python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/defacing/output/directory> -p ${SUBJ} -s ${SESS}";
76+
done;
77+
done > defacing_parallel_session_level.swarm
7378
```
7479
```bash
75-
swarm -f .defacing_parallel_subject_level.swarm --module afni,fsl --merge-output --logdir swarm_log
80+
swarm -f defacing_parallel_subject_level.swarm --module afni,fsl --merge-output --logdir swarm_log
7681
```
7782

7883
### Visually inspect defaced scans using VisualQC
@@ -81,7 +86,7 @@ Pre-requisite: Install VisualQC from https://raamana.github.io/visualqc/installa
8186

8287
Once VisualQC is installed, please run the following command to open VisualQC deface GUI to start visually inspecting defaced scans:
8388
```bash
84-
sh <path/to/desired/output/directory>/visualqc_prep/defacing_qc_cmd
89+
sh <path/to/defacing/output/directory>/visualqc_prep/defacing_qc_cmd
8590
```
8691

8792
Visual QC defacing accuracy gallery https://raamana.github.io/visualqc/gallery_defacing.html

0 commit comments

Comments
 (0)