DELETE PROJECT
@@ -193,9 +193,9 @@ export default defineComponent({
style="min-width:600px"
>
PERMANENTLY DELETE THIS PROJECT AND ITS EXPERIMENTS
diff --git a/client/src/components/ProjectUsers.vue b/client/src/components/ProjectUsers.vue
index d29bfae6..aa527c66 100644
--- a/client/src/components/ProjectUsers.vue
+++ b/client/src/components/ProjectUsers.vue
@@ -91,12 +91,12 @@ export default {
bottom
style="display: inline; padding-left: 5px"
>
-
+
mdi-cog
@@ -112,7 +112,7 @@ export default {
class="py-1"
>
-
+
{{ user.username }}
@@ -132,12 +132,12 @@ export default {
bottom
style="display: inline; padding-left: 5px"
>
-
+
mdi-cog
@@ -153,7 +153,7 @@ export default {
class="py-1"
>
-
+
{{ user.username }}
@@ -167,9 +167,9 @@ export default {
class="dialog-box"
>
Save changes
@@ -229,9 +229,9 @@ export default {
class="dialog-box"
>
Save changes
diff --git a/client/src/components/ScanDecision.vue b/client/src/components/ScanDecision.vue
index ffdd9ddd..ef461b18 100644
--- a/client/src/components/ScanDecision.vue
+++ b/client/src/components/ScanDecision.vue
@@ -76,15 +76,15 @@ export default {
>
-
+
{{ chip.code }}
diff --git a/client/src/components/ScreenshotDialog.vue b/client/src/components/ScreenshotDialog.vue
index 1785f137..d3193da0 100644
--- a/client/src/components/ScreenshotDialog.vue
+++ b/client/src/components/ScreenshotDialog.vue
@@ -98,11 +98,11 @@ export default {
@@ -129,12 +129,12 @@ export default {
Attach to email draft
diff --git a/client/src/components/TimeoutDialog.vue b/client/src/components/TimeoutDialog.vue
index 2ffa7020..3226727c 100644
--- a/client/src/components/TimeoutDialog.vue
+++ b/client/src/components/TimeoutDialog.vue
@@ -129,25 +129,25 @@ export default {
Continue Session
Logout
Reload
diff --git a/client/src/components/UserAvatar.vue b/client/src/components/UserAvatar.vue
index bd6f5377..c4f89f4b 100644
--- a/client/src/components/UserAvatar.vue
+++ b/client/src/components/UserAvatar.vue
@@ -53,13 +53,13 @@ export default {
v-if="targetUser"
bottom
>
-
+
Logout
Login
diff --git a/client/src/components/VtkViewer.vue b/client/src/components/VtkViewer.vue
index b0ccdf4f..fa0cad5b 100644
--- a/client/src/components/VtkViewer.vue
+++ b/client/src/components/VtkViewer.vue
@@ -238,7 +238,17 @@ export default {
return trueAxis;
},
async takeScreenshot() {
- const dataURL = await this.view.captureImage();
+ // TODO: scale is currently slightly off, causing a no-content border around the screenshot
+ // scale calculated in fill2Dview comes from view bounds and input data spacing
+ // relevant info: frameData.getSpacing() where frameData comes from loadFileAndGetData
+ const scale = fill2DView(this.view, 512, 512, false);
+ const dataURL = await this.view.captureImage({
+ size: [512, 512],
+ resetCamera: ({ renderer }) => {
+ renderer.resetCamera();
+ renderer.getActiveCamera().setParallelScale(scale);
+ },
+ });
this.setCurrentScreenshot({
name: `${this.currentViewData.experimentName}/${
this.currentViewData.scanName
@@ -333,17 +343,17 @@ export default {
>
{{ roundSlice(slice) }} mm
@@ -358,8 +368,8 @@ export default {
:style="{ visibility: resized ? 'unset' : 'hidden' }"
/>
@@ -380,8 +390,8 @@ export default {
fullscreen
@@ -391,8 +401,8 @@ export default {
add_a_photo
diff --git a/client/src/utils/fill2DView.js b/client/src/utils/fill2DView.js
index 996fe2c6..cab51bad 100644
--- a/client/src/utils/fill2DView.js
+++ b/client/src/utils/fill2DView.js
@@ -1,7 +1,7 @@
-export default function fill2DView(view, w, h) {
- view.resize();
+export default function fill2DView(view, w, h, resize = true) {
+ if (resize) view.resize();
const viewName = view.getName();
- if (viewName === 'default') return;
+ if (viewName === 'default') return 0;
const bounds = view.getRenderer().computeVisiblePropBounds();
const dim = [
@@ -22,12 +22,15 @@ export default function fill2DView(view, w, h) {
} else if (viewName === 'z') {
[x, y] = dim;
}
+ let scale;
if (r >= x / y) {
- // use width
- view.getCamera().setParallelScale(y + 1);
+ scale = y + 1;
} else {
- // use height
- view.getCamera().setParallelScale(x / r + 1);
+ scale = x / r + 1;
}
- view.resize();
+ if (resize) {
+ view.resize();
+ view.getCamera().setParallelScale(scale);
+ }
+ return scale;
}
diff --git a/client/src/views/Frame.vue b/client/src/views/Frame.vue
index cacc3734..332a756c 100644
--- a/client/src/views/Frame.vue
+++ b/client/src/views/Frame.vue
@@ -19,6 +19,19 @@ export default {
ControlPanel,
},
inject: ['user'],
+ async beforeRouteUpdate(to, from, next) {
+ const toFrame = await this.getFrame({ frameId: to.params.frameId, projectId: undefined });
+ next(true);
+ if (toFrame) {
+ this.swapToFrame({
+ frame: toFrame,
+ onDownloadProgress: this.onFrameDownloadProgress,
+ });
+ }
+ },
+ async beforeRouteLeave(to, from, next) {
+ next(true);
+ },
data() {
return {
downloadLoaded: 0,
@@ -75,19 +88,6 @@ export default {
this.$router.replace('/').catch(this.handleNavigationError);
}
},
- async beforeRouteUpdate(to, from, next) {
- const toFrame = await this.getFrame({ frameId: to.params.frameId, projectId: undefined });
- next(true);
- if (toFrame) {
- this.swapToFrame({
- frame: toFrame,
- onDownloadProgress: this.onFrameDownloadProgress,
- });
- }
- },
- async beforeRouteLeave(to, from, next) {
- next(true);
- },
methods: {
...mapActions([
'loadProject',
@@ -129,7 +129,7 @@ export default {
expand-on-hover
permanent
app
- width="350"
+ width="350px"
>
diff --git a/client/src/views/Projects.vue b/client/src/views/Projects.vue
index 02e77cd6..f3520937 100644
--- a/client/src/views/Projects.vue
+++ b/client/src/views/Projects.vue
@@ -25,10 +25,6 @@ export default defineComponent({
ProjectUsers,
},
inject: ['user'],
- data: () => ({
- creating: false,
- newName: '',
- }),
setup() {
const loadingProjects = ref(true);
store.dispatch.loadProjects().then(() => {
@@ -88,6 +84,18 @@ export default defineComponent({
setOverviewSections,
};
},
+ data: () => ({
+ creating: false,
+ newName: '',
+ }),
+ mounted() {
+ this.setOverviewSections();
+ window.addEventListener('keydown', (event) => {
+ if (event.key === 'Enter') {
+ this.createProject();
+ }
+ });
+ },
methods: {
...mapMutations(['setProjects', 'setCurrentProject']),
async createProject() {
@@ -111,14 +119,6 @@ export default defineComponent({
}
},
},
- mounted() {
- this.setOverviewSections();
- window.addEventListener('keydown', (event) => {
- if (event.key === 'Enter') {
- this.createProject();
- }
- });
- },
});
@@ -142,7 +142,7 @@ export default defineComponent({
v-if="project.status"
right
>
-
+
+ Create new Project
@@ -190,8 +190,8 @@ export default defineComponent({
class="global-settings"
>
Global import/export
diff --git a/client/src/vtk/proxy.js b/client/src/vtk/proxy.js
index 40d6483d..a48c6a68 100644
--- a/client/src/vtk/proxy.js
+++ b/client/src/vtk/proxy.js
@@ -9,6 +9,7 @@ import vtkProxySource from 'vtk.js/Sources/Proxy/Core/SourceProxy';
import vtkSliceRepresentationProxy from 'vtk.js/Sources/Proxy/Representations/SliceRepresentationProxy';
import vtkView from 'vtk.js/Sources/Proxy/Core/ViewProxy';
import vtkVolumeRepresentationProxy from 'vtk.js/Sources/Proxy/Representations/VolumeRepresentationProxy';
+import 'vtk.js/Sources/Rendering/Profiles/All';
import ConfigUtils from './configUtils';
diff --git a/client/tsconfig.json b/client/tsconfig.json
index 564108a8..0bf4791b 100644
--- a/client/tsconfig.json
+++ b/client/tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
- "target": "es5",
+ "target": "es2020",
"module": "esnext",
"strict": false,
"jsx": "preserve",
diff --git a/client/vue.config.js b/client/vue.config.js
index 041939b7..380bfb95 100644
--- a/client/vue.config.js
+++ b/client/vue.config.js
@@ -1,6 +1,7 @@
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
+const vtkChainWebpack = require('vtk.js/Utilities/config/chainWebpack');
const packageJson = require('./package.json');
module.exports = {
@@ -11,20 +12,6 @@ module.exports = {
lintOnSave: false,
publicPath: process.env.VUE_APP_STATIC_PATH,
configureWebpack: {
- module: {
- rules: [
- {
- test: /\.worker\.js$/,
- include: /node_modules(\/|\\)vtk\.js(\/|\\)/,
- use: [
- {
- loader: 'worker-loader',
- options: { inline: true, fallback: false },
- },
- ],
- },
- ],
- },
plugins: [
new CopyPlugin([
{
@@ -40,12 +27,6 @@ module.exports = {
],
},
chainWebpack: (config) => {
- config.module
- .rule('glsl')
- .test(/\.glsl$/)
- .include.add(/vtk\.js(\/|\\)/)
- .end()
- .use()
- .loader('shader-loader');
+ vtkChainWebpack(config);
},
};