Skip to content

Commit

Permalink
feat(displayArea): add display area to hanging protocol (OHIF#3691)
Browse files Browse the repository at this point in the history
Co-authored-by: Ouwen Huang <[email protected]>
  • Loading branch information
2 people authored and Sofien-Sellami committed Oct 5, 2023
1 parent c4af76d commit fedbed3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
const type = viewportInfo.getViewportType();
const background = viewportInfo.getBackground();
const orientation = viewportInfo.getOrientation();
const displayArea = viewportInfo.getDisplayArea();

const viewportInput: Types.PublicViewportInput = {
viewportId,
Expand All @@ -257,6 +258,7 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
defaultOptions: {
background,
orientation,
displayArea,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ViewportOptions = {
presentationIds?: UITypes.PresentationIds;
orientation?: Enums.OrientationAxis;
background?: Types.Point3;
displayArea?: Types.DisplayArea;
syncGroups?: SyncGroup[];
initialImageOptions?: InitialImageOptions;
customViewportProps?: Record<string, unknown>;
Expand All @@ -39,6 +40,7 @@ export type PublicViewportOptions = {
viewportId?: string;
orientation?: Enums.OrientationAxis;
background?: Types.Point3;
displayArea?: Types.DisplayArea;
syncGroups?: SyncGroup[];
initialImageOptions?: InitialImageOptions;
customViewportProps?: Record<string, unknown>;
Expand Down Expand Up @@ -265,6 +267,10 @@ class ViewportInfo {
return this.viewportOptions.orientation;
}

public getDisplayArea(): Types.DisplayArea {
return this.viewportOptions.displayArea;
}

public getInitialImageOptions(): InitialImageOptions {
return this.viewportOptions.initialImageOptions;
}
Expand Down
1 change: 1 addition & 0 deletions platform/docs/docs/platform/extensions/modules/hpModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ As you can see in the hanging protocol we defined three viewports (but only show
- `toolGroupId`: tool group that will be used for the viewport (optional)
- `initialImageOptions`: initial image options (optional - can be specific imageIndex number or preset (first, middle, last))
- `syncGroups`: sync groups for the viewport (optional)
-The `displayArea` parameter refers to the designated area within the viewport where a specific portion of the image can be displayed. This parameter is optional and allows you to choose the location of the image within the viewport. For example, in mammography images, you can display the left breast on the left side of the viewport and the right breast on the right side, with the chest wall positioned in the middle. To understand how to define the display area, you can refer to the live example provided by CornerstoneJS [here](https://www.cornerstonejs.org/live-examples/programaticpanzoom).


2. `displaySets`: defines the display sets that are displayed on a viewport. It is an array of objects, each object being one display set.
Expand Down

0 comments on commit fedbed3

Please sign in to comment.