forked from kdavila/ChartInfo_annotation_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart_stats.py
44 lines (30 loc) · 1.06 KB
/
chart_stats.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
40
41
42
43
44
import sys
from AM_CommonTools.configuration.configuration import Configuration
# from ChartInfo.data.image_info import ImageInfo
from ChartInfo.util.file_stats import FileStats
def main():
if len(sys.argv) < 2:
print("Usage: python chart_stats.py config [config2] [...]")
print("Where")
print("\tconfig\t= Configuration File")
print("")
return
all_stats = []
for config_filename in sys.argv[1:]:
print("Processing: " + config_filename, flush=True)
config = Configuration.from_file(config_filename)
charts_dir = config.get_str("CHART_DIRECTORY")
annotations_dir = config.get_str("CHART_ANNOTATIONS")
stats = FileStats(charts_dir, annotations_dir)
all_stats.append(stats)
stats = FileStats.Merge(all_stats)
print("")
stats.print_general_stats()
print("")
stats.print_single_panel_annotated_stats(False)
print("")
stats.print_single_panel_annotated_stats(True)
print("")
stats.print_autocheck_stats()
if __name__ == "__main__":
main()