-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (26 loc) · 855 Bytes
/
main.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
import yaml
import sys
import os
# Import tasks from convert_tool and visualize_tool
from convert_tool import convert2h5
from visualize_tool import neuroglancer_tool
def load_config():
# Load configuration from YAML file
with open('config.yaml', 'r') as file:
config = yaml.safe_load(file)
return config
def main():
# Load configuration
config = load_config()
# Determine the task to run
task = config.get('task')
if task == 'visualize':
print('Running visualization task.')
neuroglancer_tool.run_visualization(config['visualize'])
elif task == 'convert':
print('Running conversion task.')
convert2h5.run_conversion(config['convert'])
else:
raise ValueError(f"Unknown task: {task}. Please choose 'visualize' or 'convert'.")
if __name__ == '__main__':
main()