22
33# DSST Defacing Pipeline
44
5+ <<<<<<< HEAD
56The DSST Defacing Pipeline has been developed to make the process of defacing anatomical scans of large datasets,
67visually inspecting for accuracy and fixing scans that fail visual inspection more efficient and straightforward. The
78pipeline _ requires_ the input dataset to be in BIDS format. A conceptual description of the pipeline can
89found [ here] ( #conceptual-design ) .
10+ =======
11+ The DSST Defacing Pipeline has been developed to make the process of defacing anatomical scans of large datasets,
12+ visually inspecting for accuracy and fixing scans that fail visual inspection more efficient and straightforward. The
13+ pipeline _ requires_ the input dataset to be in BIDS format. A conceptual description of the pipeline can
14+ found [ here] ( #conceptual-design ) .
15+
16+ This pipeline is designed and tested to work on the NIH HPC systems. While it's possible to get the pipeline running on
17+ other platforms, please note that it can be error-prone and is not recommended.
18+ > > > > > > > 8dc705ab68bf38be986c6f33b50d80af46af7beb
919
1020## Usage Instructions
1121
@@ -15,6 +25,35 @@ found [here](#conceptual-design).
1525git clone
[email protected] :nih-fmrif/dsst-defacing-pipeline.git
1626```
1727
28+ <<<<<<< HEAD
29+ =======
30+
31+ ### Install required packages
32+
33+ Apart from AFNI and FSL packages, available as HPC modules, users will need the following packages in their working
34+ environment
35+
36+ - VisualQC
37+ - FSLeyes
38+ - Python 3.x
39+
40+ There are many ways to create a virtual environment with the required packages, however, we currently only provide
41+ instructions to create a conda environment. If you don't already have conda installed, please find
42+ instructions [ here] ( https://docs.conda.io/en/latest/miniconda.html ) . Run the following command to create a conda
43+ environment called ` dsstdeface ` using the ` environment.yml ` file from this repo.
44+
45+ ``` bash
46+ conda env create -f environment.yml
47+ ```
48+
49+ Once conda finishes creating the virtual environment, activate ` dsstdeface ` .
50+
51+ ``` bash
52+ conda activate dsstdeface
53+ ```
54+
55+ > > > > > > > 8dc705ab68bf38be986c6f33b50d80af46af7beb
56+
1857### Run ` dsst_defacing_wf.py `
1958
2059To deface anatomical scans in the dataset, run ` dsst_defacing_wf.py ` script.
@@ -42,6 +81,7 @@ optional arguments:
4281The script can be run serially on a BIDS dataset or in parallel at subject/session level. The three methods of running
4382the script have been described below with example commands:
4483
84+ <<<<<<< HEAD
4585For readability of example commands, the following bash variables have defined as follows:
4686
4787``` bash
@@ -51,6 +91,10 @@ OUTPUT_DIR="<path/to/desired/defacing/output/directory>"
5191
5292** NOTE:** In the example commands below, <path/to/BIDS/input/dataset> and <path/to/desired/output/directory> are
5393placeholders for paths to input and output directories respectively.
94+ =======
95+ ** NOTE:** In the example commands below, ` <path/to/BIDS/input/dataset> ` and ` <path/to/desired/output/directory> ` are
96+ placeholders for paths to input and output directories, respectively.
97+ > > > > > > > 8dc705ab68bf38be986c6f33b50d80af46af7beb
5498
5599#### Option 1: Serially
56100
@@ -110,17 +154,20 @@ swarm -f defacing_parallel_session_level.swarm --merge-output --logdir ${OUTPUT_
110154
111155### Visually inspect defaced scans using VisualQC
112156
113- Pre-requisite: Install VisualQC
114- from https://raamana.github.io/visualqc/installation.html#stable-release[ ] ( https://raamana.github.io/visualqc/installation.html#stable-release )
157+ To visually inspect quality of defacing with visualqc, we'll need to:
115158
116- Once VisualQC is installed, please run the following command to open VisualQC deface GUI to start visually inspecting
117- defaced scans:
159+ 1 . Generate 3D renders for every defaced image in the output directory.
118160
119- ``` bash
120- sh < path/to/defacing/output/directory> /visualqc_prep/defacing_qc_cmd
121- ```
161+ ``` bash
162+ python src/generate_renders.py -o < path/to/desired/defacing/output/directory>
163+ ```
164+
165+ 2 . Open TurboVNC through an spersist session. More info [ here] ( https://hpc.nih.gov/docs/nimh.html ) .
166+ 3 . Run the ` vqcdeface ` command from a command-line terminal within a TurboVNC instance
122167
123- Visual QC defacing accuracy gallery https://raamana.github.io/visualqc/gallery_defacing.html
168+ ``` bash
169+ sh < path/to/defacing/output/directory> /QC_prep/defacing_qc_cmd
170+ ```
124171
125172## Terminology
126173
0 commit comments