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

feat(surface rendering): Add surface rendering as segmentation representation #808

Merged
merged 37 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0978f17
feat: add surface segmentation representation
sedghi Feb 3, 2023
86b8f81
fix examples
sedghi Feb 3, 2023
7214c35
revert
sedghi Jul 1, 2023
c849e78
Merge branch 'main' of github.com:cornerstonejs/cornerstone3D into fe…
sedghi Sep 28, 2023
095d5eb
rename
sedghi Sep 28, 2023
b4c4216
webpack
sedghi Sep 28, 2023
f3845b8
webpack
sedghi Sep 28, 2023
193c34c
Add surface clipping via filter
rodrigobasilio2022 Oct 3, 2023
4a5014e
Reset camera clipping range
rodrigobasilio2022 Oct 4, 2023
862bb8a
refactor how viewport updates clipping planes
rodrigobasilio2022 Oct 4, 2023
28f2dc5
Add polydata cache
rodrigobasilio2022 Oct 4, 2023
9bfd377
Add event for clipping planes update
rodrigobasilio2022 Oct 4, 2023
c48c39f
Stack surface example created
rodrigobasilio2022 Oct 5, 2023
cc3411e
Refactor imageSlice creation
rodrigobasilio2022 Oct 5, 2023
7023837
fix polydata not showing in stack
rodrigobasilio2022 Oct 5, 2023
07a4da4
Adding a RT stack example
rodrigobasilio2022 Oct 5, 2023
8964f7f
Create SegmentationIntersectionTool
rodrigobasilio2022 Oct 6, 2023
6f00829
fix
sedghi Oct 6, 2023
022939a
Remove duplicate points
rodrigobasilio2022 Oct 6, 2023
8f3ad71
Fix color bug and remove duplicate points
rodrigobasilio2022 Oct 6, 2023
3ada3e2
Fix bug multiple polylines
rodrigobasilio2022 Oct 9, 2023
3d0c578
Refactor unwanted canAdded planes variable
rodrigobasilio2022 Oct 9, 2023
3492cd5
Restore file
rodrigobasilio2022 Oct 9, 2023
350c91b
Add comments in changed files
rodrigobasilio2022 Oct 9, 2023
1a87432
minor refactoring to build and update api
rodrigobasilio2022 Oct 9, 2023
48d7e55
Fix minor regression bug
rodrigobasilio2022 Oct 9, 2023
8d85975
Merge branch 'main' of github.com:cornerstonejs/cornerstone3D into pr…
sedghi Oct 18, 2023
0ea6c17
cleanup
sedghi Oct 18, 2023
d75e8f8
wip
sedghi Oct 18, 2023
080cadc
wip
sedghi Oct 18, 2023
0bfff5a
cleanup
sedghi Oct 18, 2023
b0e116d
fix the performance issue with zoom and pan revisiting same slice
sedghi Oct 18, 2023
0bdc040
fix reconstructed views
sedghi Oct 19, 2023
d0119f1
api
sedghi Oct 19, 2023
654c455
demo
sedghi Oct 19, 2023
57d0833
doc
sedghi Oct 19, 2023
62f3e44
fix vtk actors
sedghi Oct 19, 2023
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
41 changes: 36 additions & 5 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```ts

import type { GetGPUTier } from 'detect-gpu';
import { mat3 } from 'gl-matrix';
import { mat4 } from 'gl-matrix';
import type { TierResult } from 'detect-gpu';
import { vec3 } from 'gl-matrix';
Expand All @@ -26,6 +27,7 @@ type ActorEntry = {
actor: Actor | VolumeActor | ImageActor;
referenceId?: string;
slabThickness?: number;
clippingFilter?: any;
};

// @public (undocumented)
Expand Down Expand Up @@ -651,6 +653,8 @@ export enum EVENTS {
// (undocumented)
CAMERA_RESET = "CORNERSTONE_CAMERA_RESET",
// (undocumented)
CLIPPING_PLANES_UPDATED = "CORNERSTONE_CLIPPING_PLANES_UPDATED",
// (undocumented)
DISPLAY_AREA_MODIFIED = "CORNERSTONE_DISPLAY_AREA_MODIFIED",
// (undocumented)
ELEMENT_DISABLED = "CORNERSTONE_ELEMENT_DISABLED",
Expand Down Expand Up @@ -774,7 +778,9 @@ export { geometryLoader }
// @public (undocumented)
enum GeometryType {
// (undocumented)
CONTOUR = "contour"
CONTOUR = "contour",
// (undocumented)
SURFACE = "Surface"
}

// @public (undocumented)
Expand Down Expand Up @@ -844,7 +850,10 @@ export function getShouldUseSharedArrayBuffer(): boolean;
function getSliceRange(volumeActor: VolumeActor, viewPlaneNormal: Point3, focalPoint: Point3): ActorSliceRange;

// @public (undocumented)
function getSpacingInNormalDirection(imageVolume: IImageVolume, viewPlaneNormal: Point3): number;
function getSpacingInNormalDirection(imageVolume: IImageVolume | {
direction: mat3;
spacing: Point3;
}, viewPlaneNormal: Point3): number;

// @public (undocumented)
function getTargetVolumeAndSpacingInNormalDir(viewport: IVolumeViewport, camera: ICamera, targetVolumeId?: string): {
Expand Down Expand Up @@ -1080,7 +1089,7 @@ interface IEnabledElement {
// @public (undocumented)
interface IGeometry {
// (undocumented)
data: IContourSet;
data: IContourSet | Surface;
// (undocumented)
id: string;
// (undocumented)
Expand Down Expand Up @@ -2105,6 +2114,14 @@ type PTScaling = {
// @public (undocumented)
type PublicContourSetData = ContourSetData;

// @public (undocumented)
type PublicSurfaceData = {
id: string;
data: SurfaceData;
frameOfReferenceUID: string;
color?: Point3;
};

// @public (undocumented)
type PublicViewportInput = {
element: HTMLDivElement;
Expand Down Expand Up @@ -2437,6 +2454,12 @@ type StackViewportScrollEventDetail = {
direction: number;
};

// @public (undocumented)
type SurfaceData = {
points: number[];
polys: number[];
};

// @public (undocumented)
function threePlaneIntersection(firstPlane: Plane, secondPlane: Plane, thirdPlane: Plane): Point3;

Expand Down Expand Up @@ -2545,6 +2568,8 @@ declare namespace Types {
ContourData,
IContourSet,
IContour,
PublicSurfaceData,
SurfaceData,
RGB,
ColormapPublic,
ColormapRegistration,
Expand Down Expand Up @@ -2700,8 +2725,12 @@ export class Viewport implements IViewport {
// (undocumented)
_isInBounds(point: Point3, bounds: number[]): boolean;
// (undocumented)
protected newActorAdded: boolean;
// (undocumented)
options: ViewportInputOptions;
// (undocumented)
protected posProcessNewActors(): void;
// (undocumented)
_removeActor(actorUID: string): void;
// (undocumented)
removeActors(actorUIDs: Array<string>): void;
Expand Down Expand Up @@ -2758,7 +2787,7 @@ export class Viewport implements IViewport {
// (undocumented)
readonly type: ViewportType;
// (undocumented)
protected updateClippingPlanesForActors(updatedCamera: ICamera): void;
protected updateClippingPlanesForActors(updatedCamera: ICamera): Promise<void>;
// (undocumented)
updateRenderingPipeline: () => void;
// (undocumented)
Expand Down Expand Up @@ -2954,7 +2983,7 @@ export class VolumeViewport extends BaseVolumeViewport {
// (undocumented)
getCurrentImageId: () => string | undefined;
// (undocumented)
getCurrentImageIdIndex: () => number | undefined;
getCurrentImageIdIndex: (volumeId?: string) => number;
// (undocumented)
getRotation: () => number;
// (undocumented)
Expand All @@ -2981,6 +3010,8 @@ export class VolumeViewport3D extends BaseVolumeViewport {
// (undocumented)
getRotation: () => number;
// (undocumented)
posProcessNewActors(): void;
// (undocumented)
resetCamera(resetPan?: boolean, resetZoom?: boolean, resetToCenter?: boolean): boolean;
// (undocumented)
resetProperties(volumeId?: string): void;
Expand Down
17 changes: 16 additions & 1 deletion common/reviews/api/nifti-volume-loader.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ActorEntry = {
actor: Actor | VolumeActor | ImageActor;
referenceId?: string;
slabThickness?: number;
clippingFilter?: any;
};

// @public
Expand Down Expand Up @@ -660,7 +661,7 @@ interface IEnabledElement {
// @public (undocumented)
interface IGeometry {
// (undocumented)
data: IContourSet;
data: IContourSet | Surface;
// (undocumented)
id: string;
// (undocumented)
Expand Down Expand Up @@ -1395,6 +1396,14 @@ type PTScaling = {
// @public (undocumented)
type PublicContourSetData = ContourSetData;

// @public (undocumented)
type PublicSurfaceData = {
id: string;
data: SurfaceData;
frameOfReferenceUID: string;
color?: Point3;
};

// @public
type PublicViewportInput = {
element: HTMLDivElement;
Expand Down Expand Up @@ -1463,6 +1472,12 @@ type StackViewportScrollEventDetail = {
direction: number;
};

// @public (undocumented)
type SurfaceData = {
points: number[];
polys: number[];
};

// @public
type TransformMatrix2D = [number, number, number, number, number, number];

Expand Down
25 changes: 22 additions & 3 deletions common/reviews/api/streaming-image-volume-loader.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type ActorEntry = {
actor: Actor | VolumeActor | ImageActor;
referenceId?: string;
slabThickness?: number;
clippingFilter?: any;
};

// @public
Expand Down Expand Up @@ -472,6 +473,7 @@ enum Events {
CAMERA_MODIFIED = 'CORNERSTONE_CAMERA_MODIFIED',

CAMERA_RESET = 'CORNERSTONE_CAMERA_RESET',
CLIPPING_PLANES_UPDATED = 'CORNERSTONE_CLIPPING_PLANES_UPDATED',
DISPLAY_AREA_MODIFIED = 'CORNERSTONE_DISPLAY_AREA_MODIFIED',
ELEMENT_DISABLED = 'CORNERSTONE_ELEMENT_DISABLED',
ELEMENT_ENABLED = 'CORNERSTONE_ELEMENT_ENABLED',
Expand All @@ -482,20 +484,21 @@ enum Events {
IMAGE_LOAD_FAILED = 'CORNERSTONE_IMAGE_LOAD_FAILED',
IMAGE_LOAD_PROGRESS = 'CORNERSTONE_IMAGE_LOAD_PROGRESS',
IMAGE_LOADED = 'CORNERSTONE_IMAGE_LOADED',
IMAGE_RENDERED = 'CORNERSTONE_IMAGE_RENDERED',

IMAGE_RENDERED = 'CORNERSTONE_IMAGE_RENDERED',
IMAGE_SPACING_CALIBRATED = 'CORNERSTONE_IMAGE_SPACING_CALIBRATED',
IMAGE_VOLUME_LOADING_COMPLETED = 'CORNERSTONE_IMAGE_VOLUME_LOADING_COMPLETED',
IMAGE_VOLUME_MODIFIED = 'CORNERSTONE_IMAGE_VOLUME_MODIFIED',
PRE_STACK_NEW_IMAGE = 'CORNERSTONE_PRE_STACK_NEW_IMAGE',
STACK_NEW_IMAGE = 'CORNERSTONE_STACK_NEW_IMAGE',
STACK_VIEWPORT_NEW_STACK = 'CORNERSTONE_STACK_VIEWPORT_NEW_STACK',

STACK_VIEWPORT_SCROLL = 'CORNERSTONE_STACK_VIEWPORT_SCROLL',

VOI_MODIFIED = 'CORNERSTONE_VOI_MODIFIED',

VOLUME_CACHE_VOLUME_ADDED = 'CORNERSTONE_VOLUME_CACHE_VOLUME_ADDED',
VOLUME_CACHE_VOLUME_REMOVED = 'CORNERSTONE_VOLUME_CACHE_VOLUME_REMOVED',

VOLUME_LOADED = 'CORNERSTONE_VOLUME_LOADED',

VOLUME_LOADED_FAILED = 'CORNERSTONE_VOLUME_LOADED_FAILED',
Expand Down Expand Up @@ -571,6 +574,8 @@ type FlipDirection = {
enum GeometryType {
// (undocumented)
CONTOUR = 'contour',
// (undocumented)
SURFACE = 'Surface',
}

// @public (undocumented)
Expand Down Expand Up @@ -732,7 +737,7 @@ interface IEnabledElement {
// @public (undocumented)
interface IGeometry {
// (undocumented)
data: IContourSet;
data: IContourSet | Surface;
// (undocumented)
id: string;
// (undocumented)
Expand Down Expand Up @@ -1464,6 +1469,14 @@ type PTScaling = {
// @public (undocumented)
type PublicContourSetData = ContourSetData;

// @public (undocumented)
type PublicSurfaceData = {
id: string;
data: SurfaceData;
frameOfReferenceUID: string;
color?: Point3;
};

// @public
type PublicViewportInput = {
element: HTMLDivElement;
Expand Down Expand Up @@ -1595,6 +1608,12 @@ export class StreamingImageVolume extends BaseStreamingImageVolume {
getScalarData(): Types.VolumeScalarData;
}

// @public (undocumented)
type SurfaceData = {
points: number[];
polys: number[];
};

// @public
type TransformMatrix2D = [number, number, number, number, number, number];

Expand Down
Loading