diff --git a/docs/releases/v2.5.5.md b/docs/releases/v2.5.5.md new file mode 100644 index 0000000000000000000000000000000000000000..cc33173305d0da142c2bf34b94b9926e1e123be1 --- /dev/null +++ b/docs/releases/v2.5.5.md @@ -0,0 +1,10 @@ +# v2.5.5 + +## Feature + +- Added pre-release warning + +## Under the hood + +- Temporarily use up-to-date endpoint for MEBRAINS +- Add fsaverage to checklist diff --git a/e2e/checklist.md b/e2e/checklist.md index 7577819cb3cf150a1fc8588a165c9224b57290c0..fbe5c5240c08d8f8a88760a51d278bb0325dc2b5 100644 --- a/e2e/checklist.md +++ b/e2e/checklist.md @@ -46,6 +46,11 @@ - [ ] the navigation should be preserved - [ ] in big brain v2.9 (or latest) - [ ] high res hoc1, hoc2, hoc3, lam1-6 are visible + - [ ] pli dataset [link](https://siibra-explorer.apps.hbp.eu/staging/?templateSelected=Big+Brain+%28Histology%29&parcellationSelected=Grey%2FWhite+matter&cNavigation=0.0.0.-W000.._eCwg.2-FUe3._-s_W.2_evlu..7LIx..1uaTK.Bq5o~.lKmo~..NBW&previewingDatasetFiles=%5B%7B%22datasetId%22%3A%22minds%2Fcore%2Fdataset%2Fv1.0.0%2Fb08a7dbc-7c75-4ce7-905b-690b2b1e8957%22%2C%22filename%22%3A%22Overlay+of+data+modalities%22%7D%5D) + - [ ] redirects fine + - [ ] shows fine + - [ ] fsaverage + - [ ] can be loaded & visible - [ ] Waxholm - [ ] v4 are visible - [ ] on hover, show correct region name(s) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 476dfab49e8293f4cb00942adf79868386926570..f518f97c0be45a63b2ca5579a32b335108810fd3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ pages: - Fetching datasets: 'advanced/datasets.md' - Display non-atlas volumes: 'advanced/otherVolumes.md' - Release notes: + - v2.5.5: 'releases/v2.5.5.md' - v2.5.4: 'releases/v2.5.4.md' - v2.5.3: 'releases/v2.5.3.md' - v2.5.2: 'releases/v2.5.2.md' diff --git a/package.json b/package.json index 0f3aae01c1446f0e95a11d8265e25f925317d8d3..f84133d130a8f7ee46363b06b3036ebfcf72393b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "interactive-viewer", - "version": "2.5.4", + "version": "2.5.5", "description": "HBP interactive atlas viewer. Integrating KG query, dataset previews & more. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular", "scripts": { "build-aot": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'` ng build && node ./third_party/matomo/processMatomo.js", diff --git a/src/components/confirmDialog/confirmDialog.component.ts b/src/components/confirmDialog/confirmDialog.component.ts index ec2e20c9fb6469c9ec26f88c77b73f50a77c57d3..8361ee409762ebccccfb6ae9c85d064207587dfc 100644 --- a/src/components/confirmDialog/confirmDialog.component.ts +++ b/src/components/confirmDialog/confirmDialog.component.ts @@ -25,15 +25,19 @@ export class ConfirmDialogComponent { @Input() public markdown: string + @Input() + public confirmOnly: boolean = false + public hideActionBar = false constructor(@Inject(MAT_DIALOG_DATA) data: any) { - const { title = null, message = null, markdown, okBtnText, cancelBtnText, hideActionBar} = data || {} + const { title = null, message = null, markdown, okBtnText, cancelBtnText, hideActionBar, confirmOnly} = data || {} if (title) this.title = title if (message) this.message = message if (markdown) this.markdown = markdown if (okBtnText) this.okBtnText = okBtnText if (cancelBtnText) this.cancelBtnText = cancelBtnText if (hideActionBar) this.hideActionBar = hideActionBar + if (confirmOnly) this.confirmOnly = confirmOnly } } diff --git a/src/components/confirmDialog/confirmDialog.template.html b/src/components/confirmDialog/confirmDialog.template.html index f5f0549460e034215176f4393e3ea2507c83533d..8b8a0224a96105f7b475cfc587d2a25d11932b23 100644 --- a/src/components/confirmDialog/confirmDialog.template.html +++ b/src/components/confirmDialog/confirmDialog.template.html @@ -18,6 +18,6 @@ <mat-divider></mat-divider> <mat-dialog-actions *ngIf="!hideActionBar" class="justify-content-start flex-row-reverse"> - <button [mat-dialog-close]="true" mat-raised-button color="primary">{{ okBtnText }}</button> - <button [mat-dialog-close]="false" mat-button>{{ cancelBtnText }}</button> + <button [mat-dialog-close]="true" mat-raised-button color="primary">{{ okBtnText }}</button> + <button *ngIf="!confirmOnly" [mat-dialog-close]="false" mat-button>{{ cancelBtnText }}</button> </mat-dialog-actions> diff --git a/src/services/dialogService.service.ts b/src/services/dialogService.service.ts index eb0844dd7f3102b921fbe30de7a21a86280fe577..933b862275ca6838deb4ebabec3768ff604e4769 100644 --- a/src/services/dialogService.service.ts +++ b/src/services/dialogService.service.ts @@ -82,4 +82,5 @@ export interface DialogConfig { message: string markdown?: string iconClass: string + confirmOnly: boolean } diff --git a/src/util/pureConstant.service.ts b/src/util/pureConstant.service.ts index 609ebb9c43dcc51142a12a55783077a1cf65c392..22ab44b8c6b69b75b4aed5659a685f8d63bf9458 100644 --- a/src/util/pureConstant.service.ts +++ b/src/util/pureConstant.service.ts @@ -17,7 +17,7 @@ import { MatSnackBar } from "@angular/material/snack-bar"; import { TTemplateImage } from "./interfaces"; export const SIIBRA_API_VERSION_HEADER_KEY='x-siibra-api-version' -export const SIIBRA_API_VERSION = '0.1.5' +export const SIIBRA_API_VERSION = '0.1.6' const validVolumeType = new Set([ 'neuroglancer/precomputed', @@ -577,25 +577,6 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}" ? 'right hemisphere' : 'whole brain' - /** - * TODO fix in siibra-api - */ - if ( - tmpl.id !== 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588' - && parc.id === 'minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290' - && hemisphereKey === 'whole brain' - ) { - region.labelIndex = null - return - } - - if ( - tmpl.id === 'minds/core/referencespace/v1.0.0/a1655b99-82f1-420f-a3c2-fe80fd4c8588' - && parc.id === 'minds/core/parcellationatlas/v1.0.0/94c1125b-b87e-45e4-901c-00daee7f2579-290' - && hemisphereKey === 'whole brain' - ) { - region.children = [] - } if (!region['ngId']) { const hemispheredNgId = getNgId(atlas['@id'], tmpl.id, parc.id, hemisphereKey) region['ngId'] = hemispheredNgId @@ -751,12 +732,15 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}" const precomputedArr = tmpl._dataset_specs.filter(src => src['@type'] === 'fzj/tmp/volume_type/v0.0.1' && src.volume_type === 'neuroglancer/precomputed') as TVolumeSrc<'neuroglancer/precomputed'>[] let visible = true let tmplNgId: string - let templateImages: TTemplateImage[] = [] + const templateImages: TTemplateImage[] = [] for (const precomputedItem of precomputedArr) { const ngIdKey = MultiDimMap.GetKey(precomputedItem["@id"]) + const precomputedUrl = 'https://neuroglancer.humanbrainproject.eu/precomputed/data-repo-ng-bot/20211001-mebrain/precomputed/images/MEBRAINS_T1.masked' === precomputedItem.url + ? 'https://neuroglancer.humanbrainproject.eu/precomputed/data-repo-ng-bot/20211018-mebrains-masked-templates/precomputed/images/MEBRAINS_T1_masked' + : precomputedItem.url initialLayers[ngIdKey] = { type: "image", - source: `precomputed://${precomputedItem.url}`, + source: `precomputed://${precomputedUrl}`, transform: precomputedItem.detail['neuroglancer/precomputed'].transform, visible } diff --git a/src/viewerModule/viewerCmp/viewerCmp.component.ts b/src/viewerModule/viewerCmp/viewerCmp.component.ts index bb0c20a548bf82504019a4fe307c180d6d498d4b..27c6eac25d510299e06a38c8e5be1814acb3d8c7 100644 --- a/src/viewerModule/viewerCmp/viewerCmp.component.ts +++ b/src/viewerModule/viewerCmp/viewerCmp.component.ts @@ -1,10 +1,11 @@ import { Component, ComponentFactory, ComponentFactoryResolver, ElementRef, Inject, Injector, Input, OnDestroy, Optional, TemplateRef, ViewChild, ViewContainerRef } from "@angular/core"; import { select, Store } from "@ngrx/store"; import {combineLatest, merge, NEVER, Observable, of, Subject, Subscription} from "rxjs"; -import {catchError, distinctUntilChanged, filter, map, shareReplay, startWith, switchMap } from "rxjs/operators"; +import {catchError, debounceTime, distinctUntilChanged, filter, map, shareReplay, startWith, switchMap } from "rxjs/operators"; import { viewerStateSetSelectedRegions } from "src/services/state/viewerState/actions"; import { viewerStateContextedSelectedRegionsSelector, + viewerStateGetSelectedAtlas, viewerStateSelectedParcellationSelector, viewerStateSelectedTemplateSelector, viewerStateStandAloneVolumes, @@ -25,6 +26,7 @@ import { MAT_DIALOG_DATA } from "@angular/material/dialog"; import { GenericInfoCmp } from "src/atlasComponents/regionalFeatures/bsFeatures/genericInfo"; import { _PLI_VOLUME_INJ_TOKEN, _TPLIVal } from "src/glue"; import { uiActionSetPreviewingDatasetFiles } from "src/services/state/uiState.store.helper"; +import { DialogService } from "src/services/dialogService.service"; type TCStoreViewerCmp = { overlaySideNav: any @@ -112,7 +114,8 @@ export function ROIFactory(store: Store<any>, svc: PureContantService){ }, deps: [ ComponentStore ] }, - ComponentStore + ComponentStore, + DialogService ] }) @@ -234,6 +237,7 @@ export class ViewerCmp implements OnDestroy { private viewerModuleSvc: ContextMenuService<TContextArg<'threeSurfer' | 'nehuba'>>, private cStore: ComponentStore<TCStoreViewerCmp>, cfr: ComponentFactoryResolver, + private dialogSvc: DialogService, @Optional() @Inject(_PLI_VOLUME_INJ_TOKEN) private _pliVol$: Observable<_TPLIVal[]>, @Optional() @Inject(REGION_OF_INTEREST) public regionOfInterest$: Observable<any> ){ @@ -271,7 +275,45 @@ export class ViewerCmp implements OnDestroy { ? getGetRegionFromLabelIndexId({ parcellation: p }) : null } - ) + ), + combineLatest([ + this.templateSelected$, + this.parcellationSelected$, + this.store$.pipe( + select(viewerStateGetSelectedAtlas) + ) + ]).pipe( + debounceTime(160) + ).subscribe(async ([tmpl, parc, atlas]) => { + const regex = /pre.?release/i + const checkPrerelease = (obj: any) => { + if (obj?.name) return regex.test(obj.name) + return false + } + const message: string[] = [] + if (checkPrerelease(atlas)) { + message.push(`- _${atlas.name}_`) + } + if (checkPrerelease(tmpl)) { + message.push(`- _${tmpl.name}_`) + } + if (checkPrerelease(parc)) { + message.push(`- _${parc.name}_`) + } + if (message.length > 0) { + message.unshift(`The following have been tagged pre-release, and may be updated frequently:`) + try { + await this.dialogSvc.getUserConfirm({ + title: `Pre-release warning`, + markdown: message.join('\n\n'), + confirmOnly: true + }) + // eslint-disable-next-line @typescript-eslint/no-empty + } catch (e) { + + } + } + }) ) }