From 640ea0f08c50b79d2149aed910194d38606a42f3 Mon Sep 17 00:00:00 2001 From: Samantha Kraft Date: Fri, 5 Jul 2024 14:08:43 -0400 Subject: [PATCH] added all calls for image selector. made model for image selector and build table functionality --- src/assets/Model.js | 5 +- src/components/FlatmapViewer.vue | 49 ++++++++++- src/components/ImageSelector.vue | 18 +++-- src/components/QDBGraph.vue | 1 + src/devComponents/ImageSelector/ImageModel.js | 37 +++++++++ src/services/qdb.js | 4 +- src/stores/locationSelect.js | 81 +++++++++++++++++++ 7 files changed, 181 insertions(+), 14 deletions(-) create mode 100644 src/devComponents/ImageSelector/ImageModel.js create mode 100644 src/stores/locationSelect.js diff --git a/src/assets/Model.js b/src/assets/Model.js index 488800a..c768dcb 100644 --- a/src/assets/Model.js +++ b/src/assets/Model.js @@ -13,8 +13,9 @@ class Img export class Dataset { constructor(dataset){ - this.Imgs = []; - dataset.forEach((img)=>this.Imgs.push(new Img(img))); + this.name = dataset.ImgName, + this.size = "...", + this.path = dataset.Path } } diff --git a/src/components/FlatmapViewer.vue b/src/components/FlatmapViewer.vue index 83c6c02..6d2c537 100644 --- a/src/components/FlatmapViewer.vue +++ b/src/components/FlatmapViewer.vue @@ -13,11 +13,13 @@ import { ref, inject, nextTick} from "vue"; import {FlatmapVuer, MultiFlatmapVuer} from '@abi-software/flatmapvuer'; import { useOpenerStore } from "../stores/opener"; + import { useLocationStore} from "../stores/locationSelect"; FlatmapVuer.props.flatmapAPI.default="https://mapcore-demo.org/devel/flatmap/v4/"; const disableFlatmapUI = true; let FlatmapReady = false; - + const locationStore = useLocationStore(); + locationStore.init() const emit = defineEmits(['setTitle']); emit('setTitle','Flatmap Selector'); @@ -31,11 +33,50 @@ function FlatmapSelected(data){ if(locationId===data.feature.featureId){return;} locationId = data.feature.featureId; locationLabel.value = data.label; + const locationMinMax = tempMapToMinMax(locationId); //send to image selector - emitter.emit("anatomical-location-selected",locationId) + emitter.emit("anatomical-location-selected",locationMinMax) +} +//this function is my temp work around to not having the map return anything useful +function tempMapToMinMax(id){ + switch(id) { + case 3: + return { + min: 0.0, + max: 0.1 + } + case 6: + return { + min: 0.1, + max: 0.2 + } + case 11: + return { + min: 0.2, + max: 0.3 + } + case 11: + return { + min: 0.3, + max: 0.4 + } + case 14: + return { + min: 0.4, + max: 0.5 + } + case 50: + return { + min: 0.5, + max: 0.7 + } + default: + return { + min:0.7, + max:0.8 + }; + } } - -