Skip to content

Commit 3c6ccf2

Browse files
committed
fix siibra v2 statistic map fetching
1 parent 8292529 commit 3c6ccf2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

api/server/volumes/parcellationmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get_parcellation_labelled_map(parcellation_id: str, space_id: str, region_id
9696
region_id MUST refer to leaf region on the region hierarchy.
9797
""")
9898
@version(*FASTAPI_VERSION)
99-
@router_decorator(ROLE, func=old_get_region_statistic_map)
99+
@router_decorator(ROLE, func=statistical_map_nii_gz)
100100
def get_region_statistical_map(parcellation_id: str, region_id: str, space_id: str, name: str="", *, func):
101101
"""Get statistical map according to specification"""
102102
if func is None:
@@ -120,7 +120,7 @@ class StatisticModelInfo(BaseModel):
120120
# still use the old worker. New worker not stable (?)
121121
@router.get("/statistical_map.info.json", response_model=StatisticModelInfo, tags=TAGS)
122122
@version(*FASTAPI_VERSION)
123-
@router_decorator(ROLE, func=old_get_region_statistic_map_info)
123+
@router_decorator(ROLE, func=statistical_map_info_json)
124124
def get_region_statistical_map_metadata(parcellation_id: str, region_id: str, space_id: str, name: str="", *, func):
125125
"""Get metadata of statistical map according to specification"""
126126
if func is None:

new_api/data_handlers/maps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def cache_region_statistic_map(parcellation_id: str, region_id: str, space_id: s
3737
if len(maps) > 1:
3838
warning_texts = f"Multiple ({len(maps)}) maps found"
3939
map = maps[0]
40-
vol = map.extract_regional_map(region=region_id)
41-
volume_data = vol.get_data()
40+
volume_data = map.fetch(region=region_id)
4241

4342
error_text = f"{error_text}, with region_id '{region_id}'"
4443
assert isinstance(volume_data, nib.Nifti1Image), f"{error_text}, volume provided is not of type Nifti1Image"

0 commit comments

Comments
 (0)