Import and create new Viewer Communication component in your project:
const viewerCommunication = new ViewerCommunication(targetURL, integration);
Parameters:
-
targetURL
- MedDream Viewer URL. -
integration
(Optional) - Integration type:study
ortoken
. Default value:study
.
const windowReference = viewerCommunication.getWindowReference();
const windowReference = viewerCommunication.findWindowReference();
viewerCommunication.focusWindow();
viewerCommunication.postActionMessage(actionType, actionData);
Parameters:
-
actionType
- Action message command type. -
actionData
- Data needed for action message.
For more details about available action messages check: MedDream communication documentation
.
const integrationType = viewerCommunication.getIntegrationType();
viewerCommunication.updateIntegrationType(newIntegrationType);
Parameter:
-
newIntegrationType
- Integration type:study
ortoken
.
viewerCommunication.openInMedDreamWindow(studies/token);
Parameters:
-
studies
(Forstudy
integration) - Study uid's list separated with,
. -
token
(Fortoken
integration) - Token with study information.
viewerCommunication.addToMedDreamWindow(studies/token);
Parameters:
-
studies
(Forstudy
integration) - Study uid's list separated with,
. -
token
(Fortoken
integration) - Token with study information.
viewerCommunication.replaceInMedDreamWindow(studies/token);
Parameters:
-
studies
(Forstudy
integration) - Study uid's list separated with,
. -
token
(Fortoken
integration) - Token with study information.
viewerCommunication.openMedDreamToIframe(iframeId, studies/token);
Parameters:
-
iframeId
- Iframe element id. -
studies
(Forstudy
integration) - Study uid's list separated with,
. -
token
(Fortoken
integration) - Token with study information.
viewerCommunication.openStudy(study);
Parameter:
-
study
- Study uid.
viewerCommunication.openStudies(studies);
Parameter:
-
studies
- Array of study uid's.
viewerCommunication.replaceStudies(studies);
Parameter:
-
studies
- Array of study uid's.
viewerCommunication.preloadStudies(studies);
Parameter:
-
studies
- Array of study uid's.
viewerCommunication.cacheStudies(studies);
Parameter:
-
studies
- Array of study objects. Each study object has studyUid and storageId parameters.
Array example:
const studies = [
{
studyUid: 'study-uid-1',
storageId: 'storage-id'
},
{
studyUid: 'study-uid-2',
storageId: 'storage-id'
}
];
viewerCommunication.closeStudies(studies);
Parameter:
-
studies
- Array of study objects. Each study object has studyUid and storageId parameters.
Array example:
const studies = [
{
studyUid: 'study-uid-1',
storageId: 'storage-id'
}
];
viewerCommunication.openStudies(token);
Parameter:
-
token
- Generated token with studies information.
viewerCommunication.replaceStudies(token);
Parameter:
-
token
- Generated token with studies information.
viewerCommunication.preloadStudies(token);
Parameter:
-
token
- Generated token with studies information.
viewerCommunication.cacheStudies(token);
Parameter:
-
token
- Generated token with studies information.
viewerCommunication.closeStudies(token);
Parameter:
-
token
- Generated token with studies information.
viewerCommunication.cacheAllStudies();
viewerCommunication.closeAllStudies();
viewerCommunication.setLayout(columns, rows);
Parameters:
-
columns
- Number of columns. -
rows
- Number of rows.
viewerCommunication.openInstance(instanceUid, viewportColumn, viewportRow, viewportActions);
Parameters:
-
instanceUid
- Unique instance db uid which has to be opened to viewport. -
viewportColumn
- Column number of desired viewport. -
viewportRow
- Row number of desired viewport. -
viewportActions
- Object of actions which have to be performed on viewport after instance is loaded.
Available viewport actions:
-
windowing
- Windowing level. Available options: "DEFAULT", "AUTO", "CUSTOM". If "CUSTOM" windowing is selected, customWindowing parameter has to be defined in viewportActions object. -
customWindowing
- Custom windowing level. This parameter allows to set custom windowing width and center levels. customWindowing has to be defined only when "CUSTOM" windowing is selected. -
rotation
- Instance rotation by defined number of degrees. -
verticalFlip
- Vertical instance flip. Available options: true/false. -
horizontalFlip
- Horizontal instance flip. Available options: true/false. -
scale
- Instance scaling option. Available options: "ORIGINAL", "FIT_TO_SCREEN", "CUSTOM". If "CUSTOM" scale is selected, customScale parameter has to be defined in viewportActions object. -
customScale
- Custom scale number. -
alignment
- Instance alignment in viewport. Available options: "RIGHT", "LEFT", "CENTER".
Viewport actions object example:
const viewportActions = {
windowing: 'CUSTOM', //DEFAULT, AUTO, CUSTOM
customWindowing: {width: 2, center: 2}, //Use if custom windowing
rotation: 45,
verticalFlip: true,
horizontalFlip: true,
scale: 'CUSTOM', //ORIGINAL, FIT_TO_SCREEN, CUSTOM
customScale: 0.5, //Use if custom scale
alignment: 'CENTER' //RIGHT, LEFT, CENTER
};
viewerCommunication.openInstanceExt(instanceUid, panelId, viewportColumn, viewportRow, viewportActions);
Parameters:
-
instanceUid
- Unique instance uid which has to be opened to viewport. Contrary toopenInstance
method, this is an UID, that uniquely identifies an instance among all open studies. -
panelId
- If provided, identifies the target panel, where this instance is intended to be opened up. If not provided, shall default to the first panel. -
viewportColumn
- Column number of desired viewport. -
viewportRow
- Row number of desired viewport. -
viewportActions
- Object of actions which have to be performed on viewport after instance is loaded.
For detailed explanation of available viewportActions, please check description of openIntance
method.
viewerCommunication.exportInstance(viewportColumn, viewportRow);
Parameters:
-
viewportColumn
(Optional) - Column number of desired viewport. -
viewportRow
(Optional) - Row number of desired viewport.
Currently active viewport instance is exported, if viewportColumn
and viewportRow
are not provided.
viewerCommunication.updateSegmentationToolPermissions(permissions);
Parameter:
-
permissions
- Object with segmentation permissions.
Available segmentation permissions:
-
boundingBoxView
- Permission to see bounding box tab. Default value: false. -
boundingBox2dEdit
- Permission to edit 2d bounding box tab. Default value: false. -
boundingBox3dEdit
- Permission to edit 3d bounding box tab. Default value: false. -
boundingBoxInfo
- Permission to see bounding box information button and panel. Default value: false. -
freeDrawView
- Permission to see free draw tab. Default value: false. -
freeDrawEdit
- Permission to edit free draw tab. Default value: false. -
smartPaintView
- Permission to see smart paint tab. Default value: false. -
smartPaint2dEdit
- Permission to use 2d smart paint tool. Default value: false. -
smartPaint3dEdit
- Permission to use 3d smart paint tool. Default value: false. -
smartPaintInfo
- Permission to see smart paint information button and panel. Default value: false.
Usage example:
const permissions = {
boundingBoxView: true,
boundingBox2dEdit: true,
boundingBox3dEdit: true,
boundingBoxInfo: false,
freeDrawView: true,
freeDrawEdit: true,
smartPaintView: true,
smartPaint2dEdit: true,
smartPaint3dEdit: true,
smartPaintInfo: false
};
viewerCommunication.updateSegmentationToolPermissions(permissions);
const callback = (studies) => console.log(studies);
viewerCommunication.subscribeGetOpenedStudiesEvent(callback);
viewerCommunication.getOpenedStudies();
Usage:
- Register subscribeGetOpenedStudiesEvent callback function.
- Call getOpenedStudies function to request opened studies data in callback function.
- Once message is processed, callback function will be triggered with opened studies array.
const callback = (openSeries) => console.log(openSeries);
viewerCommunication.subscribeGetOpenedSeriesEvent(callback);
viewerCommunication.getOpenedSeries();
Usage:
- Register subscribeGetOpenedSeriesEvent callback function.
- Call getOpenedSeries function to request opened series data in callback function.
- Once message is processed, callback function will be triggered with opened series array.
const callback = (viewportData) => console.log(viewportData);
viewerCommunication.subscribeGetViewportDataEvent(callback);
viewerCommunication.getViewportData();
Usage:
- Register subscribeGetViewportDataEvent callback function.
- Call getViewportData function to request active viewport data in callback function.
- Once message is processed, callback function will be triggered with viewport data object.
const callback = (viewportsInformation) => console.log(viewportsInformation);
viewerCommunication.subscribeGetViewportsInformationEvent(callback);
viewerCommunication.getViewportsInformation();
Usage:
- Register subscribeGetViewportsInformationEvent callback function.
- Call getViewportsInformation function to request viewports information in callback function.
- Once message is processed, callback function will be triggered with viewports information array.
const callback = (instanceMetadata) => console.log(instanceMetadata);
viewerCommunication.subscribeGetInstanceMetadataEvent(callback);
viewerCommunication.getInstanceMetadata(instanceUid);
Parameter:
-
instanceUid
- Unique instance uid which metadata you want.
Usage:
- Register subscribeGetInstanceMetadataEvent callback function.
- Call getInstanceMetadata function with instanceUid to request instance metadata in callback function.
- Once message is processed, callback function will be triggered with instance metadata object.
const callback = (snapshot) => console.log(snapshot);
viewerCommunication.subscribeGetSnapshotEvent(callback);
viewerCommunication.getSnapshot();
Usage:
- Register subscribeGetSnapshotEvent callback function.
- Call getSnapshot function to generate current layout with viewports snapshot and return it to callback function.
- Once message is processed, callback function will be triggered with snapshot data.
viewerCommunication.setSnapshot(layoutSnapshot);
Parameter:
-
layoutSnapshot
- layout and viewports snapshot which was requested by getSnapshot function and returned to callback function.
viewerCommunication.updateButtonVisibility(buttonsVisibility);
Parameter:
-
buttonsVisibility
- Object consistent of toolbar button names(keys) and their visibility value - true(hidden), false(shown).
Object example:
const buttonsVisibility = {
'dicom-tag-list': true,
'mpr-mist-oblique': true,
'key-object-selection': true
}
viewerCommunication.showInfoLabels(value);
Parameter:
-
value
- boolean to show or hide viewports labels.
viewerCommunication.setAdditionalInfoLabels(labels);
Parameter:
-
labels
- Object of top left or right labels and parameters to hide original dicom labels.
Object example:
const labels = {
topLeftLabels: [
{
// At which level labels are displayed. Level can be 'series' or 'study'.
// If both are provided then series will be displayed.
level: 'series',
// Series uid because it is series level.
uid: '1.2.840.113619.2.55.3.4271045733.996.1449464144.601',
labels: ['series', 'label'],
hideDicomLabels: false
}
],
topRightLabels: [
{
level: 'study',
// Study uid because it is study level.
uid: '1.2.840.113619.2.55.3.4271045733.996.1449464144.601',
labels: ['patient', 'right'],
hideDicomLabels: false
}
]
}
viewerCommunication.setCustomStudyLabel(studyUid, label);
Parameters:
-
studyUid
- Study UID for which the label should be applied to. -
label
- String to show in study header.
viewerCommunication.setCustomTags(tags);
Parameter:
-
tags
- Array of objects of tags to add to study and series. Each object has level, uid and tags.
Object example:
const tags = [
{
// At which level labels are displayed. Level can be 'series' or 'study'.
level: 'study',
// Study uid because it is study level.
uid: '1.2.840.113619.2.55.3.4271045733.996.1449464144.595',
// Tags to add to study. Each tag has text and color properties
tags: [{text: 'Leg', color: '#f6ff00'}, {text: 'Right knee', color: '#0d00ff'}, {text: 'Leg', color: '#d000ff'}]
},
{
level: 'series',
// Series uid because it is series level.
uid: '1.2.840.113619.2.55.3.4271045733.996.1449464144.598',
tags: [{text: 'Abdomen', color: '#40f616'}, {text: 'Right knee', color: '#0d00ff'}]
}
]
viewerCommunication.generateInstanceMpr(containerId);
Parameter:
-
containerId
- viewport container id. If no container id is provided then active container is used.
viewerCommunication.changeViewportOrientation(containerId, orientation);
Parameters:
-
containerId
- viewport container id. If no container id is provided then active container is used. -
orientation
- orientations:CORONAL
,AXIAL
,SAGITTAL
.
viewerCommunication.createNewMeasurement(containerId, measurementData);
Parameters:
-
containerId
- Viewport container id in which measurement will be created. -
measurementData
- Object with measurement data which will be created in viewport.
Measurement data object example:
const measurementData = {
id: 'closed-polygon-id-1',
type: 'closed-polygon',
containerId: 'viewport-container-1-1',
studyUid: 'study-uid-1',
seriesUid: 'series-uid-1',
instanceUid: 'instance-uid-1',
colors: {
regularColor: '#FFA500',
activeColor: '#33CCFF',
markedColor: '#009BFF',
activeLabelColor: '#FFF'
},
data: {
points: [
[80, 113, 42],
[221, 1, 42],
[335, 132, 42],
[178, 224, 42],
[80, 113, 42]
],
disabled: false
}
};
viewerCommunication.deleteMeasurementById(measurementId);
Parameter:
-
measurementId
- Measurement id that has to be deleted.
viewerCommunication.updateMeasurement(containerId, measurementData);
Parameters:
-
containerId
- Viewport container id in which measurement will be created. -
measurementData
- Object with measurement data to use updating existing measurement.
viewerCommunication.selectMeasurementToEdit(containerId, measurementId, opts);
Parameters:
-
containerId
- Viewport container id in which measurement should be edited. -
measurementId
- An ID of measurement to be selected. -
opts
- Additional parameters depending on type of measurement being selected.
Opts data object example for myocardium-roi-annotation
:
const opts = {
toolId: 'repulsor',
hoveredRegionIndex: 1
};
Parameter toolId
can be one of three possible values: repulsor
, draw-region
, fill-brush
.
Parameter hoveredRegionIndex
indicates which region from myocardium ROI is intended to be edited with repulsor. Parameter is ignored if other tools are activated.
viewerCommunication.changeMeasurementDisplayById(containerId, measurementId, opts);
Allows to alter the way how myocardium ROI is displayed (changing display properties for other measurement types is not supported). Parameters:
-
containerId
- Viewport container id in which measurement is visible. -
measurementId
- An ID of measurement to be updated. -
opts
- Additional parameters depending on type of measurement being updated.
Opts data object example for myocardium-roi-annotation
:
const opts = {
show: false,
sendToFront: false
};
Parameter show
is of boolean type. If true - respective myocardium ROI should be made visible.
If false - it should be hidden.
Parameter sendToFront
is optional. If provided and its value is true, then respective myocardium ROI should be brought to top in Z-order.
viewerCommunication.initiateCreateMeasurement(containerId, measurementType);
Parameters:
-
containerId
- Viewport container id in which measurement will be created. -
measurementType
- Identifies the type of measurement to initiate via this method. Currently is limited tomyocardium-roi-annotation
type only.
viewerCommunication.getListOfAvailableHpForStudy();
viewerCommunication.applyHangingProtocol(groupId, categoryId);
Parameters:
-
groupId
- HP group id. -
categoryId
- HP category id from selected group.
viewerCommunication.applyPreviousHangingProtocolCategory();
viewerCommunication.applyNextHangingProtocolCategory();
viewerCommunication.applyNextHangingProtocolCP();
const callback = (annotations) => console.log(annotations);
viewerCommunication.subscribeCommunicationServiceReadyEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeCommunicationServiceReadyEvent();
const callback = (studies) => console.log(studies);
viewerCommunication.subscribeGetOpenedStudiesEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeGetOpenedStudiesEvent();
const callback = (viewportData) => console.log(viewportData);
viewerCommunication.subscribeGetViewportDataEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeGetViewportDataEvent();
const callback = (viewportsInformation) => console.log(viewportsInformation);
viewerCommunication.subscribeGetViewportsInformationEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeGetViewportsInformationEvent();
const callback = (viewportsInformation) => console.log(viewportsInformation);
viewerCommunication.subscribeGetInstanceMetadataEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeGetInstanceMetadataEvent();
const callback = (snapshot) => console.log(snapshot);
viewerCommunication.subscribeGetSnapshotEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered with generated snapshot information.
viewerCommunication.unsubscribeGetSnapshotEvent();
const callback = (study) => console.log(study);
viewerCommunication.subscribeStudyLoadedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeStudyLoadedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeAnnotationsSaveStartedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeAnnotationsSaveStartedEvent();
const callback = (annotations) => console.log(annotations);
viewerCommunication.subscribeAnnotationsSavedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeAnnotationsSavedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeStructureSetEditedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeStructureSetEditedEvent();
const callback = (viewportsInformation) => console.log(viewportsInformation);
viewerCommunication.subscribeInstanceChangedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeInstanceChangedEvent();
const callback = (activeContainerInformation) => console.log(activeContainerInformation);
viewerCommunication.subscribeActiveContainerChangedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeActiveContainerChangedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeMeasurementCreatedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeMeasurementCreatedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeMeasurementUpdatedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeMeasurementUpdatedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeMeasurementDeletedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeMeasurementDeletedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeVirtualSeriesCreatedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeVirtualSeriesCreatedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeMeasurementMarkedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeMeasurementMarkedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeMeasurementUnmarkedEvent(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeMeasurementUnmarkedEvent();
const callback = (data) => console.log(data);
viewerCommunication.subscribeGetListOfAvailableHpForStudy(callback);
Parameter:
-
callback
- Callback function which is called when event is triggered.
viewerCommunication.unsubscribeGetListOfAvailableHpForStudy();
To ensure correct measurement recreation from data, all our measurement related functions and events work or provide 3D coordinates in patient coordinate system. If you need to convert received 3D coordinate to instance 2D coordinate, you can use following function:
function get2DImagePositionFrom3D (position3d) {
const imagePosition = this.getImagePosition();
const imageOrientation = this.getImageOrientation();
const pixelSpacing = this.getPixelSpacing();
const x = ((position3d[0] - imagePosition[0]) * imageOrientation[0] + (position3d[1] - imagePosition[1]) * imageOrientation[1]
+ (position3d[2] - imagePosition[2]) * imageOrientation[2]) / pixelSpacing.x;
const y = ((position3d[0] - imagePosition[0]) * imageOrientation[3] + (position3d[1] - imagePosition[1]) * imageOrientation[4]
+ (position3d[2] - imagePosition[2]) * imageOrientation[5]) / pixelSpacing.y;
return {
x: x + 0.5,
y: y + 0.5
};
}
If you need to convert 2D coordinate back to 3D coordinate, then you can use this function:
function get3DImagePositionFrom2D (position2d) {
const offsetPosition = {
x: position2d.x - 0.5,
y: position2d.y - 0.5
};
const imagePosition = this.getImagePosition();
const imageOrientation = this.getImageOrientation();
const pixelSpacing = this.getPixelSpacing();
const x = imagePosition[0] + imageOrientation[0] * offsetPosition.x * pixelSpacing.x
+ imageOrientation[3] * offsetPosition.y * pixelSpacing.y;
const y = imagePosition[1] + imageOrientation[1] * offsetPosition.x * pixelSpacing.x
+ imageOrientation[4] * offsetPosition.y * pixelSpacing.y;
const z = imagePosition[2] + imageOrientation[2] * offsetPosition.x * pixelSpacing.x
+ imageOrientation[5] * offsetPosition.y * pixelSpacing.y;
return [x, y, z];
}
const callback = ({status, details}) => console.log(status, details);
viewerCommunication.subscribeCreateVirtualSeriesCompletedEvent(callback);
viewerCommunication.createVirtualSeries(operationArgs);
The function requests creating virtual series from provided arguments. Parameters:
-
operationArgs
- Arguments to pass over to virtual series builder.
operationArgs data object example:
const operationArgs = {
studyUid: '1.3.12.2.1107__STORAGE_ID1',
fromSeries: [
'1.3.12.2.1107__5064.0.0.0__STORAGE_ID1',
'1.3.12.2.1107__5064.0.0.1__STORAGE_ID1'
],
postActions: {
openIn: 'viewport-container-1-1-1-2'
}
};
Parameter studyUid
is an UID of the study, where new virtual series have to be added.
Parameter fromSeries
is an array of strings. Each string represents an UID of a series from target study.
Parameter postActions
is optional. If provided, it is a JSON structure with a field, named openIn
. The field is a container ID,
where newly created series should be opened up right after creating the series. If parameter is not provided, created series will not be
opened up in any viewport.
The callback will receive an object with two fields:
-
status
. This is a string, identifying whether an operation to create virtual series succeeded or failed. There are two possible values here: 'success' or 'error'. -
details
. In case the operation has failed, it contains a string, describing a reason of failure. In case an operation was successfull, a JSON object will be returned, containing two fields: -
studyUid
(the UID of the study, where new series have been added) -
seriesUid
(the UID of new series)
Usage:
- Register subscribeCreateVirtualSeriesCompletedEvent callback function.
- Call createVirtualSeries function to request creating new virtual series.
- Once message is processed, callback function will be triggered with result of operation.
viewerCommunication.toggleVirtualSeriesDialog(actionArgs);
Submits a request to show (or hide) a Create Virtual Series dialog. Parameters:
-
actionArgs
. An arguments to be passed over to the dialog.
actionArgs data object example:
const actionArgs = {
action: 'show',
studyUid: '1.3.12.2.1107__STORAGE_ID1',
fromSeries: [
'1.3.12.2.1107__5064.0.0.0__STORAGE_ID1',
'1.3.12.2.1107__5064.0.0.1__STORAGE_ID1'
]
};
All parameters are optional. If no parameters have been provided, the application will check if there is any open instance in active viewport,
and will open a Create Virtual Series dialog, linked to that instance and that viewport.
Parameter action
can have two values: 'show' or 'hide'. If parameter is omitted, this is treated as request to show the dialog.
Parameter studyUid
goes together with parameter fromSeries
. Either none of them is provided, or both must be present.
The studyUid
indicates the study, where new virtual series should be added. The fromSeries
indicates what series must be displayed in
Create Virtual Series dialog (and all of them will be displayed as pre-selected).
const eventName = 'image-position-changed';
const callback = (eventParams) => console.log(eventParams);
viewerCommunication.subscribeEventByName(eventName, actionArgs);
Parameter:
-
eventName
- The name of event to subscribe to. See documentation to viewports-core library,CORE_EVENTS
for a list of available events. -
callback
- Callback function which is called when event is triggered. All arguments from fired event are assembled into single array, in the order of original appearance.
const eventName = 'image-position-changed';
viewerCommunication.unsubscribeEventByName(eventName);
Parameter:
-
eventName
- The name of event to unsubscribe from.
const actionArgs = {toolId: 'measure-line'};
viewerCommunication.clickMeasurementTool(actionArgs);
Parameter:
-
actionArgs
. An object withtoolId
field, identifying the measurement tool to be activated/deactivated. Note the tools available to manipulate via this call are exactly the same as in Measurements menu (i.e., if you can't see a menu item in Measurements menu - then this user would be able to invoke respective measurement via communication API).
- Updated project license.
- Change log update.
- Updated
Measurement coordinates conversion
section functions to adjust position based on viewport half pixel offset.
- Fixed a problem with ViewerCommunication object being reinstantiated multiple times by some customers. The object should have been used as singleton, but multiple objects were created and left hanging around. A constructor of ViewerCommunication has been rewritten to destroy previously created objects.
- Added function
subscribeEventByName
to allow subscribing to any event, that is being fired viatriggerEvent
mechanism by viewports-core library. - Added function
unsubscribeEventByName
to allow unsubscribing from events, previously subscribed viasubscribeEventByName
. - Added function
clickMeasurementTool
to allow manipulating menu items from Measurements menu (simulating clicks by end user).
- Added function
getOpenedSeries
to request obtaining a list of currently opened series from all opened studies - Added functions
subscribeGetOpenedSeriesEvent
andunsubscribeGetOpenedSeriesEvent
to subscribe/unsubscribe togetOpenedSeries
request callback. - Added function
openInstanceExt
to open specified instance in specified viewport (lookup by UID instead of db UID and supports panel layout) - Added function
createVirtualSeries
to initiate an operation to create virtual series from provided parameters - Added functions
subscribeCreateVirtualSeriesCompletedEvent
andunsubscribeCreateVirtualSeriesCompletedEvent
to subscribe/unsubscribe tocreateVirtualSeries
request callback. - Added function
toggleVirtualSeriesDialog
to show/hide Create Virtual Series dialog with (optional) provided parameters.
- Added functions
subscribeMeasurementMarkedEvent
,subscribeMeasurementUnmarkedEvent
to listen on measurement mark events. - Added function
subscribeVirtualSeriesCreatedEvent
to listen when virtual series are created. - Added function
updateMeasurement
to enable update of existing measurement without destroying underlying object. - Added function
initiateCreateMeasurement
to support creating myocardium ROI and activate default editing tool. - Added function
selectMeasurementToEdit
to support either selecting closed_polygon or myocardium ROI objects for editing. - Added function
changeMeasurementDisplayById
to allow show/hide myocardium ROI or rearrange myocardium ROIs on Z-axis.
- Fixed integration example issues related to latest MedDream Viewer changes.
- Added
applyHangingProtocol
function to set hanging protocol by group and category ids.
- Fix unsubscribe get list of available HP for study event description.
- Added
getListOfAvailableHpForStudy
function to get available hanging protocol list for active study. - Added
applyPreviousHangingProtocolCategory
function to apply previous available hanging protocol category. - Added
applyNextHangingProtocolCategory
function to apply next available hanging protocol category. - Added
applyNextHangingProtocolCP
function to apply next available hanging protocol comparison study (CP).
- Updated
setCustomStudyLabel
function to set additional dicom tag labels for study or series level. - Added
dicomTagLabels
argument to array of dicom tags.
- Renamed
hideDicomLabels
argument tohideOriginalLabels
.
- Updated
measurementData
object withdisabled
parameter which allows to disable measurement from editing.
- Change log update.
- Updated
updateButtonVisibility
example to include mpr mist oblique and key objects buttons.
- Added
updateButtonVisibility
function to set which toolbar buttons are hidden.
- Added
setCustomTags
function to set custom tags with tag text and color for study or series.
- Added
setCustomStudyLabel
function to set additional custom label for study side panel by selected study uid.
- Added
subscribeMeasurementDeletedEvent
function to subscribe of measurement deleted event callback. - Added
unsubscribeMeasurementDeletedEvent
function to unsubscribe of measurement deleted event callback.
- Added
getInstanceMetadata
function to get available instance metadata. - Added
subscribeGetInstanceMetadataEvent
function to subscribe of get instance metadata event callback. - Added
unsubscribeGetInstanceMetadataEvent
function to unsubscribe of get instance metadata event callback.
- Added
subscribeAnnotationsSaveStartedEvent
function to subscribe of annotations save started event callback. - Added
unsubscribeAnnotationsSaveStartedEvent
function to unsubscribe of annotations save started event callback. - Added
subscribeStructureSetEditedEvent
function to subscribe of structure set edited event callback. - Added
unsubscribeStructureSetEditedEvent
function to unsubscribe of structure set edited event callback.
- Updated
setAdditionalInfoLabels
function to set additional info labels for study or series level.
- Added
createNewMeasurement
function to create new measurement in to viewport container. - Added
deleteMeasurementById
function to delete requested measurement by container id. - Added
subscribeInstanceChangedEvent
function to subscribe of instance changed event callback. - Added
unsubscribeInstanceChangedEvent
function to unsubscribe of instance changed event callback. - Added
subscribeActiveContainerChangedEvent
function to subscribe of active container changed event callback. - Added
unsubscribeActiveContainerChangedEvent
function to unsubscribe of active container changed event callback. - Added
subscribeMeasurementCreatedEvent
function to subscribe of measurement created event callback. - Added
unsubscribeMeasurementCreatedEvent
function to unsubscribe of measurement created event callback. - Added
subscribeMeasurementUpdatedEvent
function to subscribe of measurement updated event callback. - Added
unsubscribeMeasurementUpdatedEvent
function to unsubscribe of measurement updated event callback. - Added
getViewportsInformation
function to get available viewport's information. - Added
subscribeGetViewportsInformationEvent
function to subscribe of get viewports information event callback. - Added
unsubscribeGetViewportsInformationEvent
function to unsubscribe of get viewports information event callback. - Added new
Measurement coordinates conversion
documentation section with information about coordinates conversion.
- Added
generateInstanceMpr
function to generate instance MPR. - Added
changeViewportOrientation
function to change viewport orientation.
- Added
showInfoLabels
function to show/hide viewports info labels. - Added
setAdditionalInfoLabels
function to set additional info labels for viewports.
- Updated old
getWindowReference
function name tofindWindowReference
. - Added new
getWindowReference
function which returns last received window reference.
- Removed information about not used
freeDrawInfo
permission from example andUpdate segmentation tool permissions
documentation section.
- Added
getViewportData
function to get active viewport data. - Added
subscribeGetViewportDataEvent
function to subscribe of get viewport data event callback. - Added
unsubscribeGetViewportDataEvent
function to unsubscribe of get viewport data event callback.
- Added
subscribeStudyLoadedEvent
function to subscribe of study loaded event callback. - Added
unsubscribeStudyLoadedEvent
function to unsubscribe of study loaded event callback.
- Added
getIntegrationType
function to return current integration type. - Added
updateIntegrationType
function to update integration type. - Updated integration type dropdown in example to actually update integration type in library when new integration type is selected.
- Added
getSnapshot
function to generate viewer layout and viewports snapshot. - Added
setSnapshot
function to set previously generated snapshot back to the viewer. - Added
subscribeGetSnapshotEvent
function to subscribe of get snapshot event callback. - Added
unsubscribeGetSnapshotEvent
function to unsubscribe of get snapshot event callback.
- Updated
updateSegmentationToolPermissions
function to support new permissions:smartPaintView
,smartPaint2dEdit
,smartPaint3dEdit
,smartPaintInfo
.
- Updated segmentation permission
boundingBoxEdit
toboundingBox2dEdit
andboundingBox3dEdit
for 2d and 3d bounding box permissions control.
- Added
updateSegmentationToolPermissions
function to update segmentation tool permissions. - Added
subscribeCommunicationServiceReadyEvent
function to subscribe communication service ready event. - Added
unsubscribeCommunicationServiceReadyEvent
function to unsubscribe communication service ready event. - Added
unsubscribeGetOpenedStudiesEvent
function to unsubscribe get opened studies event. - Added
subscribeAnnotationsSavedEvent
function to subscribe annotation saved event. - Added
unsubscribeAnnotationsSavedEvent
function to unsubscribe annotation saved event.
- Renamed
onGetOpenedStudies
function tosubscribeGetOpenedStudiesEvent
.
- Added
openMedDreamToIframe
function to open studies in iframe.
- Renamed
openInMedDream
function toopenInMedDreamWindow
. - Renamed
addToMedDream
function toaddToMedDreamWindow
. - Renamed
replaceInMedDream
function toreplaceInMedDreamWindow
.