From 164d7f93c0ae239e9cc5b7539866de23f641872f Mon Sep 17 00:00:00 2001 From: YukaUU Date: Mon, 10 Jun 2024 22:26:23 +0900 Subject: [PATCH 01/84] add a blank --- apps/viewer/init.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 0d3158be7..0d063ab43 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -222,6 +222,7 @@ function initCore() { } // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; + const type = data.provenance.analysis.source; let body; let attributes; From f8cbeff0335ddbba1f37ac456f3887777416b593 Mon Sep 17 00:00:00 2001 From: Victoria Nduka <122698422+nwanduka@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:52:52 +0100 Subject: [PATCH 02/84] added aria-label to slides/page combo box --- apps/table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/table.html b/apps/table.html index ae8075125..72b3f1ac3 100644 --- a/apps/table.html +++ b/apps/table.html @@ -109,7 +109,7 @@

caMicroscope

From a3422927167f8f4b0f835cee59483bbb4233de25 Mon Sep 17 00:00:00 2001 From: Victoria Nduka <122698422+nwanduka@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:28:28 +0100 Subject: [PATCH 66/84] changed DICOM button bg color --- apps/table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/table.html b/apps/table.html index 010003b77..10a87ded2 100644 --- a/apps/table.html +++ b/apps/table.html @@ -132,7 +132,7 @@

caMicroscope

