@abi-software/scaffoldvuer 1.10.0 → 1.11.0-demo.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.10.0",
3
+ "version": "1.11.0-demo.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,7 +54,7 @@
54
54
  "vue": "^3.4.21",
55
55
  "vue-router": "^4.2.5",
56
56
  "vue3-component-svg-sprite": "^0.0.1",
57
- "zincjs": "^1.14.0"
57
+ "zincjs": "^1.14.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@vitejs/plugin-vue": "^4.6.2",
@@ -87,6 +87,10 @@ export default {
87
87
  Tooltip,
88
88
  },
89
89
  props: {
90
+ clientHeight: {
91
+ type: Number,
92
+ default: 200,
93
+ },
90
94
  createData: {
91
95
  type: Object,
92
96
  default: {
@@ -146,12 +150,14 @@ export default {
146
150
  computed: {
147
151
  ...mapState(useMainStore, ['userToken']),
148
152
  position: function () {
149
- let yOffset = 40;
153
+ let yOffset = 20;
150
154
  if (this.region) {
151
- yOffset = 55;
155
+ yOffset = 35;
152
156
  }
153
- const x = this.x - 40;
154
- return { left: x + "px", top: this.y - yOffset + "px" };
157
+ const x = this.x - 100;
158
+ const bottom = this.clientHeight - (this.y - yOffset);
159
+ return { left: x + "px", bottom: (bottom >= 0) ? `${bottom}px` : '0px'
160
+ };
155
161
  },
156
162
  },
157
163
  methods: {
@@ -216,9 +222,8 @@ export default {
216
222
  background-color: #fff;
217
223
  border: 1px solid $app-primary-color;
218
224
  border-radius: 4px;
219
- white-space: nowrap;
220
- min-width: unset!important;
221
- max-width:330px;
225
+ min-width: 250px!important;
226
+ max-width:500px;
222
227
  width:unset!important;
223
228
  pointer-events: none;
224
229
  top: -15px !important;
@@ -230,9 +235,13 @@ export default {
230
235
  }
231
236
 
232
237
  .tooltip-text {
238
+ word-wrap: normal;
233
239
  text-align: center;
234
240
  color: $app-primary-color;
235
241
  }
242
+ .tooltip-text + .tooltip-text {
243
+ border-top: 1px solid $app-primary-color;
244
+ }
236
245
 
237
246
  :deep(.non-selectable) {
238
247
  user-select: none;
@@ -8,6 +8,7 @@
8
8
  >
9
9
  <map-svg-sprite-color />
10
10
  <scaffold-tooltip
11
+ :clientHeight="clientHeight"
11
12
  :createData="createData"
12
13
  :label="tData.label"
13
14
  :region="tData.region"
@@ -323,7 +324,7 @@
323
324
  <el-radio-group
324
325
  v-model="colourRadio"
325
326
  class="scaffold-radio"
326
- @change="setColour"
327
+ @change="setColour(colourRadio, true)"
327
328
  >
328
329
  <el-radio :value="true">Colour</el-radio>
329
330
  <el-radio :value="false">Greyscale</el-radio>
@@ -335,7 +336,7 @@
335
336
  <el-radio-group
336
337
  v-model="outlinesRadio"
337
338
  class="scaffold-radio"
338
- @change="setOutlines"
339
+ @change="setOutlines(outlinesRadio, true)"
339
340
  >
340
341
  <el-radio :value="true">Show</el-radio>
341
342
  <el-radio :value="false">Hide</el-radio>
@@ -437,7 +438,6 @@ import {
437
438
  findObjectsWithNames,
438
439
  updateBoundingBox,
439
440
  } from "../scripts/Utilities.js";
440
-
441
441
  import {
442
442
  ElButton as Button,
443
443
  ElCol as Col,
@@ -458,6 +458,9 @@ import { OrgansViewer } from "../scripts/OrgansRenderer.js";
458
458
  import { SearchIndex } from "../scripts/Search.js";
459
459
  import { mapState } from 'pinia';
460
460
  import { useMainStore } from "@/store/index";
461
+ import { getNerveMaps } from "../scripts/MappedNerves.js";
462
+ const nervesMap = getNerveMaps();
463
+ let totalNerves = 0, foundNerves = 0;
461
464
 
462
465
  /**
463
466
  * A vue component of the scaffold viewer.
@@ -677,7 +680,7 @@ export default {
677
680
  isNerves: {
678
681
  type: Object,
679
682
  default: {
680
- regions: ["nerves"]
683
+ regions: ["nerves", "Spinal nerves"]
681
684
  },
682
685
  },
683
686
  /**
@@ -769,6 +772,7 @@ export default {
769
772
  data: function () {
770
773
  return {
771
774
  annotator: undefined,
775
+ clientHeight: 200,
772
776
  colourRadio: true,
773
777
  createData: {
774
778
  drawingBox: false,
@@ -1069,13 +1073,23 @@ export default {
1069
1073
  const regions = this.isNerves?.regions;
1070
1074
  if (regions) {
1071
1075
  const regionPath = zincObject.getRegion().getFullPath().toLowerCase();
1072
- for (let i = 0; i < regions.length; i++) {
1076
+ let searching = true;
1077
+ for (let i = 0; i < regions.length && searching; i++) {
1073
1078
  if (regionPath.includes(regions[i].toLowerCase())) {
1079
+ totalNerves++;
1074
1080
  zincObject.userData.isNerves = true;
1081
+ searching = false;
1082
+ const groupName = zincObject.groupName.toLowerCase();
1083
+ if (groupName in nervesMap) {
1084
+ foundNerves++;
1085
+ zincObject.setAnatomicalId(nervesMap[groupName]);
1086
+ console.log(groupName, zincObject.anatomicalId, zincObject.uuid)
1087
+ }
1075
1088
  } else {
1076
1089
  zincObject.userData.isNerves = false;
1077
1090
  }
1078
1091
  }
1092
+
1079
1093
  }
1080
1094
  /**
1081
1095
  * Emit when a new object is added to the scene
@@ -2189,9 +2203,11 @@ export default {
2189
2203
  * The parameter ``flag`` is a boolean, ``true`` (colour) and ``false`` (greyscale).
2190
2204
  * @arg {Boolean} `flag`
2191
2205
  */
2192
- setColour: function (flag) {
2206
+ setColour: function (flag, forced = false) {
2207
+ console.log(flag, this.colourRadio)
2193
2208
  if (this.isReady && this.$module.scene &&
2194
- typeof flag === "boolean" && flag !== this.colourRadio) {
2209
+ typeof flag === "boolean" &&
2210
+ (forced || flag !== this.colourRadio)) {
2195
2211
  this.loading = true;
2196
2212
  //This can take sometime to finish , nextTick does not bring out
2197
2213
  //the loading screen so I opt for timeout loop here.
@@ -2212,9 +2228,10 @@ export default {
2212
2228
  * The parameter ``flag`` is a boolean, ``true`` to show lines, ``false`` to hide them.
2213
2229
  * @arg {Boolean} `flag`
2214
2230
  */
2215
- setOutlines: function (flag) {
2231
+ setOutlines: function (flag, forced = false) {
2216
2232
  if (this.isReady && this.$module.scene &&
2217
- typeof flag === "boolean" && flag !== this.outlinesRadio) {
2233
+ typeof flag === "boolean" &&
2234
+ (forced || flag !== this.outlinesRadio)) {
2218
2235
  this.outlinesRadio = flag;
2219
2236
  this.$nextTick(() => this.$refs.scaffoldTreeControls.setOutlines(flag));
2220
2237
  }
@@ -2431,6 +2448,7 @@ export default {
2431
2448
  //this.$module.scene.createAxisDisplay(false);
2432
2449
  //this.$module.scene.enableAxisDisplay(true, true);
2433
2450
  this.isReady = true;
2451
+ console.log(`Total ${totalNerves}, found ${foundNerves}`);
2434
2452
  this.$nextTick(() => {
2435
2453
  this.restoreSettings(options);
2436
2454
  this.$emit("on-ready");
@@ -2642,6 +2660,7 @@ export default {
2642
2660
  adjustLayout: function () {
2643
2661
  if (this.$refs.scaffoldContainer) {
2644
2662
  let width = this.$refs.scaffoldContainer.clientWidth;
2663
+ this.clientHeight = this.$refs.scaffoldContainer.clientHeight;
2645
2664
  this.minimisedSlider = width < 812;
2646
2665
  if (this.minimisedSlider) {
2647
2666
  this.sliderPosition = this.drawerOpen ? "right" : "left";