diff --git a/brainglobe_workflows/registration_script.py b/brainglobe_workflows/registration_script.py new file mode 100644 index 00000000..a60b10cb --- /dev/null +++ b/brainglobe_workflows/registration_script.py @@ -0,0 +1,54 @@ +import os +from pathlib import Path +import subprocess +import json +from typing import Dict, Union + +Pathlike = Union[str, bytes, os.PathLike] +# TODO: use pydantic or attrs, and/or a dataclass, for this?? +def _default_config(): + defaults = { + "sample_data_path" + } + +def _validate_config(config_dict: Dict[str]): + expected_keys = [ + "sample_data_path", + "output_path", + "voxel size", + "orientation" + "atlas" + ] + expected_types = [ + Pathlike, + ] + for key, type in zip(expected_keys, expected_types): + assert key in config_dict.keys() + + +def example_workflow(): + input_config_path = Path(os.environ("BRAINGLOBE_REGISTRATION_CONFIG_PATH")) + if input_config_path.exists(): + config = json.loads(input_config_path) + else: + config = _default_config() + input_data = read_from_config(config) + preprocessed_data = process(input_data) # if required + results = run_main_tool(prepocessed_data) + save(results) + +if __name__ == "__main__": + example_workflow() + +""" +To run brainreg, you need to pass: + * The path to the sample data + * The path to the directory to save the results + * The voxel sizes + * The orientation + * The atlas to use + +We put this all together in a single command: + +brainreg test_brain brainreg_output -v 50 40 40 --orientation psl --atlas allen_mouse_50um +"""