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