Skip to content

Commit 6ef534a

Browse files
PolarBeanclaude
andcommitted
fix: update tests for BrainGlobeAtlas API changes after load_atlas_data removal
- Use resolve_atlas() wrapper in test_visualisations so atlas.volume/.labels work - Use atlas.resolution[0] instead of atlas.voxel_size_um (BrainGlobeAtlas API) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 191d98d commit 6ef534a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tests/regression/test_damage_volume_interpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_damage_volume_persistence(self):
102102
frequency_volume=fv,
103103
damage_volume=dv,
104104
atlas_volume=atlas.annotation,
105-
voxel_size_um=atlas.voxel_size_um or 25.0,
105+
voxel_size_um=atlas.resolution[0],
106106
)
107107

108108
self.assertTrue(os.path.exists(damage_nifti_path), f"Damage volume NIfTI should be saved at {damage_nifti_path}")

tests/regression/test_visualisations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from brainglobe_atlasapi import BrainGlobeAtlas
99

1010
from PyNutil import read_alignment, seg_to_coords
11+
from PyNutil.io.atlas_loader import resolve_atlas
1112
from timing_utils import TimedTestCase
1213

1314

@@ -46,7 +47,7 @@ def test_generated_visualisations_match_expected(self):
4647
with open(self.settings_path) as f:
4748
settings = json.load(f)
4849

49-
atlas = BrainGlobeAtlas(settings["atlas_name"])
50+
atlas = resolve_atlas(BrainGlobeAtlas(settings["atlas_name"]))
5051
alignment = read_alignment(settings["alignment_json"])
5152
result = seg_to_coords(
5253
settings["segmentation_folder"],
@@ -67,7 +68,7 @@ def test_generated_visualisations_match_expected(self):
6768
create_section_visualisations(
6869
settings["segmentation_folder"],
6970
reg_data.slices,
70-
atlas.annotation,
71+
atlas.volume,
7172
atlas.labels,
7273
output_root,
7374
adapter=adapter,

0 commit comments

Comments
 (0)