From 61336879cb7509ca34b2f8f39b689bf5406a041d Mon Sep 17 00:00:00 2001 From: LinkunGao Date: Wed, 19 Oct 2022 13:53:31 +0800 Subject: [PATCH 1/3] add load files UI --- src/App.vue | 11 ++++ src/components/NavBar.vue | 10 +++- src/components/Upload.vue | 103 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 src/components/Upload.vue diff --git a/src/App.vue b/src/App.vue index 742d269..97c17d4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -27,7 +27,9 @@ @on-slice-change="getSliceChangedNum" @reset-main-area-size="resetMainAreaSize" @on-change-orientation="resetSlicesOrientation" + @on-open-dialog="onOpenDialog" > + + + From e28a53ebe4f4d265e5955f33fa2cd77998597d9d Mon Sep 17 00:00:00 2001 From: LinkunGao Date: Sat, 22 Oct 2022 08:35:14 +0800 Subject: [PATCH 2/3] update init slice number --- package.json | 2 +- src/App.vue | 5 ++++- src/components/NavBar.vue | 8 +++++++- yarn.lock | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c60a575..9e3b32a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "copper3d_visualisation": "^1.11.31", + "copper3d_visualisation": "^1.11.32", "element-plus": "^2.2.17", "sass": "^1.55.0", "vue": "^3.2.37" diff --git a/src/App.vue b/src/App.vue index 97c17d4..d3d5188 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,6 +24,7 @@ :immediate-slice-num="immediateSliceNum" :contrast-index="contrastNum" :is-axis-clicked="isAxisClicked" + :init-slice-index="initSliceIndex" @on-slice-change="getSliceChangedNum" @reset-main-area-size="resetMainAreaSize" @on-change-orientation="resetSlicesOrientation" @@ -46,6 +47,7 @@ let max = ref(0); let immediateSliceNum = ref(0); let contrastNum = ref(0); let fileNum = ref(0); +let initSliceIndex = ref(0); let base_container = ref(); let intro = ref(); @@ -69,7 +71,7 @@ let dialog = ref(false); onMounted(() => { console.log( - "%cNRRD Segmentation App %cBeta:v2.1.7", + "%cNRRD Segmentation App %cBeta:v2.1.8", "padding: 3px;color:white; background:#d94607", "padding: 3px;color:white; background:#219EBC" ); @@ -151,6 +153,7 @@ watchEffect(() => { }); nrrdTools.setAllSlices(allSlices); + initSliceIndex.value = nrrdTools.getCurrentSliceIndex(); const getSliceNum = (index: number, contrastindex: number) => { immediateSliceNum.value = index; contrastNum.value = contrastindex; diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 9987c67..6ace2e7 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -38,6 +38,7 @@ type Props = { fileNum: number; min?: number; max?: number; + initSliceIndex?: number; immediateSliceNum?: number; contrastIndex?: number; isAxisClicked?: boolean; @@ -50,7 +51,8 @@ let p = withDefaults(defineProps(), { isAxisClicked: false, }); const state = reactive(p); -const { max, immediateSliceNum, contrastIndex, isAxisClicked } = toRefs(state); +const { max, immediateSliceNum, contrastIndex, isAxisClicked, initSliceIndex } = + toRefs(state); const sliceNum = ref(0); let preViousSliceNum = p.min; let previousMax = 0; @@ -92,6 +94,10 @@ const onChangeSlider = () => { preViousSliceNum += step; }; +watchEffect(() => { + initSliceIndex?.value && (sliceNum.value = initSliceIndex.value); +}); + watchEffect(() => { if (isShowContrast) { sliceNum.value = immediateSliceNum.value * p.fileNum + contrastIndex.value; diff --git a/yarn.lock b/yarn.lock index 64d9601..4ad7cc4 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.31: - version "1.11.31" - resolved "https://registry.yarnpkg.com/copper3d_visualisation/-/copper3d_visualisation-1.11.31.tgz#1581fe466721c7db0478c0066d77b9d0db38a772" - integrity sha512-851sZQho5Ga1FnbBtAnd/btOxdHOxatwhaw2zarEy+Bs3hoTSt2+Xbn7F/Kk+xj0BUdMuzaKng7SK9vihtga+w== +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== dependencies: "@types/dat.gui" "^0.7.7" "@types/three" "^0.140.0" From 8d374a6127d742e6db3b5e88939df8a7d73cd962 Mon Sep 17 00:00:00 2001 From: LinkunGao Date: Tue, 25 Oct 2022 06:29:33 +0800 Subject: [PATCH 3/3] 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"