[ab8281]: / 0_preprocessing_single.py

Download this file

29 lines (24 with data), 882 Bytes

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