-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0c0e33
commit 393c99a
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import numpy as np | ||
from brainreg_segment.atlas import utils as atlas_utils | ||
|
||
from bg_atlasapi import BrainGlobeAtlas | ||
|
||
atlas_name = "allen_mouse_50um" | ||
|
||
|
||
def test_get_available_atlases(): | ||
atlases = atlas_utils.get_available_atlases() | ||
|
||
# arbitrary selection of atlases | ||
assert float(atlases["allen_mouse_10um"]) >= 0.3 | ||
assert float(atlases["allen_mouse_25um"]) >= 0.3 | ||
assert float(atlases["allen_mouse_50um"]) >= 0.3 | ||
assert float(atlases["mpin_zfish_1um"]) >= 0.4 | ||
|
||
|
||
def test_lateralise_atlas_image(): | ||
atlas = BrainGlobeAtlas(atlas_name) | ||
|
||
mask = np.random.random(atlas.annotation.shape) > 0.7 | ||
masked_annotations = mask * atlas.annotation | ||
annotations_left, annotations_right = atlas_utils.lateralise_atlas_image( | ||
masked_annotations, | ||
atlas.hemispheres, | ||
left_hemisphere_value=atlas.left_hemisphere_value, | ||
right_hemisphere_value=atlas.right_hemisphere_value, | ||
) | ||
|
||
# not the best way to test this is functioning properly | ||
total_vals_in = np.prod(mask.shape) | ||
total_vals_out = len(annotations_left) + len(annotations_right) | ||
|
||
assert total_vals_in == total_vals_out |
File renamed without changes.
File renamed without changes.
File renamed without changes.