-
Notifications
You must be signed in to change notification settings - Fork 12
/
2_fusion.py
39 lines (30 loc) · 915 Bytes
/
2_fusion.py
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
29
30
31
32
33
34
35
36
37
38
39
import datetime
from brats_toolkit.fusionator import Fusionator
# log
starttime = str(datetime.datetime.now().time())
print("*** starting at", starttime, "***")
# instantiate
fus = Fusionator(verbose=True)
# input
SOURCEDIR = "example_data/output_segmentor/TCGA-DU-7294/"
# output
OUTPUTDIR = "example_data/output_fusionator/TCGA-DU-7294/"
# cids of the algorithms we want to fuse
cids = ["mic-dkfz", "scan", "xfeng", "lfb_rwth", "zyx_2019", "scan_2019"]
# segmentation file paths
segs = [SOURCEDIR + s + ".nii.gz" for s in cids]
# execution
# mav
mavPath = OUTPUTDIR + "mav.nii.gz"
fus.fuse(
segmentations=segs,
outputPath=mavPath,
method="mav",
weights=None,
)
# simple
simplePath = OUTPUTDIR + "simple.nii.gz"
fus.fuse(segmentations=segs, outputPath=simplePath, method="simple", weights=None)
# log
endtime = str(datetime.datetime.now().time())
print("*** finished at:", endtime, "***")