@abi-software/scaffoldvuer 1.21.1-beta.2 → 2.0.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.
Files changed (45) hide show
  1. package/README.md +31 -12
  2. package/dist/index.html +9 -6
  3. package/dist/scaffoldvuer.js +14095 -13154
  4. package/dist/scaffoldvuer.umd.cjs +48 -48
  5. package/dist/style.css +1 -1
  6. package/eslint.config.js +37 -9
  7. package/package.json +10 -3
  8. package/public/index.html +9 -6
  9. package/src/App.vue +312 -279
  10. package/src/ScaffoldVuer-wc.js +4 -4
  11. package/src/app/DropZone.vue +11 -27
  12. package/src/app/ModelsInformation.js +22 -19
  13. package/src/app/ModelsTable.vue +42 -65
  14. package/src/app/TextureDemos.js +38 -64
  15. package/src/assets/_variables.scss +12 -10
  16. package/src/components/GlyphsControls.vue +3 -23
  17. package/src/components/LinesControls.vue +27 -66
  18. package/src/components/OpacityControls.vue +22 -26
  19. package/src/components/PointsControls.vue +20 -71
  20. package/src/components/PrimitiveControls.vue +35 -49
  21. package/src/components/ScaffoldOverlay.vue +63 -63
  22. package/src/components/ScaffoldTooltip.vue +36 -49
  23. package/src/components/ScaffoldTreeControls.vue +81 -129
  24. package/src/components/ScaffoldVuer.vue +509 -498
  25. package/src/components/TextureSlidesControls.vue +22 -64
  26. package/src/components/TransformationControls.vue +15 -42
  27. package/src/components/index.js +2 -2
  28. package/src/main.js +16 -18
  29. package/src/scripts/Annotation.js +3 -3
  30. package/src/scripts/BaseModule.js +26 -30
  31. package/src/scripts/EventNotifier.js +30 -36
  32. package/src/scripts/GraphicsHighlight.js +43 -50
  33. package/src/scripts/LocalFilesHelper.js +27 -26
  34. package/src/scripts/MappedNerves.js +2139 -697
  35. package/src/scripts/MappedOrgans.js +24 -25
  36. package/src/scripts/OrgansRenderer.js +445 -425
  37. package/src/scripts/RendererModule.js +133 -122
  38. package/src/scripts/Search.js +135 -151
  39. package/src/scripts/Utilities.js +129 -127
  40. package/src/scripts/WebGL.js +57 -91
  41. package/src/scripts/niftiHelper.js +3 -3
  42. package/src/store/index.js +7 -7
  43. package/vite.config.js +51 -50
  44. package/vite.static-build.js +7 -7
  45. package/vuese-generator.js +48 -56
@@ -18,7 +18,6 @@ limitations under the License.
18
18
 
19
19
  ******************************************************************************/
20
20
 
21
-
22
21
  //==============================================================================
23
22
 
24
23
  import MiniSearch from 'minisearch';
@@ -29,172 +28,157 @@ import { createUnqiuesFromObjects } from './Utilities';
29
28
 
30
29
  // The properties of a feature we index and show
31
30
 
32
- export const indexedProperties = [
33
- 'label',
34
- 'models',
35
- 'source'
36
- ];
31
+ export const indexedProperties = ['label', 'models', 'source'];
37
32
 
38
33
  //==============================================================================
39
34
 
