-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuous map does not have the same shape as the template #122
Comments
related: FZJ-INM1-BDA/siibra-python#302 |
The issue is caused by the template being fetched from a different format, i.e. "neuroglancer/precomputed". siibra-python has the same issue depending on the machine.
|
I suspect this can also lead to indeterministic behaviours, especially when network is unstable. see related issue FZJ-INM1-BDA/siibra-python#318 |
I see. So we need to make sure NG returns the "correct" one. We could define a default |
could be a solution. But this will vary, depending on the voxel resolution of the nifti |
a fix is being pushed to dev instanced, deployd at https://siibra-api-latest.apps-dev.hbp.eu/. e.g.: import requests
import nibabel as nib
SIIBRA_API_HOST = "https://siibra-api-latest.apps-dev.hbp.eu"
MNI152_ID="minds/core/referencespace/v1.0.0/dafcffc5-4826-4bf1-8ff6-46b8a31ff8e2"
JBA_29_ID="minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290"
regions = ["Area hOc1 (V1, 17, CalcS) - right hemisphere", "Area Fp1 (FPole) - right hemisphere", None]
endpoints = ["/v3_0/map/statistical_map.nii.gz", "/v3_0/map/labelled_map.nii.gz"]
for endpoint in endpoints:
for region in regions:
if region is None and endpoint == "/v3_0/map/statistical_map.nii.gz":
continue
query_param = {
'space_id': MNI152_ID,
'parcellation_id': JBA_29_ID,
}
if region:
query_param['region_id'] = region
resp = requests.get(f"{SIIBRA_API_HOST}{endpoint}", params=query_param)
resp.raise_for_status()
with open("boo.nii.gz", "wb") as fp:
fp.write(resp.content)
nii = nib.load("boo.nii.gz")
assert nii.get_fdata().shape == (193, 229, 193) I will post another update when the changes hits prod. |
I wanted to close this issue, but upon further testing the issue is not yet resolved from upstream siibra-python. see FZJ-INM1-BDA/siibra-python#368 for the continuation of the issue report. What this means for siibra-api: you may continue to see masks/statisticalmap/labelled map to have different dimension than the template. I will post an update when there are new developments. |
should be fixed by https://github.com/FZJ-INM1-BDA/siibra-api/releases/tag/v0.3.6 |
The continous map of Area Fp1 has a different shape than the corresponding template (97, 115, 97) vs. (193, 229, 193) for the parcellation julich 2.9, space mni152.
The text was updated successfully, but these errors were encountered: