From 7cfdc10c85942d295901e16ce598f587e841c5ea Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Tue, 14 May 2024 13:53:40 +0100 Subject: [PATCH 1/3] Update from imio to brainglobe_utils.IO.image --- examples/user_volumetric_data.py | 19 +++---------------- pyproject.toml | 1 + 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/examples/user_volumetric_data.py b/examples/user_volumetric_data.py index 5dae5a1a..a56c39f9 100644 --- a/examples/user_volumetric_data.py +++ b/examples/user_volumetric_data.py @@ -15,27 +15,19 @@ """ -try: - import imio -except ImportError: - raise ImportError( - 'You need imio to run this example: "pip install imio".\nFor more details: https://github.com/brainglobe/imio' - ) - from pathlib import Path import pooch from brainglobe_space import AnatomicalSpace +from brainglobe_utils.IO.image.load import load_any from myterial import blue_grey, orange from rich import print from vedo import Volume as VedoVolume from brainrender import Scene -from brainrender.actors import Volume print(f"[{orange}]Running example: {Path(__file__).name}") -# specify where the data are saved retrieved_paths = pooch.retrieve( url="https://api.mapzebrain.org/media/Lines/brn3cGFP/average_data/T_AVG_s356tTg.zip", @@ -51,17 +43,12 @@ ), ) -datafile = Path(retrieved_paths[1]) # [0] is zip file - -if not datafile.exists(): - raise ValueError( - "Before running this example you need to download the data for gene expression of the line brn3c:GFP from https://fishatlas.neuro.mpg.de/lines/" - ) +datafile = Path(retrieved_paths[0]) # [0] is zip file # 1. load the data print("Loading data") -data = imio.load.load_any(datafile) +data = load_any(datafile) # 2. aligned the data to the scene's atlas' axes print("Transforming data") diff --git a/pyproject.toml b/pyproject.toml index 20c4e195..f4a7accc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ dynamic = ["version"] dependencies = [ "brainglobe-atlasapi>=2.0.1", "brainglobe-space>=1.0.0", + "brainglobe-utils>0.5.0", "h5py", "imio", "k3d", From fd3dbc3464c0ecadda6105ec9cdbfc7a01b6fd95 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Tue, 14 May 2024 14:17:10 +0100 Subject: [PATCH 2/3] Update usage in test --- tests/test_integration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index d4de5417..832d8793 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,11 +1,11 @@ from importlib.resources import files from pathlib import Path -import imio import numpy as np import pooch import pytest from brainglobe_space import AnatomicalSpace +from brainglobe_utils.IO.image.load import load_any from vedo import Volume as VedoVolume from brainrender import Animation, Scene, VideoMaker @@ -318,8 +318,8 @@ def test_user_volumetric_data(): ), ) - datafile = Path(retrieved_paths[1]) # [0] is zip file - data = imio.load.load_any(datafile) + datafile = Path(retrieved_paths[0]) + data = load_any(datafile) source_space = AnatomicalSpace("ira") target_space = scene.atlas.space transformed_data = source_space.map_stack_to(target_space, data) From c3acbc41654aece43b2a06a376735cbca67dfc86 Mon Sep 17 00:00:00 2001 From: Alessandro Felder Date: Wed, 15 May 2024 14:40:35 +0100 Subject: [PATCH 3/3] pin to >=0.5.0 (instead of >, which doesn't exist yet) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f4a7accc..7fe8417b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ dynamic = ["version"] dependencies = [ "brainglobe-atlasapi>=2.0.1", "brainglobe-space>=1.0.0", - "brainglobe-utils>0.5.0", + "brainglobe-utils>=0.5.0", "h5py", "imio", "k3d",