Skip to content

Commit

Permalink
fix(test): update expected number of images
Browse files Browse the repository at this point in the history
fix(test): preconf bbox ng format should not overwrite clip flag
  • Loading branch information
xgui3783 committed Oct 24, 2024
1 parent b77bbee commit 15711d9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
52 changes: 38 additions & 14 deletions e2e/features/image/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,40 @@

# Update this as new configs are added
results = [
(siibra.features.get(siibra.get_template("big brain"), "CellbodyStainedSection"), 145),
(siibra.features.get(siibra.get_template("big brain"), "CellBodyStainedVolumeOfInterest"), 2),
(siibra.features.get(siibra.get_template("mni152"), "image", restrict_space=True), 4),
(siibra.features.get(siibra.get_template("mni152"), "image", restrict_space=False), 13),
(siibra.features.get(siibra.get_region('julich 3.1', 'hoc1 left'), "CellbodyStainedSection"), 45),
(siibra.features.get(siibra.get_region('julich 2.9', 'hoc1 left'), "CellbodyStainedSection"), 41)
(
siibra.features.get(siibra.get_template("big brain"), "CellbodyStainedSection"),
145,
),
(
siibra.features.get(
siibra.get_template("big brain"), "CellBodyStainedVolumeOfInterest"
),
2,
),
(
siibra.features.get(
siibra.get_template("mni152"), "image", restrict_space=True
),
4,
),
(
siibra.features.get(
siibra.get_template("mni152"), "image", restrict_space=False
),
14,
),
(
siibra.features.get(
siibra.get_region("julich 3.1", "hoc1 left"), "CellbodyStainedSection"
),
45,
),
(
siibra.features.get(
siibra.get_region("julich 2.9", "hoc1 left"), "CellbodyStainedSection"
),
41,
),
]
features = [f for fts, _ in results for f in fts]

Expand All @@ -21,10 +49,7 @@ def test_feature_has_datasets(feature: Image):


@pytest.mark.parametrize("features, result_len", results)
def test_image_query_results(
features: Image,
result_len: int
):
def test_image_query_results(features: Image, result_len: int):
assert len(features) == result_len


Expand All @@ -33,18 +58,17 @@ def test_images_datasets_names():
all_ds_names = {ds.name for f in features for ds in f.datasets}
end = time.time()
duration = start - end
assert len(all_ds_names) == 9, "expected 9 distinct names"
assert len(all_ds_names) == 10, "expected 9 distinct names"
assert duration < 1, "Expected getting dataset names to be less than 1s"


def test_color_channel_fetching():
dti_rgb_vol = [
f
for f in siibra.features.get(
siibra.get_template('mni152'),
siibra.features.fibres.DTIVolumeOfInterest
siibra.get_template("mni152"), siibra.features.fibres.DTIVolumeOfInterest
)
if 'rgb' in f.name
if "rgb" in f.name
][0]
_ = dti_rgb_vol.fetch(channel=0)
_ = dti_rgb_vol.fetch(channel=1)
Expand Down
1 change: 0 additions & 1 deletion e2e/volumes/test_preconfigured_boundingbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def test_onthefly_and_preconfig_bboxes(volume: Volume, clip_flag: bool):
if "neuroglancer/precomputed" in volume.providers:
kwargs.update(
{
"clip": False,
"resolution_mm": -1,
"format": "neuroglancer/precomputed",
"max_bytes": 2 * 1024**3,
Expand Down

0 comments on commit 15711d9

Please sign in to comment.