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: Add range support for key image tool #1743

Merged
merged 18 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
59 changes: 36 additions & 23 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,22 @@ interface FlipDirection {
flipVertical?: boolean;
}

// @public (undocumented)
class FrameRange {
// (undocumented)
protected static frameRangeExtractor: RegExp;
// (undocumented)
protected static framesToImageId(imageId: string, range: FramesRange | string): string;
// (undocumented)
static framesToString(range: any): string;
// (undocumented)
static imageIdToFrameEnd(imageId: string): number;
// (undocumented)
protected static imageIdToFrames(imageId: string): FramesRange;
// (undocumented)
static imageIdToFrameStart(imageId: string): number;
}

// @public (undocumented)
interface GeneralSeriesModuleMetadata {
// (undocumented)
Expand Down Expand Up @@ -3415,7 +3431,7 @@ export class StackViewport extends Viewport {
// (undocumented)
getCornerstoneImage: () => IImage;
// (undocumented)
getCurrentImageId: () => string;
getCurrentImageId: (index?: number) => string;
// (undocumented)
getCurrentImageIdIndex: () => number;
// (undocumented)
Expand Down Expand Up @@ -3454,6 +3470,8 @@ export class StackViewport extends Viewport {
// (undocumented)
getSliceIndex: () => number;
// (undocumented)
getSliceIndexForImage(reference: string | ViewReference): number;
// (undocumented)
getSliceInfo(): {
sliceIndex: number;
slicePlane: number;
Expand Down Expand Up @@ -3914,6 +3932,7 @@ function updateVTKImageDataWithCornerstoneImage(sourceImageData: vtkImageData, i

declare namespace utilities {
export {
FrameRange,
eventListener,
invertRgbTransferFunction,
createSigmoidRGBTransferFunction,
Expand Down Expand Up @@ -4042,7 +4061,7 @@ export class VideoViewport extends Viewport {
// (undocumented)
getCamera(): ICamera;
// (undocumented)
getCurrentImageId(): string;
getCurrentImageId(index?: number): string;
// (undocumented)
getCurrentImageIdIndex(): number;
// (undocumented)
Expand Down Expand Up @@ -4086,6 +4105,8 @@ export class VideoViewport extends Viewport {
// (undocumented)
getSliceIndex(): number;
// (undocumented)
getSliceIndexForImage(reference: string | ViewReference): number;
// (undocumented)
getSliceViewInfo(): {
width: number;
height: number;
Expand Down Expand Up @@ -4329,7 +4350,7 @@ export class Viewport {
// (undocumented)
_isInBounds(point: Point3, bounds: number[]): boolean;
// (undocumented)
isReferenceViewable(viewRef: ViewReference, options?: ReferenceCompatibleOptions): boolean | unknown;
isReferenceViewable(viewRef: ViewReference, options?: ReferenceCompatibleOptions): boolean;
// (undocumented)
options: ViewportInputOptions;
// (undocumented)
Expand Down Expand Up @@ -4566,36 +4587,28 @@ interface ViewPresentationSelector {
}

// @public (undocumented)
interface ViewReference {
// (undocumented)
bounds?: BoundsLPS;
// (undocumented)
cameraFocalPoint?: Point3;
// (undocumented)
type ViewReference = {
FrameOfReferenceUID?: string;
// (undocumented)
referencedImageId?: string;
// (undocumented)
sliceIndex?: number | [number, number];
// (undocumented)
referencedImageURI?: string;
multiSliceReference?: ReferencedImageRange;
cameraFocalPoint?: Point3;
viewPlaneNormal?: Point3;
// (undocumented)
viewUp?: Point3;
// (undocumented)
sliceIndex?: number;
volumeId?: string;
}
bounds?: BoundsLPS;
};

// @public (undocumented)
interface ViewReferenceSpecifier {
// (undocumented)
type ViewReferenceSpecifier = {
sliceIndex?: number;
rangeEndSliceIndex?: number;
frameNumber?: number;
forFrameOfReference?: boolean;
// (undocumented)
points?: Point3[];
// (undocumented)
sliceIndex?: number | [number, number];
// (undocumented)
volumeId?: string;
}
};

// @public (undocumented)
interface VOI {
Expand Down
43 changes: 22 additions & 21 deletions common/reviews/api/tools.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,25 +336,6 @@ export abstract class AnnotationDisplayTool extends BaseTool {
static toolName: any;
}

// @public (undocumented)
class AnnotationFrameRange {
// (undocumented)
protected static frameRangeExtractor: RegExp;
// (undocumented)
protected static framesToImageId(imageId: string, range: FramesRange | string): string;
// (undocumented)
static framesToString(range: any): string;
// (undocumented)
static getFrameRange(annotation: Annotation): number | [number, number];
// (undocumented)
protected static imageIdToFrames(imageId: string): FramesRange;
// (undocumented)
static setFrameRange(annotation: Annotation, range: FramesRange | string, eventBase?: {
viewportId: any;
renderingEngineId: any;
}): void;
}

// @public (undocumented)
class AnnotationGroup {
constructor();
Expand Down Expand Up @@ -433,6 +414,24 @@ type AnnotationModifiedEventDetail = {
// @public (undocumented)
type AnnotationModifiedEventType = Types_2.CustomEventType<AnnotationModifiedEventDetail>;

// @public (undocumented)
class AnnotationMultiSlice {
// (undocumented)
static getFrameRange(annotation: Annotation): number | [number, number];
// (undocumented)
static getFrameRangeStr(annotation: Annotation): string;
// (undocumented)
static setEndRange(viewport: any, annotation: any, endRange?: any): void;
// (undocumented)
static setRange(viewport: any, annotation: any, startRange?: number, endRange?: number): void;
// (undocumented)
static setSingle(viewport: any, annotation: any, current?: any): void;
// (undocumented)
static setStartRange(viewport: any, annotation: any, startRange?: any): void;
// (undocumented)
static setViewportFrameRange(viewport: any, specifier: any): void;
}

// @public (undocumented)
type AnnotationRemovedEventDetail = {
annotation: Annotation;
Expand Down Expand Up @@ -519,7 +518,7 @@ export abstract class AnnotationTool extends AnnotationDisplayTool {
// (undocumented)
static createAnnotation(...annotationBaseData: any[]): Annotation;
// (undocumented)
static createAnnotationForViewport(viewport: any, ...annotationBaseData: any[]): Annotation;
static createAnnotationForViewport<T extends Annotation>(viewport: any, ...annotationBaseData: any[]): T;
// (undocumented)
static createAnnotationMemo(element: any, annotation: Annotation, options?: {
newAnnotation?: boolean;
Expand Down Expand Up @@ -992,6 +991,8 @@ enum ChangeTypes {
// (undocumented)
InterpolationUpdated = "InterpolationUpdated",
// (undocumented)
MetadataReferenceModified = "MetadataReferenceModified",
// (undocumented)
StatsUpdated = "StatsUpdated"
}

Expand Down Expand Up @@ -6738,7 +6739,7 @@ declare namespace utilities {
pointToString,
polyDataUtils,
voi,
AnnotationFrameRange as annotationFrameRange,
AnnotationMultiSlice,
contourSegmentation,
annotationHydration,
getClosestImageIdForStackViewport,
Expand Down
Loading
Loading