diff --git a/src/res/ext/MNI152.json b/src/res/ext/MNI152.json index a32f860320e553f682bc2d909ff3138c1fc7ada7..d05c3584166c5cd480b5e9b4c9ec9c283ce41f9b 100644 --- a/src/res/ext/MNI152.json +++ b/src/res/ext/MNI152.json @@ -17,7 +17,9 @@ "auxillaryMeshIndices": [ 65535 ], - "hasAdditionalViewMode": [], + "hasAdditionalViewMode": [ + "connectivity" + ], "originDatasets": [ { "kgSchema": "minds/core/dataset/v1.0.0", @@ -78867,4 +78869,4 @@ "name": "ICBM 2009c Nonlinear Asymmetric", "description": "An unbiased non-linear average of multiple subjects from the MNI152 database, which provides high-spatial resolution and signal-to-noise while not being biased towards a single brain (Fonov et al., 2011). This template space is widely used as a reference space in neuroimaging. HBP provides the JuBrain probabilistic cytoarchitectonic atlas (Amunts/Zilles, 2015) as well as a probabilistic atlas of large fibre bundles (Guevara, Mangin et al., 2017) in this space." } -} \ No newline at end of file +} diff --git a/src/res/ext/colin.json b/src/res/ext/colin.json index 542e23c761a56ada294ce0a23f6580cde75e1fae..f6638ee25c7d6ec5b025331a1256a996b2d64b2e 100644 --- a/src/res/ext/colin.json +++ b/src/res/ext/colin.json @@ -16,7 +16,9 @@ "auxillaryMeshIndices": [ 65535 ], - "hasAdditionalViewMode": [], + "hasAdditionalViewMode": [ + "connectivity" + ], "originDatasets": [ { "kgSchema": "minds/core/dataset/v1.0.0", @@ -18386,4 +18388,4 @@ "name": "MNI Colin 27", "description": "A stereotaxic average of 27 T1-weighted MRI scans of the same individual. (Holmes et al., 1998), mapped to fit the MNI305 space. Although not capturing brain variability, it is well established in neuroscience due to its high definition. HBP provides the JuBrain probabilistic cytoarchitectonic atlas (Amunts et al.) in this space." } -} \ No newline at end of file +} diff --git a/src/ui/connectivityBrowser/connectivityBrowser.component.ts b/src/ui/connectivityBrowser/connectivityBrowser.component.ts index 0525e2c8eec0ab9c26963dec8e800b35fa8d12f2..03f768c8a7b9968f5e5bef33d15a1ff812f89a4b 100644 --- a/src/ui/connectivityBrowser/connectivityBrowser.component.ts +++ b/src/ui/connectivityBrowser/connectivityBrowser.component.ts @@ -94,13 +94,21 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe if (newRegionName !== this.regionName && this.defaultColorMap) { this.restoreDefaultColormap() } + + if (val.status + && !val.name.includes('left hemisphere') + && !val.name.includes('right hemisphere')) { + this.regionHemisphere = val.status + } + this.regionName = newRegionName // TODO may not be necessary this.changeDetectionRef.detectChanges() } - + @Input() parcellationId: any public regionName: string + public regionHemisphere: string = null public datasetList: any[] = [] public selectedDataset: any public selectedDatasetDescription: string = '' @@ -140,7 +148,7 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe ngOnInit(): void { this.httpClient.get<[]>(this.connectivityUrl).subscribe(res => { - this.datasetList = res + this.datasetList = res.filter(dl => dl['parcellation id'] === this.parcellationId) this.selectedDataset = this.datasetList[0].name this.selectedDatasetDescription = this.datasetList[0].description @@ -259,6 +267,14 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe } public ngOnDestroy(): void { + this.connectivityNumberReceived.emit(null) + this.store$.dispatch( + ngViewerActionClearView({ + payload: { + [CONNECTIVITY_NAME_PLATE]: false + } + }) + ) this.restoreDefaultColormap() this.subscriptions.forEach(s => s.unsubscribe()) } @@ -309,7 +325,22 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe } getRegionWithName(region) { - return this.allRegions.find(ar => ar.name === region) + return this.allRegions.find(ar => { + if (this.regionHemisphere) { + let regionName = region + let regionStatus = null + if (regionName.includes('left hemisphere')) { + regionStatus = 'left hemisphere' + regionName = regionName.replace(' - left hemisphere', ''); + } else if (regionName.includes('right hemisphere')) { + regionStatus = 'right hemisphere' + regionName = regionName.replace(' - right hemisphere', ''); + } + return ar.name === regionName && ar.status === regionStatus + } + + return ar.name === region + }) } public restoreDefaultColormap() { @@ -324,7 +355,7 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe const existingMap: Map<string, Map<number, { red: number, green: number, blue: number }>> = (getWindow().interactiveViewer.viewerHandle.getLayersSegmentColourMap()) const colorMap = new Map(existingMap) - + this.allRegions.forEach(r => { if (r.ngId) { colorMap.get(r.ngId).set(r.labelIndex, {red: 255, green: 255, blue: 255}) @@ -333,7 +364,23 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe this.connectedAreas.forEach(area => { const areaAsRegion = this.allRegions - .filter(r => r.name === area.name) + .filter(r => { + + if (this.regionHemisphere) { + let regionName = area.name + let regionStatus = null + if (regionName.includes('left hemisphere')) { + regionStatus = 'left hemisphere' + regionName = regionName.replace(' - left hemisphere', ''); + } else if (regionName.includes('right hemisphere')) { + regionStatus = 'right hemisphere' + regionName = regionName.replace(' - right hemisphere', ''); + } + return r.name === regionName && r.status === regionStatus + } + + return r.name === area.name + }) .map(r => r) if (areaAsRegion && areaAsRegion.length && areaAsRegion[0].ngId) { diff --git a/src/ui/connectivityBrowser/connectivityBrowser.template.html b/src/ui/connectivityBrowser/connectivityBrowser.template.html index 05dd7a044ee75a57965e2795998cb463a2385578..3f69aa9c292f8d61a236f30bad6f9f963938b84e 100644 --- a/src/ui/connectivityBrowser/connectivityBrowser.template.html +++ b/src/ui/connectivityBrowser/connectivityBrowser.template.html @@ -2,7 +2,7 @@ <hbp-connectivity-matrix-row #connectivityComponent *ngIf="regionName" - [region]="regionName" + [region]="regionName + (regionHemisphere? ' - ' + regionHemisphere : '')" theme="dark" [loadurl]="loadUrl" show-export="true" diff --git a/src/ui/nehubaContainer/nehubaContainer.component.ts b/src/ui/nehubaContainer/nehubaContainer.component.ts index ec11619054d67697cac8fdec3fbd566a74f1749b..31baa10763f7dfb2bffb6266a62a982c57b56131 100644 --- a/src/ui/nehubaContainer/nehubaContainer.component.ts +++ b/src/ui/nehubaContainer/nehubaContainer.component.ts @@ -307,6 +307,7 @@ export class NehubaContainer implements OnInit, OnChanges, OnDestroy { public hoveredPanelIndices$: Observable<number> public connectivityNumber: string + public connectivityLoadUrl: string constructor( private pureConstantService: PureContantService, diff --git a/src/ui/nehubaContainer/nehubaContainer.template.html b/src/ui/nehubaContainer/nehubaContainer.template.html index 002a4eedfaacf90a69c3cebc23bbf975addec937..b08904a09ce57f37dfaed22204fba0da53d86d38 100644 --- a/src/ui/nehubaContainer/nehubaContainer.template.html +++ b/src/ui/nehubaContainer/nehubaContainer.template.html @@ -569,8 +569,10 @@ <ng-container *ngFor="let region of selectedRegions$ | async"> <connectivity-browser class="pe-all flex-shrink-1" [region]="region" + [parcellationId]="selectedParcellation['@id']" (setOpenState)="expansionPanel.expanded = $event" (connectivityNumberReceived)="connectivityNumber = $event" + (connectivityLoadUrl)="connectivityLoadUrl = $event" [accordionExpanded]="expansionPanel.expanded"> </connectivity-browser> </ng-container> @@ -591,10 +593,11 @@ iav-counter #connectedCounterDir="iavCounter"> - <hbp-connectivity-matrix-row *ngIf="region && region.name" [region]="region.name" + <hbp-connectivity-matrix-row *ngIf="region && region.name" + [region]="region.name + (region.status? ' - ' + region.status : '')" (connectivityDataReceived)="connectedCounterDir.value = $event.detail.length" class="invisible d-block h-0 w-0" - loadurl="https://connectivity-query-v1-1-connectivity.apps-dev.hbp.eu/v1.1/studies/1345998a08539dc24bda8817c7d5804558d83b1c"> + [loadurl]="connectivityLoadUrl"> </hbp-connectivity-matrix-row> </div> </mat-accordion>