-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (29 loc) · 921 Bytes
/
main.py
File metadata and controls
40 lines (29 loc) · 921 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
29
30
31
32
33
34
35
36
37
38
39
40
import os
import warnings
from lib.annotator import Annotator
warnings.filterwarnings("ignore")
info = (
"""
========= MRI ANNOTATOR v0.1 =========
OPERATION GUIDE:
USE Q/W TO NAVIGATE IMAGE SLICES
L MOUSE TO ANNOTATE POSITIVE N LESION
R MOUSE TO REMOVE PREVIOUS ANNOTATION
ESC TO SAVE AND PROCEED
========= MRI ANNOTATOR v0.1 =========
cjj
"""
)
if __name__ == "__main__":
print(info)
root_img = input("please enter root dir of MR images: ")
patients = os.listdir(root_img)
path_save = input("please enter directory to save annotations: ")
for pat in patients:
dir = os.path.join(root_img, pat)
try:
anno = Annotator(output_path=path_save, dir=dir)
anno.show_arr()
except:
print(dir, "error! proceed to next...")
continue