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

chore: move to ROI during preview

parent f2d91170
No related branches found
No related tags found
No related merge requests found
...@@ -194,9 +194,14 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets ...@@ -194,9 +194,14 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets
if (ds.parcellationRegion.length === 0) return false if (ds.parcellationRegion.length === 0) return false
let useSet let useSet
// temporary measure
// TODO ask curaion team re name of jubrain atlas
let overwriteParcellationName
switch (parcellationName) { switch (parcellationName) {
case 'JuBrain Cytoarchitectonic Atlas': case 'JuBrain Cytoarchitectonic Atlas':
useSet = juBrainSet useSet = juBrainSet
overwriteParcellationName = 'Jülich Cytoarchitechtonic Brain Atlas (human)'
break; break;
case 'Fibre Bundle Atlas - Short Bundle': case 'Fibre Bundle Atlas - Short Bundle':
useSet = shortBundleSet useSet = shortBundleSet
...@@ -222,7 +227,7 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets ...@@ -222,7 +227,7 @@ const filter = (datasets = [], { templateName, parcellationName }) => datasets
default: default:
useSet = new Set() 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 return false
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -155,6 +155,7 @@ export interface ViewerPreviewFile{ ...@@ -155,6 +155,7 @@ export interface ViewerPreviewFile{
mimetype: string mimetype: string
url?: string url?: string
data?: any data?: any
position?: any
} }
export interface FileSupplementData{ export interface FileSupplementData{
......
...@@ -6,9 +6,10 @@ import { ViewerPreviewFile, DataEntry } from "src/services/state/dataStore.store ...@@ -6,9 +6,10 @@ import { ViewerPreviewFile, DataEntry } from "src/services/state/dataStore.store
import { determinePreviewFileType, PREVIEW_FILE_TYPES } from "./preview/previewFileIcon.pipe"; import { determinePreviewFileType, PREVIEW_FILE_TYPES } from "./preview/previewFileIcon.pipe";
import { MatDialog } from "@angular/material"; import { MatDialog } from "@angular/material";
import { FileViewer } from "./fileviewer/fileviewer.component"; 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 { Subscription, Subject } from "rxjs";
import { HttpClient } from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import { DialogService } from "src/services/dialogService.service";
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class KgSingleDatasetService implements OnDestroy{ export class KgSingleDatasetService implements OnDestroy{
...@@ -22,7 +23,8 @@ export class KgSingleDatasetService implements OnDestroy{ ...@@ -22,7 +23,8 @@ export class KgSingleDatasetService implements OnDestroy{
private constantService: AtlasViewerConstantsServices, private constantService: AtlasViewerConstantsServices,
private store$: Store<any>, private store$: Store<any>,
private dialog: MatDialog, private dialog: MatDialog,
private http: HttpClient private http: HttpClient,
private dialogService: DialogService
) { ) {
this.subscriptions.push( this.subscriptions.push(
...@@ -95,6 +97,25 @@ export class KgSingleDatasetService implements OnDestroy{ ...@@ -95,6 +97,25 @@ export class KgSingleDatasetService implements OnDestroy{
file, file,
dataset 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) const type = determinePreviewFileType(file)
if (type === PREVIEW_FILE_TYPES.NIFTI) { if (type === PREVIEW_FILE_TYPES.NIFTI) {
this.store$.dispatch({ this.store$.dispatch({
...@@ -105,6 +126,8 @@ export class KgSingleDatasetService implements OnDestroy{ ...@@ -105,6 +126,8 @@ export class KgSingleDatasetService implements OnDestroy{
this.showNewNgLayer({ url }) this.showNewNgLayer({ url })
return return
} }
this.dialog.open(FileViewer, { this.dialog.open(FileViewer, {
data: { data: {
previewFile: file 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