Skip to content
Snippets Groups Projects
Commit be29136e authored by fsdavid's avatar fsdavid
Browse files

Minor connectivity fixes

parent 226b9432
No related branches found
No related tags found
No related merge requests found
......@@ -216,10 +216,8 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
// ToDo this temporary fix is for the bug existing on siibra api https://github.com/FZJ-INM1-BDA/siibra-api/issues/100
private fixDatasetFormat = (ds) => ds.name.includes('{')? ({
...ds,
name: ds.name.substr(0, ds.name.indexOf('{')),
dataset: JSON.parse(ds.name.substring(ds.name.indexOf('{')).replace(/'/g, '"'))
...JSON.parse(ds.name.substring(ds.name.indexOf('{')).replace(/'/g, '"'))
}) : ds
fetchConnectivity() {
this.sapi.getParcellation(this.atlas["@id"], this.parcellation["@id"]).getFeatureInstance(this.selectedDataset['@id'])
......@@ -232,7 +230,7 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
this.fetching = false
})
}
setMatrixData(data) {
const matrixData = data as SapiParcellationFeatureMatrixModel
this.regionIndexInMatrix = (matrixData.columns as Array<string>).findIndex(md => md === this.regionName)
......@@ -248,7 +246,7 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
.then(matrix => {
const regionProfile = matrix.rawArray[this.regionIndexInMatrix]
const maxStrength = Math.max(...regionProfile)
const maxStrength = Math.max(...regionProfile)
this.logChecked = maxStrength > 1
this.logDisabled = maxStrength <= 1
......@@ -264,7 +262,7 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
})
}
changeLog(checked: boolean) {
this.logChecked = checked
this.connectedAreas.next(this.formatConnections(this.pureConnections))
......@@ -272,13 +270,18 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
this.setCustomLayer()
}
//ToDo navigateRegion action does not work any more
//ToDo bestViewPoint is null for the most cases
navigateToRegion(region: SapiRegionModel) {
this.store$.dispatch(
atlasSelection.actions.navigateToRegion({
region
})
)
const regionCentroid = this.region.hasAnnotation?.bestViewPoint?.coordinates
if (regionCentroid)
this.store$.dispatch(
atlasSelection.actions.navigateTo({
navigation: {
position: regionCentroid.map(v => v.value*1e6),
},
animation: true
})
)
}
getRegionWithName(region: string) {
......
......@@ -62,10 +62,11 @@
theme="dark">
</hbp-connectivity-matrix-row>
<div *ngIf="noConnectivityForRegion">No connectivity for the region.</div>
<full-connectivity-grid #fullConnectivityGrid
[matrix]="matrixString"
[datasetName]="selectedDataset?.dataset?.name"
[datasetDescription]="selectedDataset?.dataset?.description"
[datasetName]="selectedDataset?.name"
[datasetDescription]="selectedDataset?.description"
only-export="true">
</full-connectivity-grid>
......
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