Skip to content
Snippets Groups Projects
Unverified Commit 5d173a0d authored by Xiao Gui's avatar Xiao Gui
Browse files

Merge remote-tracking branch 'origin/dev' into dev_full_view

parents d48192de c01ae305
No related branches found
No related tags found
No related merge requests found
Showing with 70 additions and 22 deletions
# v2.9.0
## Bugfix
- Select default connectivity profile
- Show connectivity dataset info
......@@ -33,6 +33,7 @@ nav:
- Fetching datasets: 'advanced/datasets.md'
- Display non-atlas volumes: 'advanced/otherVolumes.md'
- Release notes:
- v2.9.0: 'releases/v2.9.0.md'
- v2.8.0: 'releases/v2.8.0.md'
- v2.7.7: 'releases/v2.7.7.md'
- v2.7.6: 'releases/v2.7.6.md'
......
{
"name": "interactive-viewer",
"version": "2.8.0",
"version": "2.9.0",
"description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": {
"lint": "eslint src --ext .ts",
......
......@@ -115,10 +115,10 @@
<sxplr-sapiviews-features-connectivity-browser
class="pe-all flex-shrink-1"
[region]="region"
[types]="hasConnectivityDirective.availableModalities"
[sxplr-sapiviews-features-connectivity-browser-atlas]="atlas"
[sxplr-sapiviews-features-connectivity-browser-parcellation]="parcellation"
[accordionExpanded]="expandedPanel === CONST.CONNECTIVITY"
[types]="hasConnectivityDirective.availableModalities"
>
</sxplr-sapiviews-features-connectivity-browser>
</ng-template>
......
......@@ -108,7 +108,6 @@ describe('ConnectivityComponent', () => {
beforeEach(async () => {
fixture = TestBed.createComponent(ConnectivityBrowserComponent)
component = fixture.componentInstance
component.types = types
const atlas = 'atlases/juelich/iav/atlas/v1.0.0/1'
const parcellation = 'minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290'
......@@ -116,8 +115,7 @@ describe('ConnectivityComponent', () => {
component.atlas = { '@id': atlas } as SapiAtlasModel
component.parcellation = { '@id': parcellation } as SapiParcellationModel
component.selectType('StreamlineCounts')
component.types = types
const url = `${endp}/atlases/${encodeURIComponent(atlas)}/parcellations/${encodeURIComponent(parcellation)}/features?type=${component.selectedTypeId}&size=${100}&page=${1}`
......
......@@ -18,6 +18,7 @@ import { HttpClient } from "@angular/common/http";
@Component({
selector: 'sxplr-sapiviews-features-connectivity-browser',
templateUrl: './connectivityBrowser.template.html',
styleUrls: ['./connectivityBrowser.style.scss']
})
export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
......@@ -57,8 +58,6 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
}
@Input() types: SapiModalityModel[] = []
public selectedType: string
public selectedTypeId: string
public selectedCohort: string
......@@ -105,6 +104,16 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
public logDisabled: boolean = true
public logChecked: boolean = true
private _types: SapiModalityModel[] = []
@Input()
set types(val) {
this._types = val
if (val && val.length) this.selectType(val[0].name)
}
get types() {
return this._types
}
@ViewChild('connectivityComponent', {read: ElementRef}) public connectivityComponentElement: ElementRef<any>
@ViewChild('fullConnectivityGrid') public fullConnectivityGridElement: ElementRef<any>
......@@ -214,6 +223,7 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
this.cohorts = [...new Set(this.fetchedItems.map(item => item.cohort))]
this.fetching = false
this.changeDetectionRef.detectChanges()
this.selectCohort(this.cohorts[0])
}
})
}
......@@ -265,20 +275,23 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy {
}) : ds
fetchConnectivity(datasetId=null) {
this.sapi.getParcellation(this.atlas["@id"], this.parcellation["@id"]).getFeatureInstance(datasetId || this.selectedDataset['@id'])
.pipe(catchError(() => {
this.fetching = false
return of(null)
}))
.subscribe(ds=> {
this.selectedDataset = this.fixDatasetFormat(ds)
this.setMatrixData(ds)
this.fetching = false
})
const parcellation = this.sapi.getParcellation(this.atlas["@id"], this.parcellation["@id"])
if (parcellation) {
parcellation.getFeatureInstance(datasetId || this.selectedDataset['@id'])
.pipe(catchError(() => {
this.fetching = false
return of(null)
}))
.subscribe(ds => {
this.selectedDataset = this.fixDatasetFormat(ds)
this.setMatrixData(ds)
this.fetching = false
})
}
}
// ToDo need to be fixed on configuration side
fixHemisphereNaming(area) {
fixHemisphereNaming(area: string) {
if (area.includes(' - left hemisphere')) {
return area.replace('- left hemisphere', 'left')
} else if (area.includes(' - right hemisphere')) {
......
::ng-deep label {
margin-bottom: 0 !important;
}
\ No newline at end of file
......@@ -93,8 +93,16 @@
[disabled]="logDisabled || noConnectivityForRegion">Log 10</mat-checkbox>
<button mat-button [matMenuTriggerFor]="exportMenu"
[disabled]="!connectedAreas.value">
<i class="fas fa-download mb-2 mr-2"></i>
<label>Export</label>
<i class="fas fa-download mr-2"></i>
<span>Export</span>
</button>
<button *ngIf="selectedDataset" iav-stop="mousedown click" class="icons" mat-icon-button sxplr-dialog [sxplr-dialog-size]="null"
[sxplr-dialog-data]="{
title: selectedDataset?.name,
descMd: selectedDataset?.description + '' + selectedDataset?.authors.join(),
actions: selectedDataset | connectivityDoiPipe
}">
<i class="fas fa-info"></i>
</button>
</div>
......
import { Pipe, PipeTransform } from "@angular/core"
import { SapiParcellationFeatureModel } from "src/atlasComponents/sapi/type"
@Pipe({
name: 'connectivityDoiPipe',
pure: true
})
export class ConnectivityDoiPipe implements PipeTransform {
public transform(dataset: SapiParcellationFeatureModel): string[] {
const url = `https://search.kg.ebrains.eu/instances/${dataset['dataset_id']}`
return [url]
}
}
\ No newline at end of file
......@@ -5,16 +5,20 @@ import {ConnectivityBrowserComponent} from "src/atlasComponents/sapiViews/featur
import {HasConnectivity} from "src/atlasComponents/sapiViews/features/connectivity/hasConnectivity.directive";
import {AngularMaterialModule} from "src/sharedModules";
import {FormsModule} from "@angular/forms";
import { DialogModule } from "src/ui/dialogInfo";
import { ConnectivityDoiPipe } from "./connectivityDoi.pipe";
@NgModule({
imports: [
CommonModule,
FormsModule,
AngularMaterialModule
AngularMaterialModule,
DialogModule
],
declarations: [
ConnectivityBrowserComponent,
HasConnectivity
HasConnectivity,
ConnectivityDoiPipe
],
exports: [
ConnectivityBrowserComponent,
......
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