|
a |
|
b/0_preprocessing_single.py |
|
|
1 |
from brats_toolkit.preprocessor import Preprocessor |
|
|
2 |
|
|
|
3 |
# instantiate |
|
|
4 |
prep = Preprocessor() |
|
|
5 |
|
|
|
6 |
# define inputs |
|
|
7 |
examName = "TCGA-DU-7294" |
|
|
8 |
t1File = "example_data/input_preprocessor_single_processing/TCGA-DU-7294/TCGA-DU-7294-T1.nii.gz" |
|
|
9 |
t1cFile = "example_data/input_preprocessor_single_processing/TCGA-DU-7294/TCGA-DU-7294-T1c.nii.gz" |
|
|
10 |
t2File = "example_data/input_preprocessor_single_processing/TCGA-DU-7294/TCGA-DU-7294-T2.nii.gz" |
|
|
11 |
flaFile = "example_data/input_preprocessor_single_processing/TCGA-DU-7294/TCGA-DU-7294-FLAIR.nii.gz" |
|
|
12 |
|
|
|
13 |
# define outputs |
|
|
14 |
outputDir = "example_data/output_preprocessor_single/TCGA-DU-7294" |
|
|
15 |
|
|
|
16 |
# execute it |
|
|
17 |
prep.single_preprocess( |
|
|
18 |
t1File=t1File, |
|
|
19 |
t1cFile=t1cFile, |
|
|
20 |
t2File=t2File, |
|
|
21 |
flaFile=flaFile, |
|
|
22 |
outputFolder=outputDir, |
|
|
23 |
# this way the brain extraction will run on cpu |
|
|
24 |
mode="cpu", |
|
|
25 |
confirm=True, |
|
|
26 |
skipUpdate=False, |
|
|
27 |
gpuid="0", |
|
|
28 |
) |