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

[WIP] Feat/cornerstone wado #310

Closed
wants to merge 5 commits into from
Closed
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
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"rules": {
"tsdoc/syntax": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"no-console": [
"warn",
{
Expand Down
10 changes: 5 additions & 5 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ module.exports = (env, argv, { DIST_DIR }) => {
resolve: {
modules: [path.resolve(PROJECT_ROOT, './node_modules'), SRC_PATH],
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'cornerstone-wado-image-loader':
'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},
// alias: {
// '@cornerstonejs/dicom-image-loader':
// '@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
// },
fallback: {
fs: false,
path: require.resolve('path-browserify'),
Expand All @@ -70,7 +70,7 @@ module.exports = (env, argv, { DIST_DIR }) => {
// Show build progress
new webpack.ProgressPlugin(),
// Clear dist between builds
new CleanWebpackPlugin()
new CleanWebpackPlugin(),
],
};

Expand Down
3 changes: 2 additions & 1 deletion api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"bundledPackages": [
"@cornerstonejs/core",
"@cornerstonejs/tools",
"@cornerstonejs/streaming-image-volume-loader"
"@cornerstonejs/streaming-image-volume-loader",
"@cornerstonejs/dicom-image-loader"
],

/**
Expand Down
20 changes: 16 additions & 4 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ type FlipDirection = {
// @public (undocumented)
function getClosestImageId(imageVolume: IImageVolume, worldPos: Point3, viewPlaneNormal: Point3, viewUp: Point3): string;

// @public (undocumented)
function getClosestStackImageIndexForPoint(point: Point3, viewport: IStackViewport): number | null;

// @public (undocumented)
export function getEnabledElement(element: HTMLDivElement | undefined): IEnabledElement | undefined;

Expand Down Expand Up @@ -608,6 +611,9 @@ function getVolumeActorCorners(volumeActor: any): Array<Point3>;
// @public (undocumented)
function getVolumeViewportsContainingSameVolumes(targetViewport: IVolumeViewport, renderingEngineId?: string): Array<IVolumeViewport>;

// @public (undocumented)
function hasNaNValues(input: number[] | number): boolean;

// @public (undocumented)
interface ICache {
// (undocumented)
Expand Down Expand Up @@ -1521,13 +1527,17 @@ declare namespace planar {
export {
linePlaneIntersection,
planeEquation,
threePlaneIntersection
threePlaneIntersection,
planeDistanceToPoint
}
}

// @public (undocumented)
type Plane = [number, number, number, number];

// @public (undocumented)
function planeDistanceToPoint(plane: Plane, point: Point3, signed?: boolean): number;

// @public (undocumented)
function planeEquation(normal: Point3, point: Point3 | vec3): Plane;

Expand Down Expand Up @@ -1965,9 +1975,11 @@ declare namespace utilities {
getImageSliceDataForVolumeViewport,
isImageActor,
getViewportsWithImageURI,
getClosestStackImageIndexForPoint,
calculateViewportsSpatialRegistration,
spatialRegistrationMetadataProvider,
getViewportImageCornersInWorld
getViewportImageCornersInWorld,
hasNaNValues
}
}
export { utilities }
Expand Down Expand Up @@ -2020,8 +2032,8 @@ export class Viewport implements IViewport {
_getEdges(bounds: Array<number>): Array<[number[], number[]]>;
// (undocumented)
_getFocalPointForResetCamera(centeredFocalPoint: Point3, previousCamera: ICamera, { resetPan, resetToCenter }: {
resetPan: boolean;
resetToCenter: boolean;
resetPan?: boolean;
resetToCenter?: boolean;
}): Point3;
// (undocumented)
getFrameOfReferenceUID: () => string;
Expand Down
84 changes: 79 additions & 5 deletions common/reviews/api/tools.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,12 @@ export class BidirectionalTool extends AnnotationTool {
hasMoved?: boolean;
} | null;
// (undocumented)
_getSignedAngle: (vector1: any, vector2: any) => number;
// (undocumented)
_getTextLines: (data: any, targetId: any) => string[];
// (undocumented)
_handleDragModify: (evt: any) => void;
// (undocumented)
handleSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: BidirectionalAnnotation, handle: ToolHandle, interactionType?: string) => void;
// (undocumented)
isDrawing: boolean;
Expand All @@ -521,11 +525,9 @@ export class BidirectionalTool extends AnnotationTool {
// (undocumented)
_mouseDragModifyCallback: (evt: MouseDragEventType) => void;
// (undocumented)
_mouseDragModifyHandle: (evt: any) => void;
// (undocumented)
_mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
// (undocumented)
_movingLongAxisWouldPutItThroughShortAxis: (proposedFirstLineSegment: any, secondLineSegment: any) => boolean;
_movingLongAxisWouldPutItThroughShortAxis: (firstLineSegment: any, secondLineSegment: any) => boolean;
// (undocumented)
preventHandleOutsideImage: boolean;
// (undocumented)
Expand Down Expand Up @@ -1279,7 +1281,7 @@ function drawArrow(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, ar
function drawCircle(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, circleUID: string, center: Types_2.Point2, radius: number, options?: {}): void;

// @public (undocumented)
function drawEllipse(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, ellipseUID: string, corner1: Types_2.Point2, corner2: Types_2.Point2, options?: {}): void;
function drawEllipse(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, ellipseUID: string, corner1: Types_2.Point2, corner2: Types_2.Point2, options?: {}, dataId?: string): void;

// @public (undocumented)
function drawHandles(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, handleGroupUID: string, handlePoints: Array<Types_2.Point2>, options?: {}): void;
Expand Down Expand Up @@ -2606,9 +2608,23 @@ enum KeyboardBindings {
// (undocumented)
Alt = 18,
// (undocumented)
AltMeta = 1891,
// (undocumented)
Ctrl = 17,
// (undocumented)
Shift = 16
CtrlAlt = 1718,
// (undocumented)
CtrlMeta = 1791,
// (undocumented)
Meta = 91,
// (undocumented)
Shift = 16,
// (undocumented)
ShiftAlt = 1618,
// (undocumented)
ShiftCtrl = 1617,
// (undocumented)
ShiftMeta = 1691
}

// @public (undocumented)
Expand Down Expand Up @@ -3591,6 +3607,63 @@ export class RectangleScissorsTool extends BaseTool {
static toolName: any;
}

// @public (undocumented)
interface ReferenceCursor extends Annotation {
// (undocumented)
data: {
handles: {
points: [Types_2.Point3];
};
};
}

// @public (undocumented)
export class ReferenceCursors extends AnnotationDisplayTool {
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
// (undocumented)
_addAnnotation(element: HTMLDivElement, annotation: Annotation): string | null;
// (undocumented)
createInitialAnnotation: (worldPos: Types_2.Point3, element: HTMLDivElement) => void;
// (undocumented)
_currentCanvasPosition: null | Types_2.Point2;
// (undocumented)
_currentCursorWorldPosition: null | Types_2.Point3;
// (undocumented)
_disableCursorEnabled: boolean;
// (undocumented)
_elementWithCursor: null | HTMLDivElement;
// (undocumented)
filterInteractableAnnotationsForElement(element: HTMLDivElement, annotations: Annotations): Annotations;
// (undocumented)
getActiveAnnotation(element: HTMLDivElement): null | Annotation;
// (undocumented)
isDrawing: boolean;
// (undocumented)
isHandleOutsideImage: boolean;
// (undocumented)
mouseDragCallback: any;
// (undocumented)
mouseMoveCallback: (evt: EventTypes_2.MouseMoveEventType) => boolean;
// (undocumented)
onCameraModified: (evt: any) => void;
// (undocumented)
onSetToolActive(): void;
// (undocumented)
onSetToolDisabled(): void;
// (undocumented)
renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
// (undocumented)
_throttledCalculateCachedStats: any;
// (undocumented)
static toolName: any;
// (undocumented)
touchDragCallback: any;
// (undocumented)
updateAnnotationPosition(element: HTMLDivElement, annotation: Annotation): void;
// (undocumented)
updateViewportImage(viewport: Types_2.IStackViewport | Types_2.IVolumeViewport): void;
}

// @public (undocumented)
interface ReferenceLineAnnotation extends Annotation {
// (undocumented)
Expand Down Expand Up @@ -4336,6 +4409,7 @@ declare namespace ToolSpecificAnnotationTypes {
PlanarFreehandROIAnnotation,
ArrowAnnotation,
AngleAnnotation,
ReferenceCursor,
ReferenceLineAnnotation
}
}
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"packages": [
"packages/core",
"packages/tools",
"packages/streaming-image-volume-loader"
"packages/streaming-image-volume-loader",
"packages/dicom-image-loader"
],
"npmClient": "yarn",
"useWorkspaces": true,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"yarn": ">=1.19.1"
},
"scripts": {
"api-check": "lerna run --concurrency 1 api-check ",
"api-check": "lerna run api-check ",
"build": "lerna run build --stream",
"build:umd": "lerna run build:umd --stream",
"build:update-api": "lerna run --concurrency 1 build:update-api",
"build:update-api": "lerna run build:update-api",
"example": "node ./utils/ExampleRunner/example-runner-cli.js",
"all-examples": "node ./utils/ExampleRunner/build-all-examples-cli.js --fromRoot",
"build-all-examples": "node ./utils/ExampleRunner/build-all-examples-cli.js --build --fromRoot",
Expand Down Expand Up @@ -62,11 +62,13 @@
"cssnano": "^4.1.11",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-tsdoc": "^0.2.14",
"eslint-webpack-plugin": "^2.6.0",
"exports-loader": "^3.0.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^4.3.8",
Expand Down
30 changes: 29 additions & 1 deletion packages/core/.webpack/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
const { merge } = require('webpack-merge');
const path = require('path');
const webpackCommon = require('./../../../.webpack/webpack.common.js');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');

module.exports = (env, argv) => {
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR });

return merge(commonConfig, {
devtool: 'source-map',
entry: {
lib: path.join(__dirname, '../src/index.ts'),
},
output: {
path: path.join(__dirname, '../dist/umd'),
library: 'cornerstone3D',
libraryTarget: 'umd',
filename: 'index.js',
},
stats: {
colors: true,
hash: true,
timings: true,
assets: true,
chunks: false,
chunkModules: false,
modules: false,
children: false,
warnings: true,
},
optimization: {
minimize: false,
},
});
};
Loading