Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate across all series #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
],
"workbench.colorCustomizations": {},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "root",
"name": "@segmed/cornerstonejs",
"description": "Cornerstone.js Monorepo Root",
"private": true,
"private": false,
"workspaces": [
"packages/*"
],
Expand Down Expand Up @@ -164,5 +164,6 @@
"not op_mini all"
],
"dependencies": {},
"resolutions": {}
"resolutions": {},
"version": "2.7.3-segmed"
}
2 changes: 1 addition & 1 deletion packages/adapters/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cornerstonejs/adapters",
"name": "@segmed/cornerstonejs-adapters",
"version": "1.27.3",
"description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others",
"src": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cornerstonejs/core",
"name": "@segmed/cornerstonejs-core",
"version": "1.27.3",
"description": "",
"main": "src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/dicomImageLoader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cornerstonejs/dicom-image-loader",
"version": "1.27.3",
"name": "@segmed/cornerstonejs-dicom-image-loader",
"version": "1.27.3-segmed",
"description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file",
"keywords": [
"DICOM",
Expand Down
2 changes: 1 addition & 1 deletion packages/nifti-volume-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cornerstonejs/nifti-volume-loader",
"name": "@segmed/cornerstonejs-nifti-volume-loader",
"version": "1.27.3",
"description": "",
"main": "dist/umd/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/streaming-image-volume-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cornerstonejs/streaming-image-volume-loader",
"name": "@segmed/cornerstonejs-streaming-image-volume-loader",
"version": "1.27.3",
"description": "",
"main": "src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cornerstonejs/tools",
"version": "1.27.3",
"name": "@segmed/cornerstonejs-tools",
"version": "1.27.3-segmed.1",
"description": "Cornerstone3D Tools",
"main": "src/index.ts",
"types": "dist/esm/index.d.ts",
Expand Down
7 changes: 6 additions & 1 deletion packages/tools/src/drawingSvg/drawRect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ export default function drawRect(
width: _width,
lineWidth,
lineDash,
fill,
'fill-opacity': fillOpacity,
} = Object.assign(
{
color: 'dodgerblue',
width: '2',
lineWidth: undefined,
lineDash: undefined,
fill: 'black',
'fill-opacity': '50%',
},
options
);
Expand All @@ -47,7 +51,8 @@ export default function drawRect(
width: `${width}`,
height: `${height}`,
stroke: color,
fill: 'transparent',
fill: fill,
'fill-opacity': fillOpacity,
'stroke-width': strokeWidth,
'stroke-dasharray': lineDash,
};
Expand Down
23 changes: 19 additions & 4 deletions packages/tools/src/tools/annotation/RectangleROITool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class RectangleROITool extends AnnotationTool {
);

const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
console.log('frameofreferenceuid', FrameOfReferenceUID);

const annotation = {
invalidated: true,
Expand All @@ -175,7 +176,7 @@ class RectangleROITool extends AnnotationTool {
viewPlaneNormal: <Types.Point3>[...viewPlaneNormal],
viewUp: <Types.Point3>[...viewUp],
FrameOfReferenceUID,
referencedImageId,
//referencedImageId,
},
data: {
label: '',
Expand Down Expand Up @@ -604,6 +605,19 @@ class RectangleROITool extends AnnotationTool {
element.removeEventListener(Events.TOUCH_TAP, this._endCallback);
};

filterInteractableAnnotationsForElement = (element, annotations) => {
if (!annotations || !annotations.length) {
return [];
}

const enabledElement = getEnabledElement(element);
const { viewportId } = enabledElement;

const filteredAnnotations = annotations.filter((annotation) => true);

return filteredAnnotations;
};

/**
* it is used to draw the rectangleROI annotation in each
* request animation frame. It calculates the updated cached statistics if
Expand Down Expand Up @@ -696,7 +710,7 @@ class RectangleROITool extends AnnotationTool {
// we re-render the correct tool position. This is due to stackViewport
// which doesn't have the full volume at each time, and we are only working
// on one slice at a time.
if (viewport instanceof VolumeViewport) {
/*if (viewport instanceof VolumeViewport) {
const { referencedImageId } = annotation.metadata;

// invalidate all the relevant stackViewports if they are not
Expand All @@ -722,7 +736,7 @@ class RectangleROITool extends AnnotationTool {
}
}
}
}
}*/
}

// If rendering engine has been destroyed while rendering
Expand Down Expand Up @@ -1023,11 +1037,12 @@ function defaultGetTextLines(data, targetId: string): string[] {
}

const textLines: string[] = [];

/*
textLines.push(`Area: ${roundNumber(area)} ${areaUnit}`);
textLines.push(`Mean: ${roundNumber(mean)} ${modalityUnit}`);
textLines.push(`Max: ${roundNumber(max)} ${modalityUnit}`);
textLines.push(`Std Dev: ${roundNumber(stdDev)} ${modalityUnit}`);
*/

return textLines;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function filterAnnotationsForDisplay(
// and we don't have a proper way to check distance either since a stack can be
// composed of multiple unrelated images
return annotations.filter((annotation) => {
return true;
if (!annotation.isVisible) {
return false;
}
Expand All @@ -55,6 +56,7 @@ export default function filterAnnotationsForDisplay(
const frameOfReferenceUID: string = viewport.getFrameOfReferenceUID();

return annotations.filter((toolData) => {
return true;
return toolData.metadata.FrameOfReferenceUID === frameOfReferenceUID;
});
} else if (viewport instanceof VolumeViewport) {
Expand Down