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

chore: fix package.json version

feat: local nifti control
parent 9fb6704b
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,10 @@ ...@@ -69,7 +69,10 @@
USER_ANNOTATION_HIDE: 'user annotations hide', USER_ANNOTATION_HIDE: 'user annotations hide',
USER_ANNOTATION_DELETE: 'Delete annotation', USER_ANNOTATION_DELETE: 'Delete annotation',
GOTO_ANNOTATION_ROI: 'Navigate to annotation location of interest', GOTO_ANNOTATION_ROI: 'Navigate to annotation location of interest',
EXIT_ANNOTATION_MODE: 'Exit annotation mode' EXIT_ANNOTATION_MODE: 'Exit annotation mode',
// volume tuning specific
VOLUME_TUNING_EXPAND: 'Expand volume tuning widget'
} }
exports.IDS = { exports.IDS = {
......
...@@ -104,6 +104,7 @@ module.exports = { ...@@ -104,6 +104,7 @@ module.exports = {
'unpkg.com/kg-dataset-previewer@1.2.0/', // preview component 'unpkg.com/kg-dataset-previewer@1.2.0/', // preview component
'cdnjs.cloudflare.com/ajax/libs/mathjax/', // math jax 'cdnjs.cloudflare.com/ajax/libs/mathjax/', // math jax
'https://unpkg.com/three-surfer@0.0.10/dist/bundle.js', // for threeSurfer (freesurfer support in browser) 'https://unpkg.com/three-surfer@0.0.10/dist/bundle.js', // for threeSurfer (freesurfer support in browser)
'https://unpkg.com/ng-layer-tune@0.0.1/dist/ng-layer-tune/ng-layer-tune.esm.js', // needed for ng layer control
(req, res) => res.locals.nonce ? `'nonce-${res.locals.nonce}'` : null, (req, res) => res.locals.nonce ? `'nonce-${res.locals.nonce}'` : null,
...SCRIPT_SRC, ...SCRIPT_SRC,
...WHITE_LIST_SRC, ...WHITE_LIST_SRC,
......
{ {
"name": "interactive-viewer", "name": "interactive-viewer",
"version": "2.4.0", "version": "2.5.0",
"description": "HBP interactive atlas viewer. Integrating KG query, dataset previews & more. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular", "description": "HBP interactive atlas viewer. Integrating KG query, dataset previews & more. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": { "scripts": {
"build-aot": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'` ng build && node ./third_party/matomo/processMatomo.js", "build-aot": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'` ng build && node ./third_party/matomo/processMatomo.js",
......
...@@ -340,11 +340,6 @@ markdown-dom p ...@@ -340,11 +340,6 @@ markdown-dom p
max-width: 20em!important; max-width: 20em!important;
} }
.w-90
{
width: 90%!important;
}
.w-20em .w-20em
{ {
width: 20em!important; width: 20em!important;
...@@ -858,9 +853,7 @@ mat-list.sm mat-list-item ...@@ -858,9 +853,7 @@ mat-list.sm mat-list-item
.no-padding-dialog > mat-dialog-container .no-padding-dialog > mat-dialog-container
{ {
padding-top:0 !important; padding:0 !important;
padding-right:0 !important;
padding-left:0 !important;
} }
.h-50px .h-50px
{ {
...@@ -870,3 +863,26 @@ mat-list.sm mat-list-item ...@@ -870,3 +863,26 @@ mat-list.sm mat-list-item
{ {
transform: scale(0.8); transform: scale(0.8);
} }
.grid
{
display: grid;
}
.grid.grid-col-3
{
grid-auto-columns: 1fr;
grid-template-columns: 1fr auto auto;
gap: 0.2rem 0.2rem;
}
.grid > .grid-wide-3
{
grid-column: 1 / 4;
}
.v-center-text-span
{
margin-top: auto;
margin-bottom: auto;
}
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<script src="https://unpkg.com/kg-dataset-previewer@1.2.0/dist/kg-dataset-previewer/kg-dataset-previewer.js" defer> <script src="https://unpkg.com/kg-dataset-previewer@1.2.0/dist/kg-dataset-previewer/kg-dataset-previewer.js" defer>
</script> </script>
<script src="https://unpkg.com/three-surfer@0.0.10/dist/bundle.js" defer></script> <script src="https://unpkg.com/three-surfer@0.0.10/dist/bundle.js" defer></script>
<script type="module" src="https://unpkg.com/ng-layer-tune@0.0.1/dist/ng-layer-tune/ng-layer-tune.esm.js"></script>
<title>Interactive Atlas Viewer</title> <title>Interactive Atlas Viewer</title>
</head> </head>
<body> <body>
......
import { NgModule } from "@angular/core"; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
import { NehubaViewerContainerDirective } from './nehubaViewerInterface/nehubaViewerInterface.directive' import { NehubaViewerContainerDirective } from './nehubaViewerInterface/nehubaViewerInterface.directive'
import { IMPORT_NEHUBA_INJECT_TOKEN, NehubaViewerUnit } from "./nehubaViewer/nehubaViewer.component"; import { IMPORT_NEHUBA_INJECT_TOKEN, NehubaViewerUnit } from "./nehubaViewer/nehubaViewer.component";
import { CommonModule } from "@angular/common"; import { CommonModule } from "@angular/common";
...@@ -81,6 +81,9 @@ import { DragDropFileModule } from "src/dragDropFile/module"; ...@@ -81,6 +81,9 @@ import { DragDropFileModule } from "src/dragDropFile/module";
provide: NEHUBA_INSTANCE_INJTKN, provide: NEHUBA_INSTANCE_INJTKN,
useValue: new BehaviorSubject(null) useValue: new BehaviorSubject(null)
} }
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
] ]
}) })
......
import { AfterViewInit, Component, ElementRef, EventEmitter, Inject, Input, OnChanges, OnDestroy, Optional, Output, SimpleChanges, ViewChild } from "@angular/core"; import { AfterViewInit, Component, ElementRef, EventEmitter, Inject, Input, OnChanges, OnDestroy, Optional, Output, SimpleChanges, TemplateRef, ViewChild } from "@angular/core";
import { select, Store } from "@ngrx/store"; import { select, Store } from "@ngrx/store";
import { asyncScheduler, combineLatest, fromEvent, merge, NEVER, Observable, of, Subject } from "rxjs"; import { asyncScheduler, combineLatest, fromEvent, merge, NEVER, Observable, of, Subject } from "rxjs";
import { ngViewerActionToggleMax } from "src/services/state/ngViewerState/actions"; import { ngViewerActionToggleMax } from "src/services/state/ngViewerState/actions";
...@@ -29,6 +29,7 @@ import { NG_LAYER_CONTROL, SET_SEGMENT_VISIBILITY } from "../layerCtrl.service/l ...@@ -29,6 +29,7 @@ import { NG_LAYER_CONTROL, SET_SEGMENT_VISIBILITY } from "../layerCtrl.service/l
import { MatSnackBar } from "@angular/material/snack-bar"; import { MatSnackBar } from "@angular/material/snack-bar";
import { getShader } from "src/util/constants"; import { getShader } from "src/util/constants";
import { EnumColorMapName } from "src/util/colorMaps"; import { EnumColorMapName } from "src/util/colorMaps";
import { MatDialog } from "@angular/material/dialog";
export const INVALID_FILE_INPUT = `Exactly one (1) nifti file is required!` export const INVALID_FILE_INPUT = `Exactly one (1) nifti file is required!`
...@@ -72,6 +73,8 @@ export const INVALID_FILE_INPUT = `Exactly one (1) nifti file is required!` ...@@ -72,6 +73,8 @@ export const INVALID_FILE_INPUT = `Exactly one (1) nifti file is required!`
export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, AfterViewInit { export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, AfterViewInit {
@ViewChild('layerCtrlTmpl', { read: TemplateRef }) layerCtrlTmpl: TemplateRef<any>
public ARIA_LABELS = ARIA_LABELS public ARIA_LABELS = ARIA_LABELS
public IDS = IDS public IDS = IDS
...@@ -307,6 +310,7 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, A ...@@ -307,6 +310,7 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, A
private el: ElementRef, private el: ElementRef,
private log: LoggingService, private log: LoggingService,
private snackbar: MatSnackBar, private snackbar: MatSnackBar,
private dialog: MatDialog,
@Optional() @Inject(CLICK_INTERCEPTOR_INJECTOR) clickInterceptor: ClickInterceptor, @Optional() @Inject(CLICK_INTERCEPTOR_INJECTOR) clickInterceptor: ClickInterceptor,
@Optional() @Inject(API_SERVICE_SET_VIEWER_HANDLE_TOKEN) setViewerHandle: TSetViewerHandle, @Optional() @Inject(API_SERVICE_SET_VIEWER_HANDLE_TOKEN) setViewerHandle: TSetViewerHandle,
@Optional() private layerCtrlService: NehubaLayerControlService, @Optional() private layerCtrlService: NehubaLayerControlService,
...@@ -744,13 +748,28 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, A ...@@ -744,13 +748,28 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnChanges, OnDestroy, A
}) })
}]) }])
this.snackbar.open( this.dialog.open(
`Viewing ${file.name}`, this.layerCtrlTmpl,
'Clear', {
{ duration: 0 } data: {
).afterDismissed().subscribe(() => { layerName: randomUuid,
this.dismissAllAddedLayers() filename: file.name,
}) moreInfoFlag: false
},
hasBackdrop: false,
disableClose: true,
position: {
top: '0em'
},
autoFocus: false,
panelClass: [
'no-padding-dialog',
'w-100'
]
}
).afterClosed().subscribe(
() => this.dismissAllAddedLayers()
)
} }
......
...@@ -190,3 +190,36 @@ ...@@ -190,3 +190,36 @@
</g> </g>
</svg> </svg>
</ng-template> </ng-template>
<ng-template #layerCtrlTmpl let-data>
<div class="grid grid-col-3">
<span class="ml-2 text-truncate v-center-text-span">
<i class="fas fa-file"></i>
{{ data.filename }}
</span>
<button
[matTooltip]="ARIA_LABELS.VOLUME_TUNING_EXPAND"
mat-icon-button
[color]="data.moreInfoFlag ? 'primary' : 'basic'"
(click)="data.moreInfoFlag = !data.moreInfoFlag">
<i class="fas fa-sliders-h"></i>
</button>
<button
[matTooltip]="ARIA_LABELS.CLOSE"
color="warn"
mat-icon-button
mat-dialog-close>
<i class="fas fa-trash"></i>
</button>
<div *ngIf="data.moreInfoFlag"
class="iv-custom-comp darker-bg overflow-hidden grid-wide-3">
<ng-layer-tune [ngLayerName]="data.layerName">
</ng-layer-tune>
</div>
</div>
</ng-template>
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