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

fixed point assignment in labelled maps

parent 747c58ad
No related branches found
No related tags found
No related merge requests found
# v2.11.3
## Bugfixes
- Fixed point assignment for maps that do not have statistical maps. Also fixed error messages.
\ No newline at end of file
......@@ -33,6 +33,7 @@ nav:
- Fetching datasets: 'advanced/datasets.md'
- Display non-atlas volumes: 'advanced/otherVolumes.md'
- Release notes:
- v2.11.3: 'releases/v2.11.3.md'
- v2.11.2: 'releases/v2.11.2.md'
- v2.11.1: 'releases/v2.11.1.md'
- v2.11.0: 'releases/v2.11.0.md'
......
{
"name": "siibra-explorer",
"version": "2.10.0",
"version": "2.11.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "siibra-explorer",
"version": "2.10.0",
"version": "2.11.2",
"license": "apache-2.0",
"dependencies": {
"@angular/animations": "^14.2.12",
{
"name": "siibra-explorer",
"version": "2.11.2",
"version": "2.11.3",
"description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": {
"lint": "eslint src --ext .ts",
......
......@@ -642,12 +642,6 @@ export interface components {
*/
ontologyIdentifier?: (string)[]
}
/**
* ImageTypes
* @description An enumeration.
* @enum {unknown}
*/
ImageTypes: "BlockfaceVolumeOfInterest" | "CellBodyStainedVolumeOfInterest" | "CellbodyStainedSection" | "MRIVolumeOfInterest" | "PLIVolumeOfInterest" | "SegmentedVolumeOfInterest" | "XPCTVolumeOfInterest"
/** LocationModel */
LocationModel: {
/** @Type */
......@@ -1237,12 +1231,6 @@ export interface components {
/** Max */
max: number
}
/**
* TabularTypes
* @description An enumeration.
* @enum {unknown}
*/
TabularTypes: "ReceptorDensityFingerprint" | "LayerwiseBigBrainIntensities" | "LayerwiseCellDensity" | "RegionalBOLD"
/** ValidationError */
ValidationError: {
/** Location */
......@@ -1677,6 +1665,7 @@ export interface operations {
parcellation_id: string
space_id: string
point: string
assignment_type?: string
sigma_mm?: number
}
}
......@@ -1902,7 +1891,7 @@ export interface operations {
query: {
parcellation_id: string
region_id: string
type?: components["schemas"]["TabularTypes"]
type?: string
page?: number
size?: number
}
......@@ -1928,7 +1917,7 @@ export interface operations {
query: {
parcellation_id: string
region_id: string
type?: components["schemas"]["TabularTypes"]
type?: string
}
path: {
feature_id: string
......@@ -1955,7 +1944,7 @@ export interface operations {
query: {
space_id: string
bbox?: string
type?: components["schemas"]["ImageTypes"]
type?: string
page?: number
size?: number
}
......@@ -1980,7 +1969,7 @@ export interface operations {
parameters: {
query: {
space_id: string
type?: components["schemas"]["ImageTypes"]
type?: string
}
path: {
feature_id: string
......
<div class="sxplr-m-2" *ngIf="busy$ | async">
<div class="sxplr-m-2" *ngIf="busy$ | async as busyMessage">
<spinner-cmp class="sxplr-d-inline-block"></spinner-cmp>
<span>
Performing probabilistic assignment ...
{{ busyMessage }}
</span>
</div>
<div class="sxplr-m-2" *ngIf="error$ | async">
<span>
An error occurred when performing map assignment.
</span>
</div>
......
import { Component, Input, OnDestroy, Output, TemplateRef, EventEmitter } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { BehaviorSubject, EMPTY, Observable, Subscription, combineLatest, concat, of } from 'rxjs';
import { map, shareReplay, switchMap, tap } from 'rxjs/operators';
import { catchError, map, shareReplay, switchMap, tap } from 'rxjs/operators';
import { SAPI, EXPECTED_SIIBRA_API_VERSION } from 'src/atlasComponents/sapi/sapi.service';
import { SxplrParcellation, SxplrRegion, SxplrTemplate } from 'src/atlasComponents/sapi/sxplrTypes';
import { translateV3Entities } from 'src/atlasComponents/sapi/translateV3';
......@@ -10,6 +10,9 @@ import { TSandsPoint } from 'src/util/types';
import { TZipFileConfig } from "src/zipFilesOutput/type"
import { environment } from "src/environments/environment"
const DOING_PROB_ASGMT = "Performing probabilistic assignment ..."
const DOING_LABEL_ASGMT = "Probabilistic assignment failed. Performing labelled assignment ..."
@Component({
selector: 'sxplr-point-assignment',
templateUrl: './point-assignment.component.html',
......@@ -22,9 +25,12 @@ export class PointAssignmentComponent implements OnDestroy {
"map value",
]
#busy$ = new BehaviorSubject(false)
#busy$ = new BehaviorSubject<string>(null)
busy$ = this.#busy$.asObservable()
#error$ = new BehaviorSubject<string>(null)
error$ = this.#error$.asObservable()
#point = new BehaviorSubject<TSandsPoint>(null)
@Input()
set point(val: TSandsPoint) {
......@@ -52,6 +58,9 @@ export class PointAssignmentComponent implements OnDestroy {
this.#template,
]).pipe(
switchMap(([ point, parcellation, template ]) => {
this.#error$.next(null)
if (!point || !parcellation || !template) {
return EMPTY
}
......@@ -60,7 +69,7 @@ export class PointAssignmentComponent implements OnDestroy {
console.warn(`point coordination space id ${ptSpaceId} is not the same as template id ${template.id}.`)
return EMPTY
}
this.#busy$.next(true)
this.#busy$.next(DOING_PROB_ASGMT)
return concat(
of(null),
this.sapi.v3Get("/map/assign", {
......@@ -71,7 +80,24 @@ export class PointAssignmentComponent implements OnDestroy {
sigma_mm: 0
}
}).pipe(
tap(() => this.#busy$.next(false)),
catchError(() => {
this.#busy$.next(DOING_LABEL_ASGMT)
return this.sapi.v3Get("/map/assign", {
query: {
parcellation_id: parcellation.id,
point: point.coordinates.map(v => `${v.value/1e6}mm`).join(','),
space_id: template.id,
sigma_mm: 0,
assignment_type: "labelled"
}
})
}),
catchError((err) => {
this.#busy$.next(null)
this.#error$.next(err.toString())
return of(null)
}),
tap(() => this.#busy$.next(null)),
)
)
}),
......
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