40
- export class SearchIndex
41
- {
42
- constructor()
43
- {
44
- this._searchEngine = new MiniSearch({
45
- fields: ['path', 'name'],
46
- storeFields: ['path'],
47
- tokenize: (string, _fieldName) => string.split(/[\s/]+/), // indexing tokenizer
48
- });
49
- this.idMaps = {};
50
- }
51
-
52
- updateZincObject(zincObject, id)
35
+ export class SearchIndex {
36
+ constructor() {
37
+ this._searchEngine = new MiniSearch({
38
+ fields: ['path', 'name'],
39
+ storeFields: ['path'],
40
+ tokenize: (string, _fieldName) => string.split(/[\s/]+/), // indexing tokenizer
41
+ });
42
+ this.idMaps = {};
43
+ }
44
+
45
+ updateZincObject(zincObject, id) {
53
46
  //=======================
54
- {
55
- const path = zincObject.getRegion().getFullPath();
56
- let groupName = zincObject.groupName;
57
- let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
58
- groupName = groupName.replaceAll('"', '');
59
- fullPath = fullPath.replaceAll('"', '');
60
- const item = { path: fullPath, name: groupName, id };
61
- this._searchEngine.replace(item);
62
- this.idMaps[id] = { path: fullPath, zincObject };
63
- }
64
-
65
- addZincObject(zincObject, id)
47
+ const path = zincObject.getRegion().getFullPath();
48
+ let groupName = zincObject.groupName;
49
+ let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
50
+ groupName = groupName.replaceAll('"', '');
51
+ fullPath = fullPath.replaceAll('"', '');
52
+ const item = { path: fullPath, name: groupName, id };
53
+ this._searchEngine.replace(item);
54
+ this.idMaps[id] = { path: fullPath, zincObject };
55
+ }
56
+
57
+ addZincObject(zincObject, id) {
66
58
  //=======================
67
- {
68
- const path = zincObject.getRegion().getFullPath();
69
- let groupName = zincObject.groupName;
70
- let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
71
- groupName = groupName.replaceAll('"', '');
72
- fullPath = fullPath.replaceAll('"', '');
73
- const item = { path: fullPath, name: groupName, id };
74
- this._searchEngine.add(item);
75
- this.idMaps[id] = { path: fullPath, zincObject };
76
- }
77
-
78
- removeZincObject(zincObject, id)
59
+ const path = zincObject.getRegion().getFullPath();
60
+ let groupName = zincObject.groupName;
61
+ let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
62
+ groupName = groupName.replaceAll('"', '');
63
+ fullPath = fullPath.replaceAll('"', '');
64
+ const item = { path: fullPath, name: groupName, id };
65
+ this._searchEngine.add(item);
66
+ this.idMaps[id] = { path: fullPath, zincObject };
67
+ }
68
+
69
+ removeZincObject(zincObject, id) {
79
70
  //=======================
80
- {
81
- const path = zincObject.getRegion().getFullPath();
82
- let groupName = zincObject.groupName;
83
- let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
84
- groupName = groupName.replaceAll('"', '');
85
- fullPath = fullPath.replaceAll('"', '');
86
- const item = { path: fullPath, name: groupName, id };
87
- this._searchEngine.remove(item);
88
- delete this.idMaps[id];
89
- }
90
-
91
- addRegion(region, id)
71
+ const path = zincObject.getRegion().getFullPath();
72
+ let groupName = zincObject.groupName;
73
+ let fullPath = path ? `${path}/${zincObject.groupName}` : zincObject.groupName;
74
+ groupName = groupName.replaceAll('"', '');
75
+ fullPath = fullPath.replaceAll('"', '');
76
+ const item = { path: fullPath, name: groupName, id };
77
+ this._searchEngine.remove(item);
78
+ delete this.idMaps[id];
79
+ }
80
+
81
+ addRegion(region, id) {
92
82
  //=======================
93
- {
94
- let path = region.getFullPath();
95
- let regionName = region.getName();
96
- path = path.replaceAll('"', '');
97
- regionName = regionName.replaceAll('"', '');
98
- const item = { path, name: regionName, id };
99
- this._searchEngine.add(item);
100
- this.idMaps[id] = { path, zincObject: region };
101
- }
102
-
103
- clearResults()
83
+ let path = region.getFullPath();
84
+ let regionName = region.getName();
85
+ path = path.replaceAll('"', '');
86
+ regionName = regionName.replaceAll('"', '');
87
+ const item = { path, name: regionName, id };
88
+ this._searchEngine.add(item);
89
+ this.idMaps[id] = { path, zincObject: region };
90
+ }
91
+
92
+ clearResults() {
104
93
  //============
105
- {
106
- this._;
107
- }
94
+ this._;
95
+ }
108
96
 
109
- removeAll()
97
+ removeAll() {
110
98
  //=======================
111
- {
112
- this._searchEngine.removeAll();
113
- //this.zincObjects.length = 0;
114
- //this.regions.length = 0;
115
- this.idMaps = {};
99
+ this._searchEngine.removeAll();
100
+ //this.zincObjects.length = 0;
101
+ //this.regions.length = 0;
102
+ this.idMaps = {};
103
+ }
104
+
105
+ auto_suggest(text) {
106
+ let results = [];
107
+ if (text.length > 2 && ["'", '"'].includes(text.slice(0, 1))) {
108
+ text = text.replaceAll(text.slice(0, 1), '');
109
+ results = this._searchEngine.search(text, { prefix: true, combineWith: 'AND' });
110
+ } else if (text.length > 1) {
111
+ results = this._searchEngine.search(text, { prefix: true });
116
112
  }
117
-
118
- auto_suggest(text) {
119
- let results = [];
120
- if (text.length > 2 && ["'", '"'].includes(text.slice(0, 1))) {
121
- text = text.replaceAll(text.slice(0, 1), '')
122
- results = this._searchEngine.search(text, {prefix: true, combineWith: 'AND'})
123
- } else if (text.length > 1) {
124
- results = this._searchEngine.search(text, {prefix: true})
125
- }
126
- const items = [];
127
- results.forEach(r => {
128
- if (r.id in this.idMaps) {
129
- items.push(this.idMaps[r.id].path);
130
- }
131
- });
132
- const unique = [...new Set(items)];
133
- const returned = [];
134
- unique.forEach(u => returned.push({suggestion: '"' + u + '"'}));
135
- return returned;
136
- }
137
-
138
-
139
- processResults(zincObjects, searchText) {
140
- const result = {
141
- regionPath: undefined,
142
- label: `Search Results for \"`,
143
- };
144
- if (Array.isArray(searchText)) {
145
- result.label += ','.join(searchText);
146
- } else {
147
- result.label += searchText;
148
- }
149
- result.label += `\"`;
150
- if (zincObjects.length === 1) {
151
- if (zincObjects[0].isRegion) {
152
- result.regionPath = zincObjects[0].getFullPath();
153
- } else if (zincObjects[0].isZincObject) {
154
- result.regionPath = zincObjects[0].getRegion().getFullPath();
155
- result.label = zincObjects[0].groupName;
156
- }
113
+ const items = [];
114
+ results.forEach((r) => {
115
+ if (r.id in this.idMaps) {
116
+ items.push(this.idMaps[r.id].path);
157
117
  }
158
- result["zincObjects"] = createUnqiuesFromObjects(zincObjects);
159
- return result;
118
+ });
119
+ const unique = [...new Set(items)];
120
+ const returned = [];
121
+ unique.forEach((u) => returned.push({ suggestion: '"' + u + '"' }));
122
+ return returned;
123
+ }
124
+
125
+ processResults(zincObjects, searchText) {
126
+ const result = {
127
+ regionPath: undefined,
128
+ label: `Search Results for "`,
129
+ };
130
+ if (Array.isArray(searchText)) {
131
+ result.label += ','.join(searchText);
132
+ } else {
133
+ result.label += searchText;
160
134
  }
161
-
162
- search(text) {
163
- let results = undefined;
164
- if (text.length > 2 && ["'", '"'].includes(text.slice(0, 1))) {
165
- text = text.replaceAll(text.slice(0, 1), '')
166
- results = this._searchEngine.search(text, {prefix: true, combineWith: 'AND'})
167
- } else if (text.length > 1) {
168
- results = this._searchEngine.search(text, {prefix: true})
135
+ result.label += `"`;
136
+ if (zincObjects.length === 1) {
137
+ if (zincObjects[0].isRegion) {
138
+ result.regionPath = zincObjects[0].getFullPath();
139
+ } else if (zincObjects[0].isZincObject) {
140
+ result.regionPath = zincObjects[0].getRegion().getFullPath();
141
+ result.label = zincObjects[0].groupName;
169
142
  }
170
- const zincResults = [];
171
- results.forEach(r => {
172
- if (r.id in this.idMaps) {
173
- zincResults.push(this.idMaps[r.id].zincObject);
174
- }
175
- });
176
- return zincResults;
177
143
  }
178
-
179
- searchTerms(terms) {
180
- let results = [];
181
- terms.forEach(term => {
182
- const result = this.search(term);
183
- results.push(...result);
184
- });
185
-
186
- return results;
144
+ result['zincObjects'] = createUnqiuesFromObjects(zincObjects);
145
+ return result;
146
+ }
147
+
148
+ search(text) {
149
+ let results = undefined;
150
+ if (text.length > 2 && ["'", '"'].includes(text.slice(0, 1))) {
151
+ text = text.replaceAll(text.slice(0, 1), '');
152
+ results = this._searchEngine.search(text, { prefix: true, combineWith: 'AND' });
153
+ } else if (text.length > 1) {
154
+ results = this._searchEngine.search(text, { prefix: true });
187
155
  }
188
-
189
- searchAndProcessResult(terms) {
190
- let zincObjectResults = [];
191
- if (Array.isArray(terms)) {
192
- zincObjectResults = this.searchTerms(terms);
193
- } else {
194
- zincObjectResults = this.search(terms);
156
+ const zincResults = [];
157
+ results.forEach((r) => {
158
+ if (r.id in this.idMaps) {
159
+ zincResults.push(this.idMaps[r.id].zincObject);
195
160
  }
196
- return this.processResults(zincObjectResults, terms);
161
+ });
162
+ return zincResults;
163
+ }
164
+
165
+ searchTerms(terms) {
166
+ let results = [];
167
+ terms.forEach((term) => {
168
+ const result = this.search(term);
169
+ results.push(...result);
170
+ });
171
+
172
+ return results;
173
+ }
174
+
175
+ searchAndProcessResult(terms) {
176
+ let zincObjectResults;
177
+ if (Array.isArray(terms)) {
178
+ zincObjectResults = this.searchTerms(terms);
179
+ } else {
180
+ zincObjectResults = this.search(terms);
197
181
  }
198
-
182
+ return this.processResults(zincObjectResults, terms);
183
+ }
199
184
  }
200
-