diff --git a/Dockerfile b/Dockerfile index faaf1f14..f86a1a0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN echo -e " server {\n" \ " root /app;\n" \ " index index.html;\n" \ " try_files \$uri \$uri/ /index.html;\n" \ + " add_header 'Cross-Origin-Embedder-Policy' 'require-corp';\n" \ + " add_header 'Cross-Origin-Opener-Policy' 'same-origin';\n" \ " }\n" \ " }\n" \ > /etc/nginx/conf.d/datalab.conf diff --git a/package-lock.json b/package-lock.json index 34f02b80..a9a0e9c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "vue": "^3.5.9", "vue-router": "^4.2.5", "vue3-carousel": "^0.3.1", - "vuetify": "^3.6.0", + "vuetify": "^3.7.4", "webfontloader": "^1.0.0" }, "devDependencies": { @@ -12726,9 +12726,9 @@ } }, "node_modules/vuetify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.6.0.tgz", - "integrity": "sha512-ic7VrB+nOTo8F7APhcKPjtDEO3yBCK5CJ2LIQ/4oAC/aaAKtuGuNMBUiUVitDKQjr0tcnDgy9Ar1CrHU5d28IA==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.7.4.tgz", + "integrity": "sha512-Y8UU5wUDQXC3oz2uumPb8IOdvB4XMCxtxnmqdOc+LihNuPlkSgxIwf92ndRzbOtJFKHsggFUxpyLqpQp+A+5kg==", "engines": { "node": "^12.20 || >=14.13" }, @@ -12740,7 +12740,6 @@ "typescript": ">=4.7", "vite-plugin-vuetify": ">=1.0.0", "vue": "^3.3.0", - "vue-i18n": "^9.0.0", "webpack-plugin-vuetify": ">=2.0.0" }, "peerDependenciesMeta": { @@ -12750,9 +12749,6 @@ "vite-plugin-vuetify": { "optional": true }, - "vue-i18n": { - "optional": true - }, "webpack-plugin-vuetify": { "optional": true } diff --git a/package.json b/package.json index 393e5634..f5a0c48f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "vue": "^3.5.9", "vue-router": "^4.2.5", "vue3-carousel": "^0.3.1", - "vuetify": "^3.6.0", + "vuetify": "^3.7.4", "webfontloader": "^1.0.0" }, "devDependencies": { diff --git a/src/components/DataSession/OperationWizard.vue b/src/components/DataSession/OperationWizard.vue index 505a7f52..2af91d0c 100644 --- a/src/components/DataSession/OperationWizard.vue +++ b/src/components/DataSession/OperationWizard.vue @@ -3,7 +3,7 @@ import { ref, onMounted, computed, defineEmits, defineProps} from 'vue' import { fetchApiCall, handleError } from '@/utils/api' import { calculateColumnSpan } from '@/utils/common' import ImageGrid from '../Global/ImageGrid' -import ImageScalingGroup from '../Global/ImageScalingGroup' +import ImageScalingGroup from '../Global/Scaling/ImageScalingGroup' import { useConfigurationStore } from '@/stores/configuration' import { useAlertsStore } from '@/stores/alerts' diff --git a/src/components/Global/CompositeImage.vue b/src/components/Global/Scaling/CompositeImage.vue similarity index 100% rename from src/components/Global/CompositeImage.vue rename to src/components/Global/Scaling/CompositeImage.vue diff --git a/src/components/Global/Scaling/HistogramSlider.vue b/src/components/Global/Scaling/HistogramSlider.vue new file mode 100644 index 00000000..41d23238 --- /dev/null +++ b/src/components/Global/Scaling/HistogramSlider.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/components/Global/ImageScaler.vue b/src/components/Global/Scaling/ImageScaler.vue similarity index 58% rename from src/components/Global/ImageScaler.vue rename to src/components/Global/Scaling/ImageScaler.vue index c4b04bd2..75f51444 100644 --- a/src/components/Global/ImageScaler.vue +++ b/src/components/Global/Scaling/ImageScaler.vue @@ -3,6 +3,7 @@ import { ref, computed, onMounted, defineEmits, defineProps } from 'vue' import { useConfigurationStore } from '@/stores/configuration' import { fetchApiCall } from '@/utils/api' import RawScaledImage from './RawScaledImage.vue' +import HistogramSlider from './HistogramSlider.vue' // This component gets the raw image data from the server for an image // and then displays the image and the scaling controls under it @@ -33,7 +34,7 @@ const isLoading = ref(true) const errorReason = ref('') const rawData = ref({}) const sliderRange = ref([0, 65535]) -var zScaleValues = null +const zScaleValues = ref([0, 65535]) const titleText = computed(() => { return props.imageName.replace('_', ' ') @@ -49,24 +50,29 @@ const maxPixelValue = computed(() => { } }) -function updateLowerScale(value) { - sliderRange.value = [Number(value), sliderRange.value[1]] - emit('updateScaling', props.imageName, sliderRange.value[0], sliderRange.value[1]) -} - -function updateUpperScale(value) { - sliderRange.value = [sliderRange.value[0], Number(value)] - emit('updateScaling', props.imageName, sliderRange.value[0], sliderRange.value[1]) -} +const histogram = computed(() => { + if (rawData.value && rawData.value.histogram) { + return rawData.value.histogram + } + else { + return [0, 10, 10, 5, 4, 3, 2, 1] + } +}) -function zScaleImage() { - if (zScaleValues){ - sliderRange.value = [...zScaleValues] +const bins = computed(() => { + if (rawData.value && rawData.value.bins) { + return rawData.value.bins + } + else { + return [0, 1, 2, 3, 4, 5, 6, 7] } +}) + +function updateScaleRange(lowerValue, upperValue) { + sliderRange.value = [Number(lowerValue), Number(upperValue)] emit('updateScaling', props.imageName, sliderRange.value[0], sliderRange.value[1]) } - onMounted(async () => { const url = dataSessionsUrl + 'analysis/raw-data/' const body = { @@ -77,8 +83,7 @@ onMounted(async () => { fetchApiCall({url: url, method: 'POST', body: body, successCallback: (response) => { rawData.value = response - zScaleValues = [response.zmin, response.zmax] - zScaleImage() + zScaleValues.value = [response.zmin, response.zmax] isLoading.value = false }, failCallback: (error) => { @@ -106,46 +111,17 @@ onMounted(async () => { - - - - + + + + diff --git a/src/components/Global/ImageScalingGroup.vue b/src/components/Global/Scaling/ImageScalingGroup.vue similarity index 98% rename from src/components/Global/ImageScalingGroup.vue rename to src/components/Global/Scaling/ImageScalingGroup.vue index 80b3370c..21c848f4 100644 --- a/src/components/Global/ImageScalingGroup.vue +++ b/src/components/Global/Scaling/ImageScalingGroup.vue @@ -69,7 +69,6 @@ watch( :key="groupName" :value="groupName" > - - diff --git a/src/components/Global/RawScaledImage.vue b/src/components/Global/Scaling/RawScaledImage.vue similarity index 100% rename from src/components/Global/RawScaledImage.vue rename to src/components/Global/Scaling/RawScaledImage.vue