-
Notifications
You must be signed in to change notification settings - Fork 245
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: added display area to viewport #280
Merged
wayfarer3130
merged 3 commits into
cornerstonejs:main
from
gradienthealth:gradienthealth/added_initial_display_area
Apr 12, 2023
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,6 +403,27 @@ interface CustomEvent_2<T = any> extends Event { | |
): void; | ||
} | ||
|
||
// @public (undocumented) | ||
type DisplayArea = { | ||
imageArea: [number, number]; // areaX, areaY | ||
imageCanvasPoint: { | ||
imagePoint: [number, number]; // imageX, imageY | ||
canvasPoint: [number, number]; // canvasX, canvasY | ||
}; | ||
storeAsInitialCamera: boolean; | ||
}; | ||
|
||
// @public | ||
type DisplayAreaModifiedEvent = CustomEvent_2<DisplayAreaModifiedEventDetail>; | ||
|
||
// @public | ||
type DisplayAreaModifiedEventDetail = { | ||
viewportId: string; | ||
displayArea: DisplayArea; | ||
volumeId?: string; | ||
storeAsInitialCamera?: boolean; | ||
}; | ||
|
||
// @public | ||
enum DynamicOperatorType { | ||
AVERAGE = 'AVERAGE', | ||
|
@@ -436,6 +457,7 @@ enum Events { | |
CAMERA_MODIFIED = 'CORNERSTONE_CAMERA_MODIFIED', | ||
|
||
CAMERA_RESET = 'CORNERSTONE_CAMERA_RESET', | ||
DISPLAY_AREA_MODIFIED = 'CORNERSTONE_DISPLAY_AREA_MODIFIED', | ||
ELEMENT_DISABLED = 'CORNERSTONE_ELEMENT_DISABLED', | ||
ELEMENT_ENABLED = 'CORNERSTONE_ELEMENT_ENABLED', | ||
GEOMETRY_CACHE_GEOMETRY_ADDED = 'CORNERSTONE_GEOMETRY_CACHE_GEOMETRY_ADDED', | ||
|
@@ -478,6 +500,8 @@ declare namespace EventTypes { | |
CameraModifiedEvent, | ||
VoiModifiedEvent, | ||
VoiModifiedEventDetail, | ||
DisplayAreaModifiedEvent, | ||
DisplayAreaModifiedEventDetail, | ||
ElementDisabledEvent, | ||
ElementDisabledEventDetail, | ||
ElementEnabledEvent, | ||
|
@@ -1078,6 +1102,7 @@ interface IViewport { | |
// (undocumented) | ||
_getCorners(bounds: Array<number>): Array<number>[]; | ||
getDefaultActor(): ActorEntry; | ||
getDisplayArea(): DisplayArea | undefined; | ||
getFrameOfReferenceUID: () => string; | ||
getPan(): Point2; | ||
getRenderer(): void; | ||
|
@@ -1094,6 +1119,11 @@ interface IViewport { | |
reset(immediate: boolean): void; | ||
setActors(actors: Array<ActorEntry>): void; | ||
setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void; | ||
setDisplayArea( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When there are more than one option, the options should go into a typed options property so that the number of arguments doesn't change. |
||
displayArea: DisplayArea, | ||
callResetCamera?: boolean, | ||
suppressEvents?: boolean | ||
); | ||
setOptions(options: ViewportInputOptions, immediate: boolean): void; | ||
setPan(pan: Point2, storeAsInitialCamera?: boolean); | ||
setZoom(zoom: number, storeAsInitialCamera?: boolean); | ||
|
@@ -1438,6 +1468,7 @@ type TransformMatrix2D = [number, number, number, number, number, number]; | |
type ViewportInputOptions = { | ||
background?: [number, number, number]; | ||
orientation?: OrientationAxis | OrientationVectors; | ||
displayArea?: DisplayArea; | ||
suppressEvents?: boolean; | ||
parallelProjection?: boolean; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should have it's own even - there should be a way to get properties changed, or this should trigger camera modified events. @sedghi - any thoughts about the event? Other properties don't have their own events.