@abi-software/scaffoldvuer 1.20.1-beta.0 → 1.21.1-beta.1
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/dist/scaffoldvuer.js +27495 -18547
- package/dist/scaffoldvuer.umd.cjs +429 -4478
- package/dist/style.css +1 -1
- package/package.json +2 -5
- package/src/App.vue +4 -4
- package/src/components/ScaffoldTreeControls.vue +10 -8
- package/src/components/ScaffoldVuer.vue +85 -14
- package/src/scripts/BaseModule.js +2 -17
- package/src/scripts/OrgansRenderer.js +197 -230
- package/src/scripts/RendererModule.js +4 -4
- package/src/scripts/Utilities.js +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/scaffoldvuer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1-beta.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^24.20.0"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"simple-dropzone": "^0.8.3",
|
|
57
57
|
"vue": "^3.5.41",
|
|
58
58
|
"vue-router": "^5.2.0",
|
|
59
|
-
"zincjs": "^2.
|
|
59
|
+
"zincjs": "^2.4.1-beta.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@babel/eslint-parser": "^8.0.1",
|
|
@@ -77,9 +77,6 @@
|
|
|
77
77
|
"vitepress": "^1.6.4",
|
|
78
78
|
"vue-docgen-api": "^4.79.2"
|
|
79
79
|
},
|
|
80
|
-
"overrides": {
|
|
81
|
-
"three": "^0.185.1"
|
|
82
|
-
},
|
|
83
80
|
"optionalDependencies": {
|
|
84
81
|
"@esbuild/darwin-arm64": "0.28.2",
|
|
85
82
|
"@esbuild/linux-x64": "0.28.2",
|
package/src/App.vue
CHANGED
|
@@ -731,7 +731,7 @@ export default {
|
|
|
731
731
|
"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/digital_twins/080626-demo/downsample_phase_3.nii.gz",
|
|
732
732
|
"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/digital_twins/080626-demo/downsample_phase_5.nii.gz"
|
|
733
733
|
]
|
|
734
|
-
const newTexture = await this.$refs.scaffold.readNIFTIFromSource(urls, true,
|
|
734
|
+
const newTexture = await this.$refs.scaffold.readNIFTIFromSource(urls, true, undefined, v1, options, true);
|
|
735
735
|
newTexture.timeEnabled = true;
|
|
736
736
|
newTexture.setIsPickable(false);
|
|
737
737
|
const scene = this.$refs.scaffold.$module.scene;
|
|
@@ -771,9 +771,9 @@ export default {
|
|
|
771
771
|
this.$refs.scaffold.search(term, true);
|
|
772
772
|
},
|
|
773
773
|
viewerMounted: function() {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
774
|
+
// this.selectedCoordinates =
|
|
775
|
+
// this.$refs.scaffold.getDynamicSelectedCoordinates();
|
|
776
|
+
// this.rendererInfo = this.$refs.scaffold.getRendererInfo();
|
|
777
777
|
},
|
|
778
778
|
PrintViewport: function() {
|
|
779
779
|
const scene = this.$refs.scaffold.$module.scene;
|
|
@@ -466,14 +466,16 @@ export default {
|
|
|
466
466
|
},
|
|
467
467
|
//Set this right at the beginning.
|
|
468
468
|
setModule: function (moduleIn) {
|
|
469
|
-
this.module
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
469
|
+
if (!this.module && moduleIn?.scene) {
|
|
470
|
+
this.module = markRaw(moduleIn);
|
|
471
|
+
this.nodeNumbers = 0;
|
|
472
|
+
const objects = this.module.scene.getRootRegion().getAllObjects(true);
|
|
473
|
+
objects.forEach((zincObject) => {
|
|
474
|
+
this.zincObjectAdded(zincObject);
|
|
475
|
+
});
|
|
476
|
+
this.module.addOrganPartAddedCallback(this.zincObjectAdded);
|
|
477
|
+
this.module.addOrganPartRemovedCallback(this.zincObjectRemoved);
|
|
478
|
+
}
|
|
477
479
|
},
|
|
478
480
|
setColourField: function (treeData, nodeData = undefined) {
|
|
479
481
|
treeData
|
|
@@ -547,6 +547,14 @@ export default {
|
|
|
547
547
|
return { annotator }
|
|
548
548
|
},
|
|
549
549
|
props: {
|
|
550
|
+
/**
|
|
551
|
+
* The option to edit annotation regardless of whether
|
|
552
|
+
* resources matches or not
|
|
553
|
+
*/
|
|
554
|
+
annotationIgnoreResource: {
|
|
555
|
+
type: Boolean,
|
|
556
|
+
default: false,
|
|
557
|
+
},
|
|
550
558
|
/**
|
|
551
559
|
* The option to show annotation information in sidebar
|
|
552
560
|
*/
|
|
@@ -962,6 +970,11 @@ export default {
|
|
|
962
970
|
isSearch: false,
|
|
963
971
|
}),
|
|
964
972
|
//checkedRegions: []
|
|
973
|
+
unwatchURL: null,
|
|
974
|
+
unwatchRegion: null,
|
|
975
|
+
unwatchState: null,
|
|
976
|
+
unwatchViewURL: null,
|
|
977
|
+
unwatchMarkerCluster: null,
|
|
965
978
|
};
|
|
966
979
|
},
|
|
967
980
|
watch: {
|
|
@@ -971,6 +984,7 @@ export default {
|
|
|
971
984
|
},
|
|
972
985
|
immediate: true,
|
|
973
986
|
},
|
|
987
|
+
/*
|
|
974
988
|
url: {
|
|
975
989
|
handler: function (newValue) {
|
|
976
990
|
if (this.state === undefined || this.state.url === undefined)
|
|
@@ -997,6 +1011,13 @@ export default {
|
|
|
997
1011
|
},
|
|
998
1012
|
immediate: true,
|
|
999
1013
|
},
|
|
1014
|
+
markerCluster: {
|
|
1015
|
+
handler: function (val) {
|
|
1016
|
+
this.$module.scene.enableMarkerCluster(val);
|
|
1017
|
+
},
|
|
1018
|
+
immediate: true,
|
|
1019
|
+
},
|
|
1020
|
+
*/
|
|
1000
1021
|
helpMode: function (newVal, oldVal) {
|
|
1001
1022
|
if (newVal !== oldVal) {
|
|
1002
1023
|
this.setHelpMode(newVal)
|
|
@@ -1037,12 +1058,6 @@ export default {
|
|
|
1037
1058
|
render: function (val) {
|
|
1038
1059
|
this.toggleRendering(val);
|
|
1039
1060
|
},
|
|
1040
|
-
markerCluster: {
|
|
1041
|
-
handler: function (val) {
|
|
1042
|
-
this.$module.scene.enableMarkerCluster(val);
|
|
1043
|
-
},
|
|
1044
|
-
immediate: true,
|
|
1045
|
-
},
|
|
1046
1061
|
markerLabels: function(labels) {
|
|
1047
1062
|
for (const [key, value] of Object.entries(this.previousMarkerLabels)) {
|
|
1048
1063
|
this.setMarkerModeForObjectsWithName(key, value, "off");
|
|
@@ -1062,16 +1077,15 @@ export default {
|
|
|
1062
1077
|
this.availableBackground = ["white", "black", "lightskyblue"];
|
|
1063
1078
|
this.$_searchIndex = new SearchIndex();
|
|
1064
1079
|
},
|
|
1065
|
-
mounted: function () {
|
|
1080
|
+
mounted: async function () {
|
|
1066
1081
|
this.openMapRef = shallowRef(this.$refs.openMapRef);
|
|
1067
1082
|
this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
|
|
1068
|
-
this.$refs.scaffoldTreeControls.setModule(this.$module);
|
|
1069
1083
|
let eventNotifier = new EventNotifier();
|
|
1070
1084
|
eventNotifier.subscribe(this, this.eventNotifierCallback);
|
|
1071
1085
|
this.$module.addNotifier(eventNotifier);
|
|
1072
1086
|
this.$module.addOrganPartAddedCallback(this.zincObjectAdded);
|
|
1073
1087
|
this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved);
|
|
1074
|
-
this.$module.
|
|
1088
|
+
await this.$module.initialise(this.$refs.display);
|
|
1075
1089
|
this.toggleRendering(this.render);
|
|
1076
1090
|
this.clientHeight = this.$refs.scaffoldContainer.$el.clientHeight;
|
|
1077
1091
|
this.ro = new ResizeObserver(this.adjustLayout).observe(
|
|
@@ -1086,8 +1100,62 @@ export default {
|
|
|
1086
1100
|
this.$module.zincRenderer.addContextRestoredCallbackFunction(() => {
|
|
1087
1101
|
this.backgroundChangeCallback(this.currentBackground);
|
|
1088
1102
|
})
|
|
1103
|
+
//Setup some watchers that depend on threejs init()
|
|
1104
|
+
this.unwatchURL = this.$watch(
|
|
1105
|
+
'url',
|
|
1106
|
+
(newVal) => {
|
|
1107
|
+
if (this.state === undefined || this.state.url === undefined) {
|
|
1108
|
+
this.setURL(newVal);
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1111
|
+
{ immediate: true } // Runs immediately after creation, if desired
|
|
1112
|
+
);
|
|
1113
|
+
this.unwatchRegion = this.$watch(
|
|
1114
|
+
'region',
|
|
1115
|
+
(region) => {
|
|
1116
|
+
if (!(this.state || this.viewURL)) {
|
|
1117
|
+
this.setFocusedRegion(region);
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
{ immediate: true }
|
|
1121
|
+
);
|
|
1122
|
+
this.unwatchState = this.$watch(
|
|
1123
|
+
'state',
|
|
1124
|
+
(state) => {
|
|
1125
|
+
this.setState(state);
|
|
1126
|
+
},
|
|
1127
|
+
{ deep: true, immediate: true }
|
|
1128
|
+
);
|
|
1129
|
+
this.unwatchViewURL = this.$watch(
|
|
1130
|
+
'viewURL',
|
|
1131
|
+
(viewURL) => {
|
|
1132
|
+
this.updateViewURL(viewURL);
|
|
1133
|
+
},
|
|
1134
|
+
{ immediate: true }
|
|
1135
|
+
);
|
|
1136
|
+
this.unwatchURL = this.$watch(
|
|
1137
|
+
'url',
|
|
1138
|
+
(newValue) => {
|
|
1139
|
+
if (this.state === undefined || this.state.url === undefined) {
|
|
1140
|
+
this.setURL(newValue);
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
{ immediate: true }
|
|
1144
|
+
);
|
|
1145
|
+
this.unwatchMarkerCluster = this.$watch(
|
|
1146
|
+
'markerCluster',
|
|
1147
|
+
(val) => {
|
|
1148
|
+
this.$module.scene.enableMarkerCluster(val);
|
|
1149
|
+
},
|
|
1150
|
+
{ immediate: true }
|
|
1151
|
+
);
|
|
1089
1152
|
},
|
|
1090
1153
|
beforeUnmount: function () {
|
|
1154
|
+
if (this.unwatchURL) this.unwatchURL();
|
|
1155
|
+
if (this.unwatchRegion) this.unwatchRegion();
|
|
1156
|
+
if (this.unwatchState) this.unwatchState();
|
|
1157
|
+
if (this.unwatchViewURL) this.unwatchViewURL();
|
|
1158
|
+
if (this.unwatchMarkerCluster) this.unwatchMarkerCluster();
|
|
1091
1159
|
if (this.ro) this.ro.disconnect();
|
|
1092
1160
|
this.$module.destroy();
|
|
1093
1161
|
this.$module = undefined;
|
|
@@ -1374,7 +1442,7 @@ export default {
|
|
|
1374
1442
|
const found = this.offlineAnnotations.find((element) => {
|
|
1375
1443
|
return element.group === annotation.group &&
|
|
1376
1444
|
element.region === annotation.region &&
|
|
1377
|
-
element.resource === annotation.resource &&
|
|
1445
|
+
(this.annotationIgnoreResource || element.resource === annotation.resource) &&
|
|
1378
1446
|
element.feature.geometry.type === annotation.feature.geometry.type;
|
|
1379
1447
|
});
|
|
1380
1448
|
if (found) {
|
|
@@ -1413,7 +1481,7 @@ export default {
|
|
|
1413
1481
|
const found = this.offlineAnnotations.find((element) => {
|
|
1414
1482
|
return element.group === oldName &&
|
|
1415
1483
|
element.region === annotation.region &&
|
|
1416
|
-
element.resource === annotation.resource &&
|
|
1484
|
+
(this.annotationIgnoreResource || element.resource === annotation.resource) &&
|
|
1417
1485
|
element.feature.geometry.type === annotation.feature.geometry.type;
|
|
1418
1486
|
});
|
|
1419
1487
|
if (found) {
|
|
@@ -1579,7 +1647,7 @@ export default {
|
|
|
1579
1647
|
const found = this.offlineAnnotations.find((element) => {
|
|
1580
1648
|
return element.group === group &&
|
|
1581
1649
|
element.region === annotation.region &&
|
|
1582
|
-
element.resource === annotation.resource &&
|
|
1650
|
+
(this.annotationIgnoreResource || element.resource === annotation.resource) &&
|
|
1583
1651
|
element.feature.geometry.type === annotation.feature.geometry.type;
|
|
1584
1652
|
});
|
|
1585
1653
|
Object.assign(found, annotation);
|
|
@@ -1783,9 +1851,12 @@ export default {
|
|
|
1783
1851
|
this.tData.x = 50;
|
|
1784
1852
|
this.tData.y = 200;
|
|
1785
1853
|
if (this._tempPoint) {
|
|
1786
|
-
const positionAttribute = this._tempPoint.geometry.getAttribute( '
|
|
1854
|
+
const positionAttribute = this._tempPoint.geometry.getAttribute( 'instancePosition' );
|
|
1787
1855
|
positionAttribute.setXYZ(0, worldCoords[0], worldCoords[1], worldCoords[2]);
|
|
1788
1856
|
positionAttribute.needsUpdate = true;
|
|
1857
|
+
this._tempPoint.pointPositions[0] = worldCoords[0];
|
|
1858
|
+
this._tempPoint.pointPositions[1] = worldCoords[1];
|
|
1859
|
+
this._tempPoint.pointPositions[2] = worldCoords[2];
|
|
1789
1860
|
} else {
|
|
1790
1861
|
this._tempPoint = this.$module.scene.addTemporaryPoints(
|
|
1791
1862
|
[worldCoords], 0x00ffff);
|
|
@@ -2880,7 +2951,6 @@ export default {
|
|
|
2880
2951
|
//this.$module.scene.enableAxisDisplay(true, true);
|
|
2881
2952
|
this.isReady = true;
|
|
2882
2953
|
this.calculateBoundingBox();
|
|
2883
|
-
//console.log(`found ${foundNerves}`);
|
|
2884
2954
|
this.$nextTick(() => {
|
|
2885
2955
|
this.restoreSettings(options);
|
|
2886
2956
|
this.$emit("on-ready");
|
|
@@ -3068,6 +3138,7 @@ export default {
|
|
|
3068
3138
|
);
|
|
3069
3139
|
}
|
|
3070
3140
|
if (this.$module && this.$module.scene) {
|
|
3141
|
+
this.$refs.scaffoldTreeControls.setModule(this.$module);
|
|
3071
3142
|
this.$module.scene.displayMarkers = this.displayMarkers;
|
|
3072
3143
|
this.$module.scene.forcePickableObjectsUpdate = true;
|
|
3073
3144
|
this.$module.scene.displayMinimap = this.displayMinimap;
|
|
@@ -25,21 +25,6 @@ BaseModule.prototype.settingsChanged = function() {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
BaseModule.prototype.exportSettings = function() {
|
|
29
|
-
const settings = {};
|
|
30
|
-
settings.dialog = this.typeName;
|
|
31
|
-
settings.name = this.instanceName;
|
|
32
|
-
return settings;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
BaseModule.prototype.importSettings = function(settings) {
|
|
36
|
-
if (settings.dialog == this.typeName) {
|
|
37
|
-
this.setName(settings.name);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
28
|
BaseModule.prototype.publishChanges = function(annotations, eventType, zincObjects) {
|
|
44
29
|
for (let i = 0; i < this.eventNotifiers.length; i++) {
|
|
45
30
|
this.eventNotifiers[i].publish(this, eventType, annotations, zincObjects);
|
|
@@ -58,7 +43,7 @@ BaseModule.prototype.destroy = function() {
|
|
|
58
43
|
}
|
|
59
44
|
|
|
60
45
|
delete this;
|
|
61
|
-
}
|
|
46
|
+
}
|
|
62
47
|
|
|
63
48
|
BaseModule.prototype.addChangedCallback = function(callback) {
|
|
64
49
|
if (this.onChangedCallbacks.includes(callback) == false)
|
|
@@ -70,7 +55,7 @@ BaseModule.prototype.removeChangedCallback = function(callback) {
|
|
|
70
55
|
if (index > -1) {
|
|
71
56
|
this.onChangedCallbacks.splice(index, 1);
|
|
72
57
|
}
|
|
73
|
-
}
|
|
58
|
+
}
|
|
74
59
|
|
|
75
60
|
BaseModule.prototype.addNotifier = function(eventNotifier) {
|
|
76
61
|
this.eventNotifiers.push(eventNotifier);
|