Skip to content
Snippets Groups Projects
Unverified Commit 76392e89 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #217 from HumanBrainProject/staging

hotfixes
parents a428c616 4961c18c
No related branches found
No related tags found
No related merge requests found
......@@ -64,11 +64,6 @@ const getPublicDs = () => Promise.race([
fetchDatasetFromKg().then(cacheData)
])
const getDs = ({ user }) => user
? fetchDatasetFromKg({ user }).then(({results}) => results)
: getPublicDs()
/**
* Needed by filter by parcellation
*/
......@@ -94,31 +89,54 @@ const readConfigFile = (filename) => new Promise((resolve, reject) => {
})
})
let juBrain = null
let shortBundle = null
let longBundle = null
let waxholm = null
let allen = null
const parcellationNameToFlattenedRegion = new Map()
const appendMap = (parcellation) => {
const { name, regions } = parcellation
parcellationNameToFlattenedRegion.set(name, flattenArray(regions))
}
readConfigFile('bigbrain.json')
.then(data => JSON.parse(data))
.then(json => {
const p = json.parcellations.find(p => p.name === 'Cytoarchitectonic Maps')
if (p) {
appendMap(p)
}
})
.catch(console.error)
readConfigFile('colin.json')
.then(data => JSON.parse(data))
.then(json => {
juBrain = flattenArray(json.parcellations[0].regions)
const p = json.parcellations.find(p => p.name === 'JuBrain Cytoarchitectonic Atlas')
if (p) {
appendMap(p)
}
})
.catch(console.error)
readConfigFile('MNI152.json')
.then(data => JSON.parse(data))
.then(json => {
longBundle = flattenArray(json.parcellations[0].regions)
shortBundle = flattenArray(json.parcellations[1].regions)
const p1 = json.parcellations.find(p => p.name === 'fibre bundle long')
if (p1) {
appendMap(p1)
}
const p2 = json.parcellations.find(p => p.name === 'fibre bundle short')
if (p2) {
appendMap(p2)
}
})
.catch(console.error)
readConfigFile('waxholmRatV2_0.json')
.then(data => JSON.parse(data))
.then(json => {
waxholm = flattenArray(json.parcellations[0].regions)
const p = json.parcellations.find(p => p.name === 'Waxholm Space rat brain atlas v.2.0')
if (p) {
appendMap(p)
}
})
.catch(console.error)
......@@ -135,7 +153,7 @@ const filterByPRs = (prs, atlasPr) => atlasPr
const manualFilter = require('./supplements/parcellation')
const filter = (datasets = [], {templateName, parcellationName}) => datasets
const filterDataset = (datasets = [], {templateName, parcellationName}) => datasets
.filter(ds => commonSenseDsFilter({ds, templateName, parcellationName }))
.filter(ds => {
if (/infant/.test(ds.name))
......@@ -147,18 +165,14 @@ const filter = (datasets = [], {templateName, parcellationName}) => datasets
if (parcellationName === 'Fibre Bundle Atlas - Long Bundle'){
return manualFilterDWM(ds)
}
return ds.parcellationRegion.length > 0
? filterByPRs(
ds.parcellationRegion,
parcellationName === 'JuBrain Cytoarchitectonic Atlas' && juBrain
? juBrain
: parcellationName === 'Fibre Bundle Atlas - Short Bundle' && shortBundle
? shortBundle
: parcellationName === 'Waxholm Space rat brain atlas v.2.0'
? waxholm
: null
)
: false
if (ds.parcellationRegion.length > 0) {
const flattenedRegions = parcellationNameToFlattenedRegion.get(parcellationName)
if (flattenedRegions) {
return filterByPRs(ds.parcellationRegion, flattenedRegions)
}
} else {
return false
}
}
return false
......@@ -186,8 +200,10 @@ exports.init = async () => {
cachedData = results
}
exports.getDatasets = ({ templateName, parcellationName, user }) => getDs({ user })
.then(json => filter(json, {templateName, parcellationName}))
exports.getDatasets = ({ templateName, parcellationName, user }) => (user
? fetchDatasetFromKg({ user }).then(({results}) => results)
: getPublicDs())
.then(json => filterDataset(json, {templateName, parcellationName}))
exports.getPreview = ({ datasetName, templateSelected }) => getPreviewFile({ datasetName, templateSelected })
......
......@@ -11,7 +11,8 @@ const humanParcellationSet = new Set([
'Area V2',
'JuBrain Cytoarchitectonic Atlas',
'Fibre Bundle Atlas - Short Bundle',
'Fibre Bundle Atlas - Long Bundle'
'Fibre Bundle Atlas - Long Bundle',
'Cytoarchitectonic Maps'
])
const ratTemplateSet = new Set([
......
......@@ -5,15 +5,14 @@
const express = require('express')
const router = express.Router()
const PLUGIN_URLS = process.env.PLUGIN_URLS && JSON.stringify(process.env.PLUGIN_URLS.split(';'))
const PLUGIN_URLS = (process.env.PLUGIN_URLS && process.env.PLUGIN_URLS.split(';')) || []
const STAGING_PLUGIN_URLS = (process.env.STAGING_PLUGIN_URLS && process.env.STAGING_PLUGIN_URLS.split(';')) || []
router.get('', (_req, res) => {
if (PLUGIN_URLS) {
return res.status(200).send(PLUGIN_URLS)
} else {
return res.status(200).send('[]')
}
return res.status(200).json([
...PLUGIN_URLS,
...STAGING_PLUGIN_URLS
])
})
module.exports = router
\ No newline at end of file
This diff is collapsed.
{"globals":{"hideNullImageValues":true,"useNehubaLayout":true,"useNehubaMeshLayer":true,"useCustomSegmentColors":true},"zoomWithoutCtrl":true,"hideNeuroglancerUI":true,"rightClickWithCtrl":true,"rotateAtViewCentre":true,"zoomAtViewCentre":true,"enableMeshLoadingControl":true,"layout":{"useNehubaPerspective":{"fixedZoomPerspectiveSlices":{"sliceViewportWidth":300,"sliceViewportHeight":300,"sliceZoom":724698.1843689409,"sliceViewportSizeMultiplier":2},"centerToOrigin":true,"mesh":{"removeBasedOnNavigation":true,"flipRemovedOctant":true,"surfaceParcellation":false},"removePerspectiveSlicesBackground":{"mode":"<","color":[0.1,0.1,0.1,1]},"waitForMesh":false,"drawSubstrates":{"color":[0.5,0.5,1,0.2]},"drawZoomLevels":{"cutOff":150000},"restrictZoomLevel":{"minZoom":2500000,"maxZoom":3500000}}},"dataset":{"imageBackground":[0,0,0,1],"initialNgState":{"showDefaultAnnotations":false,"layers":{"mni152":{"type":"image","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/mni_icbm152_t1_tal_nlin_asym_09c_masked","transform":[[1,0,0,-96500000],[0,1,0,-132500000],[0,0,1,-78500000],[0,0,0,1]]},"jubrain v17 left":{"type":"segmentation","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/17/icbm152casym/left","transform":[[1,0,0,-96500000],[0,1,0,-132500000],[0,0,1,-78500000],[0,0,0,1]]},"jubrain v17 right":{"type":"segmentation","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/17/icbm152casym/right","transform":[[1,0,0,-96500000],[0,1,0,-132500000],[0,0,1,-78500000],[0,0,0,1]]},"fibre bundle long":{"type":"segmentation","source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/long-bundles_maxprob","transform":[[1,0,0,-96500000],[0,1,0,-132500000],[0,0,1,-78500000],[0,0,0,1]]},"fibre bundle short":{"visible":false,"type":"segmentation","source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/short-bundles_maxprob","transform":[[1,0,0,-96500000],[0,1,0,-132500000],[0,0,1,-78500000],[0,0,0,1]]}},"navigation":{"pose":{"position":{"voxelSize":[1000000,1000000,1000000],"voxelCoordinates":[0,-32,0]}},"zoomFactor":450000},"perspectiveOrientation":[-0.2753947079181671,0.6631333827972412,-0.6360703706741333,0.2825356423854828],"perspectiveZoom":3000000}}}
\ No newline at end of file
{
"globals": {
"hideNullImageValues": true,
"useNehubaLayout": true,
"useNehubaMeshLayer": true,
"useCustomSegmentColors": true
},
"zoomWithoutCtrl": true,
"hideNeuroglancerUI": true,
"rightClickWithCtrl": true,
"rotateAtViewCentre": true,
"zoomAtViewCentre": true,
"enableMeshLoadingControl": true,
"layout": {
"useNehubaPerspective": {
"fixedZoomPerspectiveSlices": {
"sliceViewportWidth": 300,
"sliceViewportHeight": 300,
"sliceZoom": 724698.1843689409,
"sliceViewportSizeMultiplier": 2
},
"centerToOrigin": true,
"mesh": {
"removeBasedOnNavigation": true,
"flipRemovedOctant": true,
"surfaceParcellation": false
},
"removePerspectiveSlicesBackground": {
"mode": "<",
"color": [
0.1,
0.1,
0.1,
1
]
},
"waitForMesh": false,
"drawSubstrates": {
"color": [
0.5,
0.5,
1,
0.2
]
},
"drawZoomLevels": {
"cutOff": 150000
},
"restrictZoomLevel": {
"minZoom": 2500000,
"maxZoom": 3500000
}
}
},
"dataset": {
"imageBackground": [
0,
0,
0,
1
],
"initialNgState": {
"showDefaultAnnotations": false,
"layers": {
"mni152": {
"type": "image",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/mni_icbm152_t1_tal_nlin_asym_09c_masked",
"transform": [
[
1,
0,
0,
-96500000
],
[
0,
1,
0,
-132500000
],
[
0,
0,
1,
-78500000
],
[
0,
0,
0,
1
]
]
},
"jubrain mni152 v18 left": {
"type": "segmentation",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/18/icbm152casym/left",
"transform": [
[
1,
0,
0,
-96500000
],
[
0,
1,
0,
-132500000
],
[
0,
0,
1,
-78500000
],
[
0,
0,
0,
1
]
]
},
"jubrain mni152 v18 right": {
"type": "segmentation",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/18/icbm152casym/right",
"transform": [
[
1,
0,
0,
-96500000
],
[
0,
1,
0,
-132500000
],
[
0,
0,
1,
-78500000
],
[
0,
0,
0,
1
]
]
},
"fibre bundle long": {
"type": "segmentation",
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/long-bundles_maxprob",
"transform": [
[
1,
0,
0,
-96500000
],
[
0,
1,
0,
-132500000
],
[
0,
0,
1,
-78500000
],
[
0,
0,
0,
1
]
]
},
"fibre bundle short": {
"visible": false,
"type": "segmentation",
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/Fiber_Bundle/short-bundles_maxprob",
"transform": [
[
1,
0,
0,
-96500000
],
[
0,
1,
0,
-132500000
],
[
0,
0,
1,
-78500000
],
[
0,
0,
0,
1
]
]
}
},
"navigation": {
"pose": {
"position": {
"voxelSize": [
1000000,
1000000,
1000000
],
"voxelCoordinates": [
0,
-32,
0
]
}
},
"zoomFactor": 450000
},
"perspectiveOrientation": [
-0.2753947079181671,
0.6631333827972412,
-0.6360703706741333,
0.2825356423854828
],
"perspectiveZoom": 3000000
}
}
}
\ No newline at end of file
This diff is collapsed.
{"globals":{"hideNullImageValues":true,"useNehubaLayout":true,"useNehubaMeshLayer":true,"useCustomSegmentColors":true},"zoomWithoutCtrl":true,"hideNeuroglancerUI":true,"rightClickWithCtrl":true,"rotateAtViewCentre":true,"zoomAtViewCentre":true,"enableMeshLoadingControl":true,"layout":{"useNehubaPerspective":{"fixedZoomPerspectiveSlices":{"sliceViewportWidth":300,"sliceViewportHeight":300,"sliceZoom":724698.1843689409,"sliceViewportSizeMultiplier":2},"centerToOrigin":true,"mesh":{"removeBasedOnNavigation":true,"flipRemovedOctant":true,"surfaceParcellation":false},"removePerspectiveSlicesBackground":{"mode":"=="},"waitForMesh":false,"drawSubstrates":{"color":[0.5,0.5,1,0.2]},"drawZoomLevels":{"cutOff":150000},"restrictZoomLevel":{"minZoom":2500000,"maxZoom":3500000}}},"dataset":{"imageBackground":[0,0,0,1],"initialNgState":{"showDefaultAnnotations":false,"layers":{"colin":{"type":"image","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/v2.2c/colin27_seg","transform":[[1,0,0,-75500000],[0,1,0,-111500000],[0,0,1,-67500000],[0,0,0,1]]},"jubrain v2_2c":{"type":"segmentation","source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/v2.2c/MPM","transform":[[1,0,0,-75500000],[0,1,0,-111500000],[0,0,1,-67500000],[0,0,0,1]]},"jubrain colin v17 left":{"type":"segmentation","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/17/colin27/left","transform":[[1,0,0,-128500000],[0,1,0,-148500000],[0,0,1,-110500000],[0,0,0,1]]},"jubrain colin v17 right":{"type":"segmentation","visible":true,"source":"precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/17/colin27/right","transform":[[1,0,0,-128500000],[0,1,0,-148500000],[0,0,1,-110500000],[0,0,0,1]]}},"navigation":{"pose":{"position":{"voxelSize":[1000000,1000000,1000000],"voxelCoordinates":[0,-32,0]}},"zoomFactor":1000000},"perspectiveOrientation":[-0.2753947079181671,0.6631333827972412,-0.6360703706741333,0.2825356423854828],"perspectiveZoom":3000000}}}
\ No newline at end of file
{
"globals": {
"hideNullImageValues": true,
"useNehubaLayout": true,
"useNehubaMeshLayer": true,
"useCustomSegmentColors": true
},
"zoomWithoutCtrl": true,
"hideNeuroglancerUI": true,
"rightClickWithCtrl": true,
"rotateAtViewCentre": true,
"zoomAtViewCentre": true,
"enableMeshLoadingControl": true,
"layout": {
"useNehubaPerspective": {
"fixedZoomPerspectiveSlices": {
"sliceViewportWidth": 300,
"sliceViewportHeight": 300,
"sliceZoom": 724698.1843689409,
"sliceViewportSizeMultiplier": 2
},
"centerToOrigin": true,
"mesh": {
"removeBasedOnNavigation": true,
"flipRemovedOctant": true,
"surfaceParcellation": false
},
"removePerspectiveSlicesBackground": {
"mode": "=="
},
"waitForMesh": false,
"drawSubstrates": {
"color": [
0.5,
0.5,
1,
0.2
]
},
"drawZoomLevels": {
"cutOff": 150000
},
"restrictZoomLevel": {
"minZoom": 2500000,
"maxZoom": 3500000
}
}
},
"dataset": {
"imageBackground": [
0,
0,
0,
1
],
"initialNgState": {
"showDefaultAnnotations": false,
"layers": {
"colin": {
"type": "image",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/v2.2c/colin27_seg",
"transform": [
[
1,
0,
0,
-75500000
],
[
0,
1,
0,
-111500000
],
[
0,
0,
1,
-67500000
],
[
0,
0,
0,
1
]
]
},
"jubrain v2_2c": {
"type": "segmentation",
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/v2.2c/MPM",
"transform": [
[
1,
0,
0,
-75500000
],
[
0,
1,
0,
-111500000
],
[
0,
0,
1,
-67500000
],
[
0,
0,
0,
1
]
]
},
"jubrain colin v18 left": {
"type": "segmentation",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/18/colin27/left",
"transform": [
[
1,
0,
0,
-128500000
],
[
0,
1,
0,
-148500000
],
[
0,
0,
1,
-110500000
],
[
0,
0,
0,
1
]
]
},
"jubrain colin v18 right": {
"type": "segmentation",
"visible": true,
"source": "precomputed://https://neuroglancer.humanbrainproject.org/precomputed/JuBrain/18/colin27/right",
"transform": [
[
1,
0,
0,
-128500000
],
[
0,
1,
0,
-148500000
],
[
0,
0,
1,
-110500000
],
[
0,
0,
0,
1
]
]
}
},
"navigation": {
"pose": {
"position": {
"voxelSize": [
1000000,
1000000,
1000000
],
"voxelCoordinates": [
0,
-32,
0
]
}
},
"zoomFactor": 1000000
},
"perspectiveOrientation": [
-0.2753947079181671,
0.6631333827972412,
-0.6360703706741333,
0.2825356423854828
],
"perspectiveZoom": 3000000
}
}
}
\ No newline at end of file
import { Injectable, OnDestroy } from "@angular/core";
import { Effect, Actions, ofType } from "@ngrx/effects";
import { Observable, Subscription, merge, fromEvent, combineLatest } from "rxjs";
import { SHOW_KG_TOS } from "../state/uiState.store";
import { withLatestFrom, map, tap, switchMap, filter } from "rxjs/operators";
import { Subscription, merge, fromEvent, combineLatest } from "rxjs";
import { withLatestFrom, map, filter } from "rxjs/operators";
import { Store, select } from "@ngrx/store";
import { SELECT_PARCELLATION, SELECT_REGIONS, NEWVIEWER, UPDATE_PARCELLATION, SELECT_REGIONS_WITH_ID } from "../state/viewerState.store";
import { worker } from 'src/atlasViewer/atlasViewer.workerService.service'
......@@ -62,9 +61,12 @@ export class UseEffects implements OnDestroy{
* older versions of atlas viewer may only have labelIndex as region identifier
*/
@Effect()
onSelectRegionWithId = this.actions$.pipe(
ofType(SELECT_REGIONS_WITH_ID),
withLatestFrom(this.updatedParcellation$),
onSelectRegionWithId = combineLatest(
this.actions$.pipe(
ofType(SELECT_REGIONS_WITH_ID)
),
this.updatedParcellation$
).pipe(
map(([action, parcellation]) => {
const { selectRegionIds } = action
const { ngId: defaultNgId } = parcellation
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment