From 8d374a6127d742e6db3b5e88939df8a7d73cd962 Mon Sep 17 00:00:00 2001 From: LinkunGao Date: Tue, 25 Oct 2022 06:29:33 +0800 Subject: [PATCH] fixed paint drag bugs, changed painting default method to sgementation --- package.json | 2 +- src/App.vue | 5 +++-- src/components/NavBar.vue | 6 ++++++ yarn.lock | 8 ++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9e3b32a..7ef3aa5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "copper3d_visualisation": "^1.11.32", + "copper3d_visualisation": "^1.11.33", "element-plus": "^2.2.17", "sass": "^1.55.0", "vue": "^3.2.37" diff --git a/src/App.vue b/src/App.vue index d3d5188..93bd528 100644 --- a/src/App.vue +++ b/src/App.vue @@ -71,7 +71,7 @@ let dialog = ref(false); onMounted(() => { console.log( - "%cNRRD Segmentation App %cBeta:v2.1.8", + "%cNRRD Segmentation App %cBeta:v2.1.9", "padding: 3px;color:white; background:#d94607", "padding: 3px;color:white; background:#219EBC" ); @@ -153,7 +153,7 @@ watchEffect(() => { }); nrrdTools.setAllSlices(allSlices); - initSliceIndex.value = nrrdTools.getCurrentSliceIndex(); + const getSliceNum = (index: number, contrastindex: number) => { immediateSliceNum.value = index; contrastNum.value = contrastindex; @@ -165,6 +165,7 @@ watchEffect(() => { nrrdTools.draw(scene as Copper.copperScene, gui); scene?.addPreRenderCallbackFunction(nrrdTools.start); + initSliceIndex.value = nrrdTools.getCurrentSliceIndex(); max.value = nrrdTools.getMaxSliceNum()[0]; } diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 6ace2e7..649d11f 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -59,6 +59,7 @@ let previousMax = 0; let isShowContrast = false; let count = 0; let magnification = 1; +let initFlag = false; const emit = defineEmits([ "onSliceChange", @@ -96,6 +97,7 @@ const onChangeSlider = () => { watchEffect(() => { initSliceIndex?.value && (sliceNum.value = initSliceIndex.value); + initFlag = true; }); watchEffect(() => { @@ -120,6 +122,10 @@ watchEffect(() => { preViousSliceNum = sliceNum.value; previousMax = max.value; } + if (initFlag) { + sliceNum.value = initSliceIndex?.value as number; + initFlag = false; + } }); diff --git a/yarn.lock b/yarn.lock index 4ad7cc4..174f7fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -286,10 +286,10 @@ copper3d_plugin_heartjs_config@^1.0.7: resolved "https://registry.npmjs.org/copper3d_plugin_heartjs_config/-/copper3d_plugin_heartjs_config-1.0.7.tgz" integrity sha512-rWhe19DQjC7Ap96uPKmQNy+IBihXTHelAowr5VdgHee+LDTLTLJ75IHsbBxi5ls1LHMxsXhGmWmT3Oy+pgva+Q== -copper3d_visualisation@^1.11.32: - version "1.11.32" - resolved "https://registry.yarnpkg.com/copper3d_visualisation/-/copper3d_visualisation-1.11.32.tgz#f76c292fc9e09889a96e67c7f0f9bfaa10cebd79" - integrity sha512-eOEfcaKKYpBPC2PhhejYcrXf06gS1Ph/jVHdM+07IbfL3QTxuP7FRmFGVbcDi7p0JEt1Jhb4TknTqWOaooJDsA== +copper3d_visualisation@^1.11.33: + version "1.11.33" + resolved "https://registry.yarnpkg.com/copper3d_visualisation/-/copper3d_visualisation-1.11.33.tgz#203f7fd0570c5d2a875a54d1abf3cf313cea0351" + integrity sha512-QF87k3SBgsXDfpTeLPp9SCUmEYMJCB2osaeJKsMvWzIRxcsM5dKmrhkWvtna6IpCYVcIFVhmRm9Phxc4fDgzoA== dependencies: "@types/dat.gui" "^0.7.7" "@types/three" "^0.140.0"