From ae1de75538a56bc5c24d0ff1046a4b51ce0bf2ab Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Wed, 13 Oct 2021 18:02:28 +0200
Subject: [PATCH] bugfix: big brain high res map
---
docs/releases/v2.5.2.md | 5 ++
mkdocs.yml | 1 +
src/util/patchPureConstants.ts | 75 ++++++++++++----------------
src/util/pureConstant.service.ts | 31 ++++++------
src/util/siibraApiConstants/types.ts | 7 +--
5 files changed, 55 insertions(+), 64 deletions(-)
create mode 100644 docs/releases/v2.5.2.md
diff --git a/docs/releases/v2.5.2.md b/docs/releases/v2.5.2.md
new file mode 100644
index 000000000..200aab572
--- /dev/null
+++ b/docs/releases/v2.5.2.md
@@ -0,0 +1,5 @@
+# v2.5.2
+
+## Bugfixes
+
+- fix big brain high resolution maps
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 80ad8c9d6..b7e247316 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -40,6 +40,7 @@ pages:
- Fetching datasets: 'advanced/datasets.md'
- Display non-atlas volumes: 'advanced/otherVolumes.md'
- Release notes:
+ - v2.5.2: 'releases/v2.5.2.md'
- v2.5.1: 'releases/v2.5.1.md'
- v2.5.0: 'releases/v2.5.0.md'
- v2.4.8: 'releases/v2.4.8.md'
diff --git a/src/util/patchPureConstants.ts b/src/util/patchPureConstants.ts
index 55ff45561..681860add 100644
--- a/src/util/patchPureConstants.ts
+++ b/src/util/patchPureConstants.ts
@@ -46,25 +46,21 @@ async function getInterpolatedPatchObj(targetName: string, labelIndex: number){
'@id': 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588'
}],
"payload": {
- "volumeSrc": {
- 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588': {
- "collect": [{
- "@type": "fzj/tmp/volume_type/v0.0.1" as const,
- "@id": "fzj/tmp/volume_type/v0.0.1/interpolated",
- "name": "Julich Brain v2.5 interpolated map",
- "volume_type": "neuroglancer/precomputed" as const,
- "url": "https://neuroglancer.humanbrainproject.org/precomputed/BigBrainRelease.2015/2019_05_22_interpolated_areas",
- "detail": {
- "neuroglancer/precomputed": {
- "labelIndex": labelIndex,
- "transform": [[1,0,0,-70677184],[0,1,0,-51990000],[0,0,1,-58788284],[0,0,0,1]]
- }
- },
- "space_id": "minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588",
- map_type: 'labelled'
- }]
- }
- }
+ _dataset_specs: [{
+ "@type": "fzj/tmp/volume_type/v0.0.1" as const,
+ "@id": "fzj/tmp/volume_type/v0.0.1/interpolated",
+ "name": "Julich Brain v2.5 interpolated map",
+ "volume_type": "neuroglancer/precomputed" as const,
+ "url": "https://neuroglancer.humanbrainproject.org/precomputed/BigBrainRelease.2015/2019_05_22_interpolated_areas",
+ "detail": {
+ "neuroglancer/precomputed": {
+ "labelIndex": labelIndex,
+ "transform": [[1,0,0,-70677184],[0,1,0,-51990000],[0,0,1,-58788284],[0,0,0,1]]
+ }
+ },
+ "space_id": "minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588",
+ map_type: 'labelled'
+ }],
}
}
const hex = await getShaDigest(JSON.stringify(returnObj))
@@ -78,9 +74,9 @@ async function getIndividualMap(parentName: string, regionName: string, url: str
const volumeId = await getShaDigest(url)
const returnObj: TPatchRegion = {
'@id': '',
- "@type": 'julich/siibra/append-region/v0.0.1',
- "parent": {
- "name": parentName
+ "@type": 'julich/siibra/patch-region/v0.0.1',
+ "target": {
+ "name": regionName
},
"targetParcellation": [{
"@id": 'minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290'
@@ -89,26 +85,21 @@ async function getIndividualMap(parentName: string, regionName: string, url: str
'@id': 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588'
}],
"payload": {
- "name": regionName,
- "volumeSrc": {
- 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588': {
- "collect": [{
- "@type": "fzj/tmp/volume_type/v0.0.1" as const,
- "@id": `fzj/tmp/volume_type/v0.0.1/${volumeId}`,
- "name": "Julich Brain v2.5 detailed map",
- "volume_type": "neuroglancer/precomputed" as const,
- "url": url,
- "detail": {
- "neuroglancer/precomputed": {
- "labelIndex": labelIndex,
- "transform": transform
- }
- },
- space_id: 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588',
- map_type: 'labelled'
- }]
- }
- }
+ '_dataset_specs': [{
+ "@type": "fzj/tmp/volume_type/v0.0.1" as const,
+ "@id": `fzj/tmp/volume_type/v0.0.1/${volumeId}`,
+ "name": "Julich Brain v2.5 detailed map",
+ "volume_type": "neuroglancer/precomputed" as const,
+ "url": url,
+ "detail": {
+ "neuroglancer/precomputed": {
+ "labelIndex": labelIndex,
+ "transform": transform
+ }
+ },
+ space_id: 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588',
+ map_type: 'labelled'
+ }],
}
}
const hex = await getShaDigest(JSON.stringify(returnObj))
diff --git a/src/util/pureConstant.service.ts b/src/util/pureConstant.service.ts
index 09b2e1898..74a1280e0 100644
--- a/src/util/pureConstant.service.ts
+++ b/src/util/pureConstant.service.ts
@@ -532,20 +532,16 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}"
* this should work for both fully mapped and interpolated
* in the case of interpolated, it sucks that the ngLayerObj will be set multiple times
*/
- if (
- tmpl.id in (region.volumeSrc || {})
- && 'collect' in region.volumeSrc[tmpl.id]
- ) {
- const dedicatedMap = region.volumeSrc[tmpl.id]['collect'].filter(v => v.volume_type === 'neuroglancer/precomputed')
- if (dedicatedMap.length === 1) {
- const ngId = getNgId(atlas['@id'], tmpl.id, parc.id, dedicatedMap[0]['@id'])
- region['ngId'] = ngId
- region['labelIndex'] = dedicatedMap[0].detail['neuroglancer/precomputed'].labelIndex
- ngLayerObj[tmpl.id][ngId] = {
- source: `precomputed://${dedicatedMap[0].url}`,
- type: "segmentation",
- transform: dedicatedMap[0].detail['neuroglancer/precomputed'].transform
- }
+
+ const dedicatedMap = region._dataset_specs.filter(spec => spec.space_id === tmpl.id && spec['volume_type'] === 'neuroglancer/precomputed')
+ if (dedicatedMap.length === 1) {
+ const ngId = getNgId(atlas['@id'], tmpl.id, parc.id, dedicatedMap[0]['@id'])
+ region['ngId'] = ngId
+ region['labelIndex'] = dedicatedMap[0].detail['neuroglancer/precomputed'].labelIndex
+ ngLayerObj[tmpl.id][ngId] = {
+ source: `precomputed://${dedicatedMap[0].url}`,
+ type: "segmentation",
+ transform: dedicatedMap[0].detail['neuroglancer/precomputed'].transform
}
}
@@ -579,10 +575,11 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}"
&& hemisphereKey === 'whole brain'
) {
region.children = []
- return
}
- const hemispheredNgId = getNgId(atlas['@id'], tmpl.id, parc.id, hemisphereKey)
- region['ngId'] = hemispheredNgId
+ if (!region['ngId']) {
+ const hemispheredNgId = getNgId(atlas['@id'], tmpl.id, parc.id, hemisphereKey)
+ region['ngId'] = hemispheredNgId
+ }
}
}
)
diff --git a/src/util/siibraApiConstants/types.ts b/src/util/siibraApiConstants/types.ts
index 62fc6057d..7f3170ad6 100644
--- a/src/util/siibraApiConstants/types.ts
+++ b/src/util/siibraApiConstants/types.ts
@@ -180,11 +180,6 @@ export type TRegionDetail = {
export type TRegion = {
name: string
children: TRegion[]
- volumeSrc: {
- [key: string]: {
- [key: string]: TVolumeSrc<keyof IVolumeTypeDetail>[]
- }
- }
labelIndex?: number
rgb?: number[]
@@ -192,6 +187,8 @@ export type TRegion = {
kg: TKgIdentifier
}
+ _dataset_specs: TVolumeSrc<keyof IVolumeTypeDetail>[]
+
/**
* missing
*/
--
GitLab