diff --git a/.helm/adhoc/copy-cache.yaml b/.helm/adhoc/copy-cache.yaml index 37558f7..7f5c774 100644 --- a/.helm/adhoc/copy-cache.yaml +++ b/.helm/adhoc/copy-cache.yaml @@ -12,7 +12,7 @@ spec: - /bin/ash args: - -c - - "echo FROM_DIR: $FROM_DIR TO_DIR: $TO_DIR && mkdir $TO_DIR && cp -r $FROM_DIR/* $TO_DIR/" + - "echo FROM_DIR: $FROM_DIR TO_DIR: $TO_DIR && mkdir -p $TO_DIR && cp -r $FROM_DIR/* $TO_DIR/" resources: limits: cpu: 1000m diff --git a/VERSION b/VERSION index f43e370..719cd12 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.18 \ No newline at end of file +0.3.19 \ No newline at end of file diff --git a/api/server/api.py b/api/server/api.py index f131ff5..10fe9ce 100644 --- a/api/server/api.py +++ b/api/server/api.py @@ -298,6 +298,8 @@ async def middleware_add_version_header(request: Request, call_next): @siibra_api.middleware("http") async def middleware_access_log(request: Request, call_next): """Access log middleware""" + + print("AccessLog middleware called") if request.url.path in do_not_logs: return await call_next(request) @@ -324,6 +326,7 @@ async def middleware_access_log(request: Request, call_next): "hit_cache": "cache_miss" }) except Exception as e: + print("Exception at logging:", type(e), str(e)) general_logger.critical(e) # some plugins may strip origin header for privacy reasons diff --git a/api/server/volumes/parcellationmap.py b/api/server/volumes/parcellationmap.py index 78bb8ba..d7ce085 100644 --- a/api/server/volumes/parcellationmap.py +++ b/api/server/volumes/parcellationmap.py @@ -38,7 +38,6 @@ def get_resampled_map(parcellation_id: str, space_id: str, *, func): """Get resampled map according to specification""" if func is None: raise HTTPException(500, f"func: None passsed") - raise HTTPException(501, "Not yet implemented. If you are using this endpoint, please contact us.") headers={ "content-type": "application/octet-stream", "content-disposition": f'attachment; filename="labelled_map.nii.gz"' diff --git a/api/siibra_api_config.py b/api/siibra_api_config.py index ddd18fa..5352144 100644 --- a/api/siibra_api_config.py +++ b/api/siibra_api_config.py @@ -70,6 +70,7 @@ def get_config_dir_short_hash(path_to_config: str): "features", "volumes", "compounds", + "vocabularies", ] class CELERY_CONFIG: diff --git a/new_api/data_handlers/maps.py b/new_api/data_handlers/maps.py index 61df7a7..25599ea 100644 --- a/new_api/data_handlers/maps.py +++ b/new_api/data_handlers/maps.py @@ -106,13 +106,15 @@ def cache_resampled_map(parcellation_id: str, space_id: str, *, no_cache: bool): import nibabel as nib import siibra - from siibra.commons.maps import resample_img_to_img + from siibra.operations.volume_fetcher.nifti import ResampleNifti mp = siibra.get_map(parcellation_id, space_id, "labelled") - nii = mp.fetch() + src_dp = mp.extract_full_map() + nii = src_dp.get_data() space = siibra.get_space(space_id) - tmpl_nii = space.fetch_template() - resampled = resample_img_to_img(nii, tmpl_nii) + target_dp = space.get_dataprovider(index=0) + tmpl_nii = target_dp.get_data() + resampled = ResampleNifti.resample_img_to_img(nii, tmpl_nii) nib.save(resampled, full_filename) with open(f"{full_filename}.{str(int(time.time()))}.json", "w") as fp: diff --git a/requirements/v4-siibra.txt b/requirements/v4-siibra.txt index a16d4be..6779157 100644 --- a/requirements/v4-siibra.txt +++ b/requirements/v4-siibra.txt @@ -1,2 +1,2 @@ # refactor_attr is... borked since dataops are being introduced -git+https://github.com/xgui3783/siibra-python.git@aeffb478a1c98f3bec276ab820f5e50355c598a4 +git+https://github.com/xgui3783/siibra-python.git@90ba8150f4d3b01c36176b03ffa906f8090907cd