Skip to content

Commit

Permalink
Merge branch 'lchtlab-cave-calculate-distance' into lchtlab-cave
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhan committed Dec 11, 2023
2 parents ab7fa24 + db3d3cc commit bac9c26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,14 @@ function observeSegmentSelect(targetNode: Element) {
const updateSelectionDetailsBody = function(item: HTMLElement) {
if (item.classList) {
let selectionList: Element|HTMLElement[] = [];
if (item.classList.contains("neuroglancer-selection-details-layer")) { //neuroglancer-annotation-list-entry
if (item.classList.contains("neuroglancer-annotation-list-entry")) {
selectionList = [item];
}
selectionList.forEach(item => {
// const positionGrid = item.querySelector(".neuroglancer-selected-annotation-details-position")//.neuroglancer-annotation-position
const isDataBounds = false // item.querySelector(".neuroglancer-annotation-details-description")?.textContent === "Data Bounds" ? true : false; //.neuroglancer-annotation-description
if (!isDataBounds) {
const coordElements = item.querySelectorAll('.neuroglancer-selected-annotation-details-position-coord'); //.neuroglancer-annotation-coordinate
console.log(coordElements)
const positionGrid = item.querySelector(".neuroglancer-annotation-position")
const isDataBounds = item.querySelector(".neuroglancer-annotation-description")?.textContent === "Data Bounds" ? true : false;
if (positionGrid && !isDataBounds) {
const coordElements = item.querySelectorAll('.neuroglancer-annotation-coordinate');
let coordinates: Point3D[] = [];

for (let i = 0; i < coordElements?.length; i += 3){
Expand Down Expand Up @@ -246,7 +245,7 @@ function observeSegmentSelect(targetNode: Element) {

// Convert existing items
targetNode.querySelectorAll('.neuroglancer-segment-list-entry').forEach(updateSegmentSelectItem);
targetNode.querySelectorAll('.neuroglancer-selection-details-layer').forEach(updateSelectionDetailsBody);//neuroglancer-annotation-list-entry
targetNode.querySelectorAll('.neuroglancer-annotation-list-entry').forEach(updateSelectionDetailsBody);
}

function liveNeuroglancerInjection() {
Expand Down
1 change: 0 additions & 1 deletion src/widgets/annotation_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class AnnotationService {
distance.className = 'nge-selected-annotation distance';
distance.style.gridColumn = 'dim / -1';
distance.style.textOverflow = 'ellipsis';
console.log(coordinates)
if (coordinates.length == 2) {
distance.innerText = calculateDistance(coordinates)
}
Expand Down

0 comments on commit bac9c26

Please sign in to comment.