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(segmentation): Refactor segmentation and style handling #1449

Merged
merged 38 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f2bd87c
try to not publish source maps
sedghi Aug 26, 2024
1981388
wip for ohif changes
sedghi Aug 27, 2024
c439fbf
annotation fix
sedghi Aug 27, 2024
269f210
fix camera sync
sedghi Aug 27, 2024
23cc6d0
actor uid should not be volume id
sedghi Aug 28, 2024
9c39713
fix the invert and colormap issue
sedghi Aug 28, 2024
2b567db
fix stuff
sedghi Aug 29, 2024
b55e060
wip
sedghi Aug 30, 2024
f8d5fe8
• Update StackViewport to use targetOverlayImageId instead of referen…
sedghi Aug 30, 2024
c46496e
CornerstoneJS: Refactor and improve code quality in various modules
sedghi Aug 30, 2024
7876635
**Rendering Engine: Refactor Camera Clipping Range**
sedghi Aug 30, 2024
c886c5c
**Feature: Remove VolumeRotateMouseWheelTool and Replace with StackSc…
sedghi Aug 30, 2024
83f5a20
Labelmap: Replace Segmentation with Labelmap in Core and Tools
sedghi Aug 30, 2024
92608a7
Segmentation Tools: Refactor Volume Segmentations for BaseVolumeViewport
sedghi Sep 3, 2024
5b7038a
Feature: Update Labelmap Tool for Volume ID Handling
sedghi Sep 3, 2024
3f26147
Segmentation: Refactor Segmentation Rendering Engine and State Manager
sedghi Sep 4, 2024
c8f9d3b
Segmentation: Remove segmentation representations from state and view…
sedghi Sep 4, 2024
3f8b8b5
Core: Refactor VideoViewport and VolumeViewport3D for improved functi…
sedghi Sep 5, 2024
c010437
SegmentationStateManager: Refactor SegmentationStateManager to improv…
sedghi Sep 5, 2024
4c37a4f
Core: Migrate voxelManager to new system and refactor pointInShapeCal…
sedghi Sep 5, 2024
12e8372
StackViewport: Refactor camera and viewport properties handling
sedghi Sep 5, 2024
7aa7301
Cornerstone Tools: Refactor VoxelManager and Segmentation Tools
sedghi Sep 6, 2024
56ce4df
Core: Refactor image ID handling and segmentation rendering
sedghi Sep 9, 2024
2ee988b
fix overlay
sedghi Sep 9, 2024
111de8c
fix remove render
sedghi Sep 9, 2024
ae98c4f
fix
sedghi Sep 10, 2024
3031f25
towards viewport based segmentation representation
sedghi Sep 10, 2024
6bd9085
fix more build issues
sedghi Sep 10, 2024
5968bf8
fix various build issues
sedghi Sep 11, 2024
986f8bc
fix polyseg stuff
sedghi Sep 11, 2024
3ea66df
finalized
sedghi Sep 11, 2024
e25bcba
apply review comments
sedghi Sep 12, 2024
c187f0c
api
sedghi Sep 12, 2024
ebd40c1
Volume Viewport: Enhance volume handling and utilities
sedghi Sep 12, 2024
57410be
Tools: Remove renderingEngineId from getViewportsWithVolumeId and get…
sedghi Sep 12, 2024
fd54eb1
fix tests
sedghi Sep 12, 2024
125a7a0
Merge branch 'beta' of github.com:cornerstonejs/cornerstone3D into fi…
sedghi Sep 12, 2024
193bfac
fix deploy
sedghi Sep 12, 2024
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
74 changes: 52 additions & 22 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ export abstract class BaseVolumeViewport extends Viewport {
// (undocumented)
getSlabThickness(): number;
// (undocumented)
getSliceIndex(): number;
// (undocumented)
getSliceViewInfo(): {
width: number;
height: number;
Expand Down Expand Up @@ -208,6 +210,10 @@ export abstract class BaseVolumeViewport extends Viewport {
// (undocumented)
abstract setBlendMode(blendMode: BlendModes, filterActorUIDs?: string[], immediate?: boolean): void;
// (undocumented)
setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void;
// (undocumented)
protected setCameraClippingRange(): void;
// (undocumented)
setDefaultProperties(ViewportProperties: VolumeViewportProperties, volumeId?: string): void;
// (undocumented)
protected setInterpolationType(interpolationType: InterpolationType, volumeId?: string): void;
Expand Down Expand Up @@ -789,17 +795,19 @@ function createAndCacheDerivedImage(referencedImageId: string, options?: Derived
// @public (undocumented)
function createAndCacheDerivedImages(referencedImageIds: string[], options?: DerivedImageOptions & {
getDerivedImageId?: (referencedImageId: string) => string;
targetBufferType?: PixelDataTypedArrayString;
targetBuffer?: {
type: PixelDataTypedArrayString;
};
}): IImage[];

// @public (undocumented)
function createAndCacheDerivedSegmentationImage(referencedImageId: string, options?: DerivedImageOptions): IImage;
function createAndCacheDerivedLabelmapImage(referencedImageId: string, options?: DerivedImageOptions): IImage;

// @public (undocumented)
function createAndCacheDerivedSegmentationImages(referencedImageIds: string[], options?: DerivedImageOptions): IImage[];
function createAndCacheDerivedLabelmapImages(referencedImageIds: string[], options?: DerivedImageOptions): IImage[];

// @public (undocumented)
function createAndCacheDerivedSegmentationVolume(referencedVolumeId: string, options?: DerivedVolumeOptions): IImageVolume;
function createAndCacheDerivedLabelmapVolume(referencedVolumeId: string, options?: DerivedVolumeOptions): IImageVolume;

// @public (undocumented)
function createAndCacheDerivedVolume(referencedVolumeId: string, options: DerivedVolumeOptions): IImageVolume;
Expand All @@ -820,13 +828,13 @@ function createAndCacheVolumeFromImages(volumeId: string, imageIds: string[]): P
function createLinearRGBTransferFunction(voiRange: VOIRange): vtkColorTransferFunction;

// @public (undocumented)
function createLocalSegmentationVolume(options: LocalVolumeOptions, volumeId: string, preventCache?: boolean): IImageVolume;
function createLocalLabelmapVolume(options: LocalVolumeOptions, volumeId: string, preventCache?: boolean): IImageVolume;

// @public (undocumented)
function createLocalVolume(volumeId: string, options?: LocalVolumeOptions): IImageVolume;

// @public (undocumented)
function createSigmoidRGBTransferFunction(voiRange: VOIRange, approximationNodes?: number): unknown;
function createSigmoidRGBTransferFunction(voiRange: VOIRange, approximationNodes?: number): vtkColorTransferFunction;

// @public (undocumented)
export function createVolumeActor(props: createVolumeActorInterface, element: HTMLDivElement, viewportId: string, suppressEvents?: boolean): Promise<VolumeActor>;
Expand Down Expand Up @@ -855,6 +863,9 @@ interface DataSetOptions {
// @public (undocumented)
function decimate(list: unknown[], interleave: number, offset?: number): number[];

// @public (undocumented)
function deepClone(obj: unknown): unknown;

// @public (undocumented)
const deepMerge: (target?: {}, source?: {}, optionsArgument?: any) => any;

Expand Down Expand Up @@ -1035,7 +1046,7 @@ export enum EVENTS {
// (undocumented)
STACK_VIEWPORT_SCROLL = "CORNERSTONE_STACK_VIEWPORT_SCROLL",
// (undocumented)
VIEWPORT_NEW_IMAGE_SET = "CORNERSTONE_STACK_VIEWPORT_NEW_STACK",
VIEWPORT_NEW_IMAGE_SET = "CORNERSTONE_VIEWPORT_NEW_IMAGE_SET",
// (undocumented)
VOI_MODIFIED = "CORNERSTONE_VOI_MODIFIED",
// (undocumented)
Expand Down Expand Up @@ -1826,8 +1837,8 @@ declare namespace imageLoader {
registerImageLoader,
registerUnknownImageLoader,
unregisterAllImageLoaders,
createAndCacheDerivedSegmentationImages,
createAndCacheDerivedSegmentationImage,
createAndCacheDerivedLabelmapImages,
createAndCacheDerivedLabelmapImage,
ImageLoaderOptions
}
}
Expand Down Expand Up @@ -2011,7 +2022,7 @@ interface ImagePlaneModuleMetadata {
// (undocumented)
columnPixelSpacing: number | null;
// (undocumented)
columns: string;
columns: number;
// (undocumented)
frameOfReferenceUID: string;
// (undocumented)
Expand All @@ -2025,11 +2036,11 @@ interface ImagePlaneModuleMetadata {
// (undocumented)
rowPixelSpacing: number | null;
// (undocumented)
rows: string;
rows: number;
// (undocumented)
sliceLocation: string;
sliceLocation: number;
// (undocumented)
sliceThickness: string;
sliceThickness: number;
// (undocumented)
usingDefaultValues: boolean;
}
Expand Down Expand Up @@ -2438,7 +2449,9 @@ interface LocalVolumeOptions {
// (undocumented)
spacing: Point3;
// (undocumented)
targetBufferType?: PixelDataTypedArrayString;
targetBuffer?: {
type: PixelDataTypedArrayString;
};
}

// @public (undocumented)
Expand Down Expand Up @@ -2644,6 +2657,9 @@ type Point3 = [number, number, number];
// @public (undocumented)
type Point4 = [number, number, number, number];

// @public (undocumented)
function pointInShapeCallback(imageData: vtkImageData | CPUImageData, pointInShapeFn: ShapeFnCriteria, callback?: PointInShapeCallback, boundsIJK?: BoundsIJK): Array<PointInShape>;

// @public (undocumented)
class PointsManager<T> {
constructor(configuration?: PolyDataPointConfiguration);
Expand Down Expand Up @@ -3702,7 +3718,9 @@ declare namespace utilities {
getDynamicVolumeInfo,
autoLoad,
scaleArray,
splitImageIdsBy4DTags
deepClone,
splitImageIdsBy4DTags,
pointInShapeCallback
}
}
export { utilities }
Expand Down Expand Up @@ -3909,7 +3927,7 @@ export class Viewport {
// (undocumented)
addActor(actorEntry: ActorEntry): void;
// (undocumented)
addActors(actors: ActorEntry[], resetCameraPanAndZoom?: boolean): void;
addActors(actors: ActorEntry[], resetCamera?: boolean): void;
// (undocumented)
addWidget: (widgetId: any, widget: any) => void;
// (undocumented)
Expand Down Expand Up @@ -4190,6 +4208,8 @@ interface ViewportProperties {
// (undocumented)
invert?: boolean;
// (undocumented)
preset?: string;
// (undocumented)
VOILUTFunction?: VOILUTFunctionType;
// (undocumented)
voiRange?: VOIRange;
Expand Down Expand Up @@ -4392,8 +4412,8 @@ declare namespace volumeLoader {
getVolumeLoaderSchemes,
registerUnknownVolumeLoader,
getUnknownVolumeLoaderSchema,
createAndCacheDerivedSegmentationVolume,
createLocalSegmentationVolume,
createAndCacheDerivedLabelmapVolume,
createLocalLabelmapVolume,
LocalVolumeOptions
}
}
Expand Down Expand Up @@ -4512,6 +4532,8 @@ export class VolumeViewport extends BaseVolumeViewport {
// (undocumented)
setBlendMode(blendMode: BlendModes, filterActorUIDs?: any[], immediate?: boolean): void;
// (undocumented)
protected setCameraClippingRange(): void;
// (undocumented)
setOrientation(orientation: OrientationAxis | OrientationVectors, immediate?: boolean): void;
// (undocumented)
setSlabThickness(slabThickness: number, filterActorUIDs?: any[]): void;
Expand All @@ -4529,18 +4551,24 @@ export class VolumeViewport3D extends BaseVolumeViewport {
// (undocumented)
getRotation: () => number;
// (undocumented)
getSliceIndex(): number;
// (undocumented)
resetCamera({ resetPan, resetZoom, resetToCenter, }?: {
resetPan?: boolean;
resetZoom?: boolean;
resetToCenter?: boolean;
}): boolean;
// (undocumented)
resetCameraForResize: () => boolean;
// (undocumented)
resetProperties(volumeId?: string): void;
// (undocumented)
resetSlabThickness(): void;
// (undocumented)
setBlendMode(blendMode: BlendModes, filterActorUIDs?: string[], immediate?: boolean): void;
// (undocumented)
protected setCameraClippingRange(): void;
// (undocumented)
setSlabThickness(slabThickness: number, filterActorUIDs?: string[]): void;
}

Expand All @@ -4561,8 +4589,6 @@ class VoxelManager<T> {
// (undocumented)
addPoint(point: Point3 | number): void;
// (undocumented)
boundsIJK: BoundsIJK;
// (undocumented)
get bytePerVoxel(): number;
// (undocumented)
clear(): void;
Expand Down Expand Up @@ -4644,6 +4670,8 @@ class VoxelManager<T> {
// (undocumented)
_getConstructor?: () => new (length: number) => PixelDataTypedArray;
// (undocumented)
getDefaultBounds(): BoundsIJK;
// (undocumented)
getMiddleSliceData: () => PixelDataTypedArray;
// (undocumented)
getPoints(): Point3[];
Expand Down Expand Up @@ -4690,6 +4718,8 @@ class VoxelManager<T> {
// (undocumented)
setCompleteScalarDataArray?: (scalarData: ArrayLike<number>) => void;
// (undocumented)
setScalarData(newScalarData: PixelDataTypedArray): void;
// (undocumented)
get sizeInBytes(): number;
// (undocumented)
sourceVoxelManager: IVoxelManager<T>;
Expand Down Expand Up @@ -4741,8 +4771,6 @@ export class WSIViewport extends Viewport {
// (undocumented)
getProperties: () => WSIViewportProperties;
// (undocumented)
getReferenceId(): string;
// (undocumented)
getRotation: () => number;
// (undocumented)
protected getScalarData(): any;
Expand All @@ -4753,6 +4781,8 @@ export class WSIViewport extends Viewport {
// (undocumented)
getView(): any;
// (undocumented)
getViewReferenceId(): string;
// (undocumented)
getZoom(): any;
// (undocumented)
hasImageURI(imageURI: string): boolean;
Expand Down
Loading