diff --git a/examples/neurons.py b/examples/neurons.py index 05049b87..58881166 100644 --- a/examples/neurons.py +++ b/examples/neurons.py @@ -1,6 +1,6 @@ from pathlib import Path -from importlib.resources import files +import requests.exceptions from morphapi.api.mouselight import MouseLightAPI from myterial import orange from rich import print @@ -19,14 +19,17 @@ scene.add(Neuron(neuron_file)) # Download neurons data with morphapi -mlapi = MouseLightAPI() -neurons_metadata = mlapi.fetch_neurons_metadata( - filterby="soma", filter_regions=["MOs"] -) - -to_add = [neurons_metadata[47], neurons_metadata[51]] -neurons = mlapi.download_neurons(to_add) -neurons = scene.add(*make_neurons(*neurons, neurite_radius=12)) +try: + mlapi = MouseLightAPI() + neurons_metadata = mlapi.fetch_neurons_metadata( + filterby="soma", filter_regions=["MOs"] + ) + + to_add = [neurons_metadata[47], neurons_metadata[51]] + neurons = mlapi.download_neurons(to_add) + neurons = scene.add(*make_neurons(*neurons, neurite_radius=12)) +except ConnectionError or requests.exceptions.ReadTimeout as e: + print("Failed to download neurons data from neuromorpho.org.") # Render! scene.render() diff --git a/examples/settings.py b/examples/settings.py index b14f40b2..2a36997a 100644 --- a/examples/settings.py +++ b/examples/settings.py @@ -29,3 +29,6 @@ brainrender.settings.SHADER_STYLE = shader scene = Scene(title=shader) scene.render() + +brainrender.settings.BACKGROUND_COLOR = "white" # reset background color +brainrender.settings.SHOW_AXES = True # reset axes display diff --git a/tests/data/screenshot.jpg b/tests/data/screenshot.jpg index 5358b62e..abd6a879 100644 Binary files a/tests/data/screenshot.jpg and b/tests/data/screenshot.jpg differ diff --git a/tests/data/screenshot.png b/tests/data/screenshot.png index acd56f67..207221b0 100644 Binary files a/tests/data/screenshot.png and b/tests/data/screenshot.png differ