From 10a8801a0bef3d0a4219e03653da426b1dee21ee Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 19:51:06 +0900 Subject: [PATCH 67/84] change name from states to viewerStates --- apps/viewer/init.js | 19 ++++++++++--------- apps/viewer/uicallbacks.js | 10 +++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index f2042a099..0356e4510 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -260,16 +260,17 @@ function initCore() { // add center position and zoom - if (data.states != undefined) { - // Rounds a number to the specified number of decimal places. - function roundTo(num, decimalPlaces) { - const factor = 10 ** decimalPlaces; - return Math.round(num * factor) / factor; - } + console.log('data', data); + if (data.viewerStates != undefined) { const decimalPlaces = 3; - attributes.X = data.states.x, - attributes.Y = data.states.y, - attributes.zoom = roundTo(data.states.zoom, decimalPlaces); + attributes.X = data.viewerStates.x, + attributes.Y = data.viewerStates.y, + attributes.zoom = roundTo(data.viewerStates.zoom, decimalPlaces); + } + // Rounds a number to the specified number of decimal places. + function roundTo(num, decimalPlaces) { + const factor = 10 ** decimalPlaces; + return Math.round(num * factor) / factor; } diff --git a/apps/viewer/uicallbacks.js b/apps/viewer/uicallbacks.js index d273b5533..2b3360e4e 100644 --- a/apps/viewer/uicallbacks.js +++ b/apps/viewer/uicallbacks.js @@ -895,7 +895,7 @@ function annoCallback(data) { noteData.notes = resultString; // get center position and zoom - let states = StatesHelper.getCurrentStates(true); + let viewerStates = StatesHelper.getCurrentStates(true); // save // provenance @@ -922,10 +922,10 @@ function annoCallback(data) { $CAMIC.viewer, $CAMIC.viewer.canvasDrawInstance.getImageFeatureCollection(), ), - states: { - x: states.x, - y: states.y, - zoom: states.z, + viewerStates: { + x: viewerStates.x, + y: viewerStates.y, + zoom: viewerStates.z, }, }; From 29e4a084f00cffc164e5592cca3fbaba0786f6a4 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 21:41:16 +0900 Subject: [PATCH 68/84] fix --- apps/viewer/init.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 0356e4510..e13696ea7 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -260,7 +260,6 @@ function initCore() { // add center position and zoom - console.log('data', data); if (data.viewerStates != undefined) { const decimalPlaces = 3; attributes.X = data.viewerStates.x, From 67c0196a292463a89c777bbc294a523e11adacb6 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 23:10:58 +0900 Subject: [PATCH 69/84] add zooming in each annotation at Multi mode --- core/extension/openseadragon-canvas-draw-overlay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index 1bb203e82..ffe279428 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1023,6 +1023,7 @@ if (this.drawMode == 'point') { this._current_path_ = { type: 'Feature', + zoom: StatesHelper.getCurrentStates(true).z, properties: { style: {}, }, @@ -1043,6 +1044,7 @@ properties: { style: {}, }, + zoom: StatesHelper.getCurrentStates(true).z, geometry: { type: this.drawMode === 'line' || this.drawMode === 'grid' ? From 467755e8d3f434207c6433906e024b02879fcf54 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 23:23:17 +0900 Subject: [PATCH 70/84] ad zoom data each annotation --- apps/viewer/uicallbacks.js | 1 + common/util.js | 1 + core/extension/openseadragon-canvas-draw-overlay.js | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/viewer/uicallbacks.js b/apps/viewer/uicallbacks.js index 2b3360e4e..807fdab7a 100644 --- a/apps/viewer/uicallbacks.js +++ b/apps/viewer/uicallbacks.js @@ -929,6 +929,7 @@ function annoCallback(data) { }, }; + console.log('annotJson', annotJson); // save annotation $CAMIC.store .addMark(annotJson) diff --git a/common/util.js b/common/util.js index d49942231..c347b8a87 100644 --- a/common/util.js +++ b/common/util.js @@ -472,6 +472,7 @@ function covertToViewportFeature(width, height, og) { og.geometry.type; feature = { type: 'Feature', + zooming: og.zoom, properties: { style: {}, area: null, diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index ffe279428..235d22b6f 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1011,6 +1011,7 @@ // const featrue = this._draws_data_[i].feature; rs.features = this._draws_data_.slice(0, this._path_index); // } + console.log('rs', rs); return rs; }, From 7204c13ec7975156e94c2262df34ca41379698c2 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 23:39:46 +0900 Subject: [PATCH 71/84] add viewerStates in each annotation at multi mode --- apps/viewer/init.js | 1 + core/extension/openseadragon-canvas-draw-overlay.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index e13696ea7..599d081c8 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -222,6 +222,7 @@ function initCore() { } // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; + console.log('data', data); const type = data.provenance.analysis.source; let body; diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index 235d22b6f..fcb06e558 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1024,7 +1024,7 @@ if (this.drawMode == 'point') { this._current_path_ = { type: 'Feature', - zoom: StatesHelper.getCurrentStates(true).z, + viewerStates: StatesHelper.getCurrentStates(true), properties: { style: {}, }, @@ -1045,7 +1045,7 @@ properties: { style: {}, }, - zoom: StatesHelper.getCurrentStates(true).z, + viewerStates: StatesHelper.getCurrentStates(true), geometry: { type: this.drawMode === 'line' || this.drawMode === 'grid' ? From 277397e78e3836b617f9805633c71d43273ed103 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 18 Jul 2024 23:47:13 +0900 Subject: [PATCH 72/84] add viewerStates in each annotation at multi mode --- common/util.js | 53 ++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/common/util.js b/common/util.js index c347b8a87..39c23ccc4 100644 --- a/common/util.js +++ b/common/util.js @@ -369,11 +369,11 @@ function getUrlVars() { return true; }, getOwnPropertyDescriptor(target, prop) { - return { configurable: true, enumerable: true }; + return {configurable: true, enumerable: true}; }, ownKeys: function(target) { - return Reflect.ownKeys(state) - } + return Reflect.ownKeys(state); + }, }); } /** @@ -418,11 +418,8 @@ function VieweportFeaturesToImageFeatures(viewer, geometries) { feature.bound.coordinates =[ Math.round(feature.bound.coordinates[0] * imgWidth), Math.round(feature.bound.coordinates[1] * imgHeight)]; - - - if (feature.geometry.type=='Circle') { - feature.geometry.radius = Math.round(feature.geometry.radius * imgWidth) + feature.geometry.radius = Math.round(feature.geometry.radius * imgWidth); } if (feature.geometry.type=='Ellipse') { feature.geometry.radius = [Math.round(feature.geometry.radius[0] * imgWidth), Math.round(feature.geometry.radius[1] * imgHeight)]; @@ -472,7 +469,7 @@ function covertToViewportFeature(width, height, og) { og.geometry.type; feature = { type: 'Feature', - zooming: og.zoom, + viewerStates: og.viewerStates, properties: { style: {}, area: null, @@ -531,7 +528,7 @@ function covertToHumanLayer(data) { const id = item.analysis.execution_id; const name = item.analysis.name || item.analysis.execution_id; - if (!item.shape) item.shape = ["Polygon"]; + if (!item.shape) item.shape = ['Polygon']; if (item.analysis.type&&item.analysis.type=='label') { // preset label return { id: id, @@ -567,7 +564,7 @@ function covertToRulerLayer(data) { name: data.name, typeId: data.type, typeName: data.source, - shape: "Polygon", + shape: 'Polygon', creator: data.creator, data: null, }; @@ -690,7 +687,7 @@ function areaCircumferenceToGrids(points, size) { for (let centerX = topLeftCenter[0]; centerX < maxX; centerX += size[0]) { for (let centerY = topLeftCenter[1]; centerY < maxY; centerY += size[1]) { if (isPointInsidePolygon([centerX, centerY], points)) { - grids.push(getTopLeft([centerX, centerY], size)) + grids.push(getTopLeft([centerX, centerY], size)); } } } @@ -708,20 +705,20 @@ function closestPointOnLineSegment(px, py, x1, y1, x2, y2) { const dx = x2 - x1; const dy = y2 - y1; const t = ((px - x1) * dx + (py - y1) * dy) / (dx * dx + dy * dy); - + if (t < 0) { - return { x: x1, y: y1 }; + return {x: x1, y: y1}; } else if (t > 1) { - return { x: x2, y: y2 }; + return {x: x2, y: y2}; } else { - return { x: x1 + t * dx, y: y1 + t * dy }; + return {x: x1 + t * dx, y: y1 + t * dy}; } } function closestPointOnPolygon(polygon, px, py) { let closestDistance = Infinity; let closestIndex = null; - + // Find the closest point on each edge for (let i = 0; i < polygon.length; i++) { const nextIndex = (i + 1) % polygon.length; @@ -729,13 +726,13 @@ function closestPointOnPolygon(polygon, px, py) { const edgeEnd = polygon[nextIndex]; const closest = closestPointOnLineSegment(px, py, edgeStart[0], edgeStart[1], edgeEnd[0], edgeEnd[1]); const d = distance(px, py, closest.x, closest.y); - + if (d < closestDistance) { closestDistance = d; closestIndex = i; } } - + return closestIndex; } @@ -756,19 +753,19 @@ function isPointInsidePolygon(point, polygon) { let inside = false; for (let i = 0; i < n; i++) { - const [x1, y1] = polygon[i]; - const [x2, y2] = polygon[(i + 1) % n]; + const [x1, y1] = polygon[i]; + const [x2, y2] = polygon[(i + 1) % n]; - if (y === y1 && y1 === y2 && (x1 <= x && x <= x2 || x2 <= x && x <= x1)) { - return true; - } + if (y === y1 && y1 === y2 && (x1 <= x && x <= x2 || x2 <= x && x <= x1)) { + return true; + } - if ((y1 < y && y < y2 || y2 < y && y < y1) && x < Math.max(x1, x2)) { - const intersectionX = (y - y1) * (x2 - x1) / (y2 - y1) + x1; - if (x < intersectionX) { - inside = !inside; - } + if ((y1 < y && y < y2 || y2 < y && y < y1) && x < Math.max(x1, x2)) { + const intersectionX = (y - y1) * (x2 - x1) / (y2 - y1) + x1; + if (x < intersectionX) { + inside = !inside; } + } } return inside; From 17e6f8068e0ff0854e2a57f3893cee95e7696300 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 00:17:23 +0900 Subject: [PATCH 73/84] fix Multi mode on the pencil tool seems to save all annotations --- apps/viewer/init.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 599d081c8..94dfb4ba1 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -222,8 +222,6 @@ function initCore() { } // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; - console.log('data', data); - const type = data.provenance.analysis.source; let body; let attributes; @@ -261,11 +259,11 @@ function initCore() { // add center position and zoom - if (data.viewerStates != undefined) { + if (data.geometries.features[data.selected].viewerStates != null || data.geometries.features[data.selected].viewerStates != undefined) { const decimalPlaces = 3; - attributes.X = data.viewerStates.x, - attributes.Y = data.viewerStates.y, - attributes.zoom = roundTo(data.viewerStates.zoom, decimalPlaces); + attributes.X = data.geometries.features[data.selected].viewerStates.x, + attributes.Y = data.geometries.features[data.selected].viewerStates.y, + attributes.zoom = roundTo(data.geometries.features[data.selected].viewerStates.z, decimalPlaces); } // Rounds a number to the specified number of decimal places. function roundTo(num, decimalPlaces) { From 037c693b24ef11b28c4ad3a89cae175a0c9f2c7b Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 00:35:46 +0900 Subject: [PATCH 74/84] fix error This line has a length of 148. Maximum allowed is 125 --- apps/viewer/init.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 94dfb4ba1..530451766 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -259,7 +259,8 @@ function initCore() { // add center position and zoom - if (data.geometries.features[data.selected].viewerStates != null || data.geometries.features[data.selected].viewerStates != undefined) { + if (data.geometries.features[data.selected].viewerStates != null || + data.geometries.features[data.selected].viewerStates != undefined) { const decimalPlaces = 3; attributes.X = data.geometries.features[data.selected].viewerStates.x, attributes.Y = data.geometries.features[data.selected].viewerStates.y, From 27c7fd369feba98224623a4f821e3320d4bfec8c Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 01:01:33 +0900 Subject: [PATCH 75/84] delete viewerStates ( previuos commit :added viewerStates each annotation --- apps/viewer/uicallbacks.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/viewer/uicallbacks.js b/apps/viewer/uicallbacks.js index 807fdab7a..e87c68520 100644 --- a/apps/viewer/uicallbacks.js +++ b/apps/viewer/uicallbacks.js @@ -922,11 +922,6 @@ function annoCallback(data) { $CAMIC.viewer, $CAMIC.viewer.canvasDrawInstance.getImageFeatureCollection(), ), - viewerStates: { - x: viewerStates.x, - y: viewerStates.y, - zoom: viewerStates.z, - }, }; console.log('annotJson', annotJson); From e748f61d72c1fa63e973151337a2a860028bdd04 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 02:19:19 +0900 Subject: [PATCH 76/84] fix visualization panel using $D.visualizations.geometries.features --- apps/viewer/dataloaders.js | 1 - apps/viewer/init.js | 9 ++++----- common/util.js | 4 ---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/viewer/dataloaders.js b/apps/viewer/dataloaders.js index 28919b539..d95f68e83 100644 --- a/apps/viewer/dataloaders.js +++ b/apps/viewer/dataloaders.js @@ -104,7 +104,6 @@ function layersLoader() { $D.visualizations = [...layers.map(covertToVisualization)]; visualizationLayerItems($D.visualizations); }).catch(function(error) { - // overlayers schema $UI.message.addError('Loading Logs is Error'); console.error(error); }); diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 530451766..b786c3590 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -178,7 +178,6 @@ function initCore() { $D.pages.table = '../../../'; } - console.log($D); try { const slideQuery = {}; slideQuery.id = $D.params.slideId; @@ -1638,11 +1637,11 @@ function visualizationLayerItems(data) { // Get initial data $D.visualizations.map((d) => { - if (d.states) { - for (let i = 0; i < d.geometries.features.length; i++) { - initialZommingData.push(roundToSecondDecimalPlace(d.states.zoom)); + d.geometries.features.map((sd)=>{ + if (features.viewerStates) { + initialZommingData.push(roundToSecondDecimalPlace(features.viewerStates.z)); } - } + }); }); let result = countOccurrences(initialZommingData); diff --git a/common/util.js b/common/util.js index 39c23ccc4..8df6069ea 100644 --- a/common/util.js +++ b/common/util.js @@ -590,8 +590,6 @@ function covertToVisualization(data) { const typeName = data.provenance.analysis.source; const id = data.provenance.analysis.execution_id; const name = data.provenance.analysis.name || data.provenance.analysis.execution_id; - const states = data.states || null; - const shape = data.geometries.features[0].geometry.type || null; const isGrid = data.provenance.analysis.isGrid || false; const geometries = data.geometries; @@ -607,7 +605,6 @@ function covertToVisualization(data) { id: data.provenance.analysis.labelled, name: data.provenance.analysis.name, }, - states: states, geometries: geometries, data: null, }; @@ -619,7 +616,6 @@ function covertToVisualization(data) { typeName: typeName, creator: data.creator, isGrid: isGrid, - states: states, geometries: geometries, data: null, }; From a0939307fbb85ce869e20bed2acfeda5a35e53e6 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 02:27:51 +0900 Subject: [PATCH 77/84] fix small bug --- apps/viewer/dataloaders.js | 2 +- apps/viewer/init.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/viewer/dataloaders.js b/apps/viewer/dataloaders.js index d95f68e83..33ad204c1 100644 --- a/apps/viewer/dataloaders.js +++ b/apps/viewer/dataloaders.js @@ -104,7 +104,7 @@ function layersLoader() { $D.visualizations = [...layers.map(covertToVisualization)]; visualizationLayerItems($D.visualizations); }).catch(function(error) { - $UI.message.addError('Loading Logs is Error'); + $UI.message.addError('Loading visualizations is Error'); console.error(error); }); } diff --git a/apps/viewer/init.js b/apps/viewer/init.js index b786c3590..7ec7280be 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -1637,9 +1637,9 @@ function visualizationLayerItems(data) { // Get initial data $D.visualizations.map((d) => { - d.geometries.features.map((sd)=>{ - if (features.viewerStates) { - initialZommingData.push(roundToSecondDecimalPlace(features.viewerStates.z)); + d.geometries.features.map((ditailData)=>{ + if (ditailData.viewerStates) { + initialZommingData.push(roundToSecondDecimalPlace(ditailData.viewerStates.z)); } }); }); From 4e6f4805c4474a33c1089483e75fbada70b69e31 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 02:43:13 +0900 Subject: [PATCH 78/84] remove viewerStates:image --- common/util.js | 6 +++++- core/extension/openseadragon-canvas-draw-overlay.js | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/util.js b/common/util.js index 8df6069ea..6a1b08212 100644 --- a/common/util.js +++ b/common/util.js @@ -469,7 +469,11 @@ function covertToViewportFeature(width, height, og) { og.geometry.type; feature = { type: 'Feature', - viewerStates: og.viewerStates, + viewerStates: { + x: og.viewerStates.x, + y: og.viewerStates.y, + z: og.viewerStates.z, + }, properties: { style: {}, area: null, diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index fcb06e558..a55e2f472 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1024,7 +1024,11 @@ if (this.drawMode == 'point') { this._current_path_ = { type: 'Feature', - viewerStates: StatesHelper.getCurrentStates(true), + viewerStates: { + x: StatesHelper.getCurrentStates(true).x, + y: StatesHelper.getCurrentStates(true).y, + z: StatesHelper.getCurrentStates(true).y + }, properties: { style: {}, }, @@ -1045,7 +1049,11 @@ properties: { style: {}, }, - viewerStates: StatesHelper.getCurrentStates(true), + viewerStates: { + x: StatesHelper.getCurrentStates(true).x, + y: StatesHelper.getCurrentStates(true).y, + z: StatesHelper.getCurrentStates(true).z, + }, geometry: { type: this.drawMode === 'line' || this.drawMode === 'grid' ? From 0076c4d8784813363d955fe1edda5962354e5a4e Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 19 Jul 2024 23:56:48 +0900 Subject: [PATCH 79/84] fix point viewerStates --- core/extension/openseadragon-canvas-draw-overlay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index a55e2f472..a54681c26 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1027,7 +1027,7 @@ viewerStates: { x: StatesHelper.getCurrentStates(true).x, y: StatesHelper.getCurrentStates(true).y, - z: StatesHelper.getCurrentStates(true).y + z: StatesHelper.getCurrentStates(true).z }, properties: { style: {}, From 6dafdf62178f34384c4819c5cc96a1fb24d4fa36 Mon Sep 17 00:00:00 2001 From: Birm Date: Fri, 19 Jul 2024 11:07:59 -0400 Subject: [PATCH 80/84] render toolbar ariaLabel --- components/toolbar/toolbar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/toolbar/toolbar.js b/components/toolbar/toolbar.js index 1820c2e0a..798778eac 100644 --- a/components/toolbar/toolbar.js +++ b/components/toolbar/toolbar.js @@ -213,6 +213,7 @@ CaToolbar.prototype.__createCheck = function(options) { icon.classList.add('material-icons'); icon.classList.add('md-24'); icon.textContent = options.icon; + if (options.ariaLabel) icon.ariaLabel = options.ariaLabel; icon.htmlFor = id; if (options.title) { tippy(icon, { @@ -275,6 +276,7 @@ CaToolbar.prototype.__createRadio = function(options) { if (options.icon) { icon.classList.add('material-icons'); icon.classList.add('md-24'); + if (options.ariaLabel) icon.ariaLabel = options.ariaLabel; icon.textContent = options.icon; } else { let _fitContent = 'fit-content'; @@ -332,6 +334,7 @@ CaToolbar.prototype.__createMultiStateBtns = function(options) { icon.id = randomId(); // create a timestamp id icon.classList.add('material-icons'); icon.classList.add('md-24'); + if (options.ariaLabel) icon.ariaLabel = options.ariaLabel; icon.classList.add(0); icon.dataset.state = 0; icon.textContent = options.icon; @@ -385,6 +388,7 @@ CaToolbar.prototype.__createMultiDropDown = function(options) { const icon = document.createElement('label'); icon.classList.add('material-icons'); icon.classList.add('md-24'); + if (options.ariaLabel) icon.ariaLabel = options.ariaLabel; icon.textContent = options.icon; icon.htmlFor = id; if (options.title) { @@ -512,6 +516,7 @@ CaToolbar.prototype.__createDropDown = function(options) { const icon = document.createElement('label'); icon.classList.add('material-icons'); icon.classList.add('md-24'); + if (options.ariaLabel) icon.ariaLabel = options.ariaLabel; icon.textContent = options.icon; icon.htmlFor = id; if (options.title) { From 591a2659ca101cfe8a9b09c9413863fbeb802ba3 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Sat, 20 Jul 2024 17:02:00 +0900 Subject: [PATCH 81/84] fix small bug --- apps/viewer/dataloaders.js | 2 +- apps/viewer/init.js | 64 +++++++++++++------------------------- 2 files changed, 22 insertions(+), 44 deletions(-) diff --git a/apps/viewer/dataloaders.js b/apps/viewer/dataloaders.js index 33ad204c1..4d47a06c6 100644 --- a/apps/viewer/dataloaders.js +++ b/apps/viewer/dataloaders.js @@ -110,7 +110,7 @@ function layersLoader() { } var checkCoreIsReady = setInterval(function() { - if ($UI.layersViewer && $UI.layersViewerMinor && $UI.visualizatiomViewer) { + if ($UI.layersViewer && $UI.layersViewerMinor && $UI.visualizationViewer) { clearInterval(checkCoreIsReady); loadingHumanOverlayers(); loadingRulerOverlayers(); diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 7ec7280be..62ee9097e 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -747,6 +747,10 @@ async function initUIcomponents() { callback: toggleSideMenu, }); + const loading = `
loading layers...
`; + $UI.layersSideMenu.addContent(loading); + // TODO add layer viewer + $UI.visualizationSideMenu = new SideMenu({ id: 'visualization_panel', width: 250, @@ -895,26 +899,22 @@ async function initUIcomponents() { callback.bind('minor'), rootCallback.bind('minor'), ); - // create UI and set data - // $UI.VisualizationViewer = createVisualizationViewer( - // 'overvisuzalization', - // null, - // callback.bind('main'), - // rootCallback.bind('main'), - // ); + + $UI.visualizationViewer = createVisualizationViewer( + 'overvisuzalization', + null, + callback.bind('main'), + rootCallback.bind('main'), + ); + // // create UI and set data - minor - // $UI.visualizatiomViewerMinor = createVisualizationViewer( + // $UI.visualizationViewerMinor = createVisualizationViewer( // 'overvisuzalizationMinor', // null, // callback.bind('minor'), // rootCallback.bind('minor'), // ); - $UI.visualizatiomViewer = createVisualizationViewer( - 'overvisuzalization', - null, - callback.bind('main'), - rootCallback.bind('main'), - ); + // TODO move to add layers // if ($D.params.states && $D.params.states.l) { // $D.params.states.l.forEach((id) => @@ -1020,9 +1020,10 @@ async function initUIcomponents() { // visualization $UI.visualizationList.clearContent('visualizationlist'); - $UI.visualizationList.addContent('visualizationlist', $UI.visualizatiomViewer.elt); + $UI.visualizationList.addContent('visualizationlist', $UI.visualizationViewer.elt); + // TODO Heatmap // $UI.visualizationList.clearContent('heatMap'); - // $UI.visualizationList.addContent('heatMap', $UI.visualizatiomViewerMinor.elt); + // $UI.visualizationList.addContent('heatMap', $UI.visualizationViewerMinor.elt); $UI.visualizationList.elt.parentNode.removeChild($UI.visualizationList.elt); closeMinorControlPanel(); @@ -1393,21 +1394,8 @@ function createLayerViewer(id, viewerData, callback, rootCallback) { return layersViewer; } -// function createVisualizationViewer(id, viewerData, callback, rootCallback) { -// const visualizatiomViewer = new LayersViewer({ -// id: id, -// data: viewerData, -// removeCallback: removeCallback, -// locationCallback: locationCallback, -// callback: callback, -// rootCallback: rootCallback, - -// }); -// visualizatiomViewer.elt.parentNode.removeChild(visualizatiomViewer.elt); -// return visualizatiomViewer; -// } function createVisualizationViewer(id, viewerData, callback, rootCallback) { - const visualizatiomViewer = new VisualizationViewer({ + const visualizationViewer = new VisualizationViewer({ id: id, data: viewerData, removeCallback: removeCallback, @@ -1415,8 +1403,8 @@ function createVisualizationViewer(id, viewerData, callback, rootCallback) { callback: callback, rootCallback: rootCallback, }); - visualizatiomViewer.elt.parentNode.removeChild(visualizatiomViewer.elt); - return visualizatiomViewer; + visualizationViewer.elt.parentNode.removeChild(visualizationViewer.elt); + return visualizationViewer; } // create lay panel for side-by-side control function createLayPanelControl() { @@ -1536,7 +1524,6 @@ function addHumanLayerItems() { }, mainViewerItems); $UI.layersViewer.addHumanItems(mainViewerItems); - // $UI.visualizatiomViewer.addHumanItems(mainViewerItems); // minor viewer minorViewer const minorViewerItems = { @@ -1577,11 +1564,8 @@ function addHumanLayerItems() { }, minorViewerItems); $UI.layersViewerMinor.addHumanItems(minorViewerItems); - // $UI.visualizatiomViewerMinor.addHumanItems(minorViewerItems); } -// function addLogItems(){ -// } function openLoadStatus(text) { const txt = $UI.loadStatus.querySelector('.text'); txt.textContent = `Loading ${text}`; @@ -1600,8 +1584,6 @@ function addRulerLayerItems(data) { }); $UI.layersViewer.addItems(mainViewerData, 'ruler'); $UI.layersViewerMinor.addItems(minorViewerData, 'ruler'); - // $UI.visualizatiomViewer.addItems(mainViewerData, 'ruler'); - // $UI.visualizatiomViewerMinor.addItems(minorViewerData, 'ruler'); } function addComputerLayerItems(data) { @@ -1614,8 +1596,6 @@ function addComputerLayerItems(data) { }); $UI.layersViewer.addItems(mainViewerData, 'segmentation'); $UI.layersViewerMinor.addItems(minorViewerData, 'segmentation'); - // $UI.visualizatiomViewer.addItems(mainViewerData, 'segmentation'); - // $UI.visualizatiomViewerMinor.addItems(minorViewerData, 'segmentation'); } function addHeatmapLayerItems(data) { @@ -1628,8 +1608,6 @@ function addHeatmapLayerItems(data) { }); $UI.layersViewer.addItems(mainViewerData, 'heatmap'); $UI.layersViewerMinor.addItems(minorViewerData, 'heatmap'); - // $UI.visualizatiomViewer.addItems(mainViewerData, 'heatmap'); - // $UI.visualizatiomViewerMinor.addItems(minorViewerData, 'heatmap'); } function visualizationLayerItems(data) { @@ -1645,7 +1623,7 @@ function visualizationLayerItems(data) { }); let result = countOccurrences(initialZommingData); - $UI.visualizatiomViewer.visualization('myChart', result); + $UI.visualizationViewer.visualization('myChart', result); } // Function to round to decimal places From eb64052ff6bd070ed0b894dc01d69d52f0189568 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Sat, 20 Jul 2024 17:09:08 +0900 Subject: [PATCH 82/84] Remove unused code from viewer.html --- apps/viewer/viewer.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/viewer/viewer.html b/apps/viewer/viewer.html index d59c59b25..6756f1d79 100644 --- a/apps/viewer/viewer.html +++ b/apps/viewer/viewer.html @@ -443,8 +443,6 @@
- -
From 179d08a06cccbe5becaa5fc32197fe27c4733869 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Sat, 20 Jul 2024 17:30:53 +0900 Subject: [PATCH 83/84] delete unused code --- apps/viewer/uicallbacks.js | 1 - core/extension/openseadragon-canvas-draw-overlay.js | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/viewer/uicallbacks.js b/apps/viewer/uicallbacks.js index e87c68520..9b42af641 100644 --- a/apps/viewer/uicallbacks.js +++ b/apps/viewer/uicallbacks.js @@ -924,7 +924,6 @@ function annoCallback(data) { ), }; - console.log('annotJson', annotJson); // save annotation $CAMIC.store .addMark(annotJson) diff --git a/core/extension/openseadragon-canvas-draw-overlay.js b/core/extension/openseadragon-canvas-draw-overlay.js index a54681c26..8984c6fe6 100644 --- a/core/extension/openseadragon-canvas-draw-overlay.js +++ b/core/extension/openseadragon-canvas-draw-overlay.js @@ -1011,7 +1011,6 @@ // const featrue = this._draws_data_[i].feature; rs.features = this._draws_data_.slice(0, this._path_index); // } - console.log('rs', rs); return rs; }, From 01ffbd958b27e2ae3e1b195db15be66c33eeb996 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Mon, 22 Jul 2024 20:38:36 +0900 Subject: [PATCH 84/84] fix comment in visualizationviewer --- .../visualizationviewer/visualiationviewer.js | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/components/visualizationviewer/visualiationviewer.js b/components/visualizationviewer/visualiationviewer.js index d101198a6..4baf64546 100644 --- a/components/visualizationviewer/visualiationviewer.js +++ b/components/visualizationviewer/visualiationviewer.js @@ -1,20 +1,12 @@ /** - * CaMicroscope Logs Viewer. A component that shows logs of annotation by timeline. + * CaMicroscope Visualization Viewer. A component that shows Visualization Graph of annotation . * @constructor * @param {Object} options - * All required and optional settings for instantiating a new instance of a Layer Manager. - * @param {String} options.id - * Id of the element to append the Layer Manager's container element to. - * @param {Object[]} options.data - * the data set of the layers. - * @param {String} options.data.id - * layer's id - * @param {String} options.data.name - * layer's name - * @param {String} options.data.typeId - * layer's type id - * @param {String} options.data.typeName - * layer's type name + * All required and optional settings for instantiating a new instance of a Visualization Graph. +* @param {String} id + * ID for the visualization graph. + * @param {String} result + * result is data for visualization graph. * */ function VisualizationViewer(options) {