From 7f305f0f9076bed7a972e9222b6541c32fc0a6b4 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Mon, 15 Jan 2024 16:02:55 +0000 Subject: [PATCH] Add simple web export example (#319) * Add simple web export example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update examples/web_export.py Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com> --- examples/web_export.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/web_export.py diff --git a/examples/web_export.py b/examples/web_export.py new file mode 100644 index 00000000..cfd20620 --- /dev/null +++ b/examples/web_export.py @@ -0,0 +1,22 @@ +from pathlib import Path + +from myterial import orange +from rich import print + +from brainrender import Scene + +print(f"[{orange}]Running example: {Path(__file__).name}") + +# Create a brainrender scene +scene = Scene(title="brainrender web export") + +# Add brain regions +scene.add_brain_region( + "MOs", "CA1", alpha=0.2, color="green", hemisphere="right" +) + +# Render! +scene.render() + +# Export to web +scene.export("brain_regions.html")