Skip to content

Commit 8dc705a

Browse files
authored
Update README.md
1 parent 2f18074 commit 8dc705a

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

README.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22

33
# DSST Defacing Pipeline
44

5-
The DSST Defacing Pipeline has been developed to make the process of defacing anatomical scans of large datasets, visually inspecting for accuracy and fixing scans that fail visual inspection more efficient and straightforward. The pipeline _requires_ the input dataset to be in BIDS format. A conceptual description of the pipeline can found [here](#conceptual-design).
5+
The DSST Defacing Pipeline has been developed to make the process of defacing anatomical scans of large datasets, visually inspecting for accuracy and fixing scans that fail visual inspection more efficient and straightforward. The pipeline _requires_ the input dataset to be in BIDS format. A conceptual description of the pipeline can found [here](#conceptual-design).
6+
7+
This pipeline is designed and tested to work on the NIH HPC systems. While it's possible to get the pipeline running on other platforms, please note that it can be error-prone and is not recommended.
68

79
## Usage Instructions
10+
811
### Clone this repository
912
```bash
1013
git clone [email protected]:nih-fmrif/dsst-defacing-pipeline.git
1114
```
15+
### Install required packages
16+
Apart from AFNI and FSL packages, available as HPC modules, users will need the following packages in their working environment
17+
- VisualQC
18+
- FSLeyes
19+
- Python 3.x
20+
21+
There are many ways to create a virtual environment with the required packages, however, we currently only provide instructions to create a conda environment. If you don't already have conda installed, please find instructions [here](https://docs.conda.io/en/latest/miniconda.html). Run the following command to create a conda environment called `dsstdeface` using the `environment.yml` file from this repo.
22+
23+
```bash
24+
conda env create -f environment.yml
25+
```
26+
Once conda finishes creating the virtual environment, activate `dsstdeface`.
27+
28+
```bash
29+
conda activate dsstdeface
30+
```
31+
1232
### Run `dsst_defacing_wf.py`
1333
To deface anatomical scans in the dataset, run `dsst_defacing_wf.py` script.
1434
```
@@ -33,7 +53,7 @@ optional arguments:
3353

3454
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:
3555

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.
56+
**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.
3757

3858
#### Option 1: Serially
3959
If you have a small dataset with less than 10 subjects, then it might be easiest to run the defacing algorithm serially.
@@ -61,7 +81,7 @@ python dsst_defacing_wf.py -i <path/to/BIDS/input/dataset> -o <path/to/desired/d
6181

6282
b. Run the swarm file with following command to start a swarm job
6383
```bash
64-
swarm -f defacing_parallel_subject_level.swarm --module afni,fsl --merge-output --logdir swarm_log
84+
swarm -f defacing_parallel_subject_level.swarm --merge-output --logdir swarm_log
6585
```
6686

6787
#### Option 3: In parallel at session level
@@ -77,20 +97,22 @@ for i in `ls -d <path/to/BIDS/input/dataset>*`; do
7797
done > defacing_parallel_session_level.swarm
7898
```
7999
```bash
80-
swarm -f defacing_parallel_session_level.swarm --module afni,fsl --merge-output --logdir swarm_log
81-
```
82-
83-
### Visually inspect defaced scans using VisualQC
84-
85-
Pre-requisite: Install VisualQC from https://raamana.github.io/visualqc/installation.html#stable-release[](https://raamana.github.io/visualqc/installation.html#stable-release)
86-
87-
Once VisualQC is installed, please run the following command to open VisualQC deface GUI to start visually inspecting defaced scans:
88-
```bash
89-
sh <path/to/defacing/output/directory>/visualqc_prep/defacing_qc_cmd
100+
swarm -f defacing_parallel_session_level.swarm --merge-output --logdir swarm_log
90101
```
91102

92-
Visual QC defacing accuracy gallery https://raamana.github.io/visualqc/gallery_defacing.html
103+
It takes about 25-30 minutes to finish defacing a single session of scans.
93104

105+
### Visually inspect defaced scans using VisualQC
106+
To visually inspect quality of defacing with visualqc, we'll need to:
107+
1. Generate 3D renders for every defaced image in the output directory.
108+
```bash
109+
python src/generate_renders.py -o <path/to/desired/defacing/output/directory>
110+
```
111+
2. Open TurboVNC through an spersist session. More info [here](https://hpc.nih.gov/docs/nimh.html).
112+
3. Run the `vqcdeface` command from a command-line terminal within a TurboVNC instance
113+
```bash
114+
sh <path/to/defacing/output/directory>/QC_prep/defacing_qc_cmd
115+
```
94116

95117
## Terminology
96118
While describing the process, we frequently use the following terms:

0 commit comments

Comments
 (0)