Skip to content
Snippets Groups Projects
Unverified Commit 0eb4d099 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #352 from HumanBrainProject/chore/moveToROIDuringPreview

chore: move to ROI during preview
parents 453d986b 07b928c3
No related branches found
No related tags found
No related merge requests found
......@@ -194,9 +194,14 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets
if (ds.parcellationRegion.length === 0) return false
let useSet
// temporary measure
// TODO ask curaion team re name of jubrain atlas
let overwriteParcellationName
switch (parcellationName) {
case 'JuBrain Cytoarchitectonic Atlas':
useSet = juBrainSet
overwriteParcellationName = 'Jülich Cytoarchitechtonic Brain Atlas (human)'
break;
case 'Fibre Bundle Atlas - Short Bundle':
useSet = shortBundleSet
......@@ -222,7 +227,7 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets
default:
useSet = new Set()
}
return filterByPRName({ dataset: ds, parcellationName }) && filterByPRSet(ds.parcellationRegion, useSet)
return filterByPRName({ dataset: ds, parcellationName: overwriteParcellationName || parcellationName }) && filterByPRSet(ds.parcellationRegion, useSet)
}
return false
......
This diff is collapsed.
......@@ -155,6 +155,7 @@ export interface ViewerPreviewFile{
mimetype: string
url?: string
data?: any
position?: any
}
export interface FileSupplementData{
......
......@@ -6,9 +6,10 @@ import { ViewerPreviewFile, DataEntry } from "src/services/state/dataStore.store
import { determinePreviewFileType, PREVIEW_FILE_TYPES } from "./preview/previewFileIcon.pipe";
import { MatDialog } from "@angular/material";
import { FileViewer } from "./fileviewer/fileviewer.component";
import { ADD_NG_LAYER, REMOVE_NG_LAYER } from "src/services/stateStore.service";
import { ADD_NG_LAYER, REMOVE_NG_LAYER, CHANGE_NAVIGATION } from "src/services/stateStore.service";
import { Subscription, Subject } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { DialogService } from "src/services/dialogService.service";
@Injectable({ providedIn: 'root' })
export class KgSingleDatasetService implements OnDestroy{
......@@ -22,7 +23,8 @@ export class KgSingleDatasetService implements OnDestroy{
private constantService: AtlasViewerConstantsServices,
private store$: Store<any>,
private dialog: MatDialog,
private http: HttpClient
private http: HttpClient,
private dialogService: DialogService
) {
this.subscriptions.push(
......@@ -95,6 +97,25 @@ export class KgSingleDatasetService implements OnDestroy{
file,
dataset
})
const { position, name } = file
if (position) {
this.dialogService.getUserConfirm({
message: `The file - ${name} - has a position of interest defined. Navigate to it?`,
title: `Navigate to ROI`,
})
.then(() => {
this.store$.dispatch({
type: CHANGE_NAVIGATION,
navigation: {
position,
animation: {}
}
})
})
.catch()
}
const type = determinePreviewFileType(file)
if (type === PREVIEW_FILE_TYPES.NIFTI) {
this.store$.dispatch({
......@@ -105,6 +126,8 @@ export class KgSingleDatasetService implements OnDestroy{
this.showNewNgLayer({ url })
return
}
this.dialog.open(FileViewer, {
data: {
previewFile: file
......
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