feat: Add DICOM SEG support and MPR, referenceLines and StackSync and more (#3015)
* feat: add initial sop class handler for SEG * feat: move segmentation service * update segmentation service methods * fix: viewport data structure * feat: Add initial render for the DICOM SEG for each displaySet * fix: various wrong architectural dependencies between services * feat: initial separate SEG display in each viewport * feat: refactore viewport action bar * initial work for SEG hydration * fix: various bugs regarding drag and dropping different viewports * fix: rendering issues for multiple seg displaysets * fix: bugs for thumbnail and hydration * feat: fix the initial segment color * update after rebase * feat: initial design for the segmentation group table * feat: initial new design for the segmentation panel * feat: segmentation panel * feat: make segmentation appear on all related viewports * fix: segmentation load bug based on functional groups * initial work for segmentation crosshairs * fix: various stylings and functionality * fix: various stylings for the seg panel * fix: overflow styles * feat: add more ui components * feat: added segmentation config * feat: add jump to segment * feat: add jump to segment for DICOM SEG viewport * fix: bugs after rebase * feat: jump in segmentation viewport * fix: mpr support for seg * feat: add more icons * feat: new icons * feat: add new side panel * feat: add segmentation config * feat: add loading indicator to ohif * feat: make hanging protocols follow matching rules for viewports * feat: enhance drag and drop to be hanging protocol aware * fix: mpr restore previous layout * fix: crosshairs toggle * fix: add auth headers to the dicom loader via dicomwebclient * fix: bug for crosshairs toggle in mpr * fix: seg viewport reusing old toolGroup * feat: add loading animation with lottie * fix: various bugs for Segmentation hydration in mpr * feat: change outline alpha to outline opacity * feat: loading indicator for seg viewport * fix: various segmentation group styles * fix: local mode for seg * feat: add animation for the highlight * fix: loading indicatro to show segment indices * feat: enhance modality drop down ui * fix: panels * fix: download form * fix: layout shift in loading indicator * fix: loading indicator to have correct values * fix: update software number * fix: image jump between MPR and default * fix: segmentation cleanup and cine service cleanup * fix: segmentation toolgroup clena up * fix: highlight interval should not trigger again * fix: issue with multiframe sorting * rename: change onSeriesChange to onArrowsClick * fix: buttons for tmtv and layout shift * fix: various bugs wrt crosshairs * fix: crosshairs re init on reset camera * fix: middle slice calculation different from cs middle reset camera * fix: reset camera should reset viewport camera * fix: loading segments in MPR mode * fix: tmtv hp back to before * fix: layout shift * feat: orientation markers for volume viewport * fix: capture for volume viewports * fix: memory leak for back to worklist * fix: loading bar bg color * fix: side panel for only one panel * fix: react select style in production * fix: various styling for segmentation groups * fix: various ui styles * feat: add new segmentation config styles * fix: hover state for segmentation item * fix: side panel layout shift * temp add panels * try to fix scrollbar for thimbnail * fix: scroll not appearing for side panels * feat: changed styles for scrollbar * feat: add cpu fallback warning * fix: webworker destroy * fix: select styles * fix: orientation marker color and position * fix: capture screenshot for volume viewports * fix: hide segment visibility on mpr * fix: reloading an already loaded seg displayset * feat: add is equal * fix: mpr jump to measurements * apply review comments * fix: optimization for the segmentation load * fix: remove unnecessary context menu and hp service reset * fix: segmentation service wrt brush settings * feat: initial work for the stack synchronization * fix: add validateDisplaySetSelectorsForNewDisplaySets to make sure drag and drop can follow requirements * fix: various react proptypes * fix: thumbnails for the tmtv and change default props to default params * feat: make showing loading indicator configurable and add docs * bump versions and add more docs * fix demo * update cornerstone versions * apply review comments * feat: add reference lines * fix build * fix unit tests * add reference lines icon * fix: e2e tests * fix static wado config * docs: add segmentation service docs * fix: docker build * fix: keep camera and bump versions * Try re-enabling minification to fix deploy previews Co-authored-by: Erik Ziegler <erik.sweed@gmail.com>
This commit is contained in:
1 parent
08c58b0634
commit
83ea228d86
254 files changed
+12856
-3141
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 496 KiB |
+17
-2
@@ -1,9 +1,9 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
sidebar_label: Overview
|
||||
sidebar_label: Configuration Files
|
||||
---
|
||||
|
||||
# Overview
|
||||
# Config files
|
||||
|
||||
After following the steps outlined in
|
||||
[Getting Started](./../development/getting-started.md), you'll notice that the
|
||||
@@ -105,6 +105,21 @@ window.config = ({ servicesManager } = {}) => {
|
||||
};
|
||||
```
|
||||
|
||||
## Configuration Options
|
||||
|
||||
Here are a list of some options available:
|
||||
|
||||
- `maxNumberOfWebWorkers`: The maximum number of web workers to use for
|
||||
decoding. Defaults to minimum of `navigator.hardwareConcurrency` and
|
||||
what is specified by `maxNumberOfWebWorkers`. Some windows machines require smaller values.
|
||||
- `omitQuotationForMultipartRequest`: Some servers (e.g., .NET) require the `multipart/related` request to be sent without quotation marks. Defaults to `false`. If your server doesn't require this, then setting this flag to `true` might improve performance (by removing the need for preflight requests). Also note that
|
||||
if auth headers are used, a preflight request is required.
|
||||
- `maxNumRequests`: The maximum number of requests to allow in parallel. It is an object with keys of `interaction`, `thumbnail`, and `prefetch`. You can specify a specific number for each type.
|
||||
- `showLoadingIndicator`: (default to true), if set to false, the loading indicator will not be shown when navigating between studies.
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- **Embedded Use Note:**
|
||||
|
||||
Alternatively, when using the `umd` bundle for embedded use cases, these same
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
sidebar_position: 2
|
||||
sidebar_label: DICOMweb
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
sidebar_label: Introduction
|
||||
---
|
||||
|
||||
# Data Source
|
||||
|
||||
The internal data structure of OHIF’s metadata follows naturalized DICOM JSON, A
|
||||
format pioneered by `dcmjs`. In short DICOM metadata headers with DICOM Keywords
|
||||
instead of tags and sequences as arrays, for easy development and clear code.
|
||||
|
||||
Here in this section we will discuss couple of data sources that are commonly used
|
||||
and OHIF has provided the implementation for them.
|
||||
|
||||
## Custom Data Source
|
||||
Do you have a custom data source? or a custom data that you want to use in OHIF?
|
||||
You can easily write a data source to map your data to OHIF’s native format.
|
||||
|
||||
You can read more in the [Data Source Module](../../platform/extensions/modules/data-source.md)
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
sidebar_position: 4
|
||||
sidebar_label: Static Files
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
sidebar_label: URL
|
||||
---
|
||||
|
||||
# URL
|
||||
|
||||
|
||||
URL
|
||||
@@ -7,11 +7,7 @@ sidebar_label: Data Source
|
||||
|
||||
## Overview
|
||||
|
||||
The internal data structure of OHIF’s metadata follows naturalized DICOM JSON, A
|
||||
format pioneered by `dcmjs`. In short DICOM metadata headers with DICOM Keywords
|
||||
instead of tags and sequences as arrays, for easy development and clear code.
|
||||
|
||||
We have built a standard for fetching and mapping data into OHIF’s native
|
||||
We have built couple of methods for fetching and mapping data into OHIF’s native
|
||||
format, which we call DataSources, and have provided one implementation of this
|
||||
standard.
|
||||
|
||||
|
||||
@@ -5,24 +5,105 @@ sidebar_label: Hanging Protocol
|
||||
# Module: Hanging Protocol
|
||||
|
||||
## Overview
|
||||
`hangingProtocolModule` provides the protocols for hanging the displaySets in the viewer.
|
||||
This module can be as simple as loading a list of pre-defined protocols, or it can be more complex
|
||||
and `fetch` the protocols from a server.
|
||||
|
||||
You can read more about hanging protocols in HangingProtocolService.
|
||||
[Hanging protocols](http://dicom.nema.org/dicom/Conf-2005/Day-2_Selected_Papers/B305_Morgan_HangProto_v1.pdf) are an essential part of any radiology viewer.
|
||||
OHIF uses Hanging Protocols to handle the arrangement of the images in the viewport. In
|
||||
short, the registered protocols will get matched with the DisplaySets that are
|
||||
available. Each protocol gets a score, and they are ranked. The
|
||||
winning protocol (highest score) gets applied and its settings run for the viewports
|
||||
to be arranged.
|
||||
|
||||
|
||||
In `OHIF-v3` hanging protocols you can:
|
||||
|
||||
- Define what layout the viewport should starts with (e.g., 2x2 layout)
|
||||
- Specify the type of the viewport and its orientation (e.g., stack, volume with Sagittal view)
|
||||
- Define which displaySets gets displayed in which viewport of the layout (e.g,. displaySet that has modality of 'CT' and 'SeriesDescription' of 'Coronary Arteries' gets displayed in the first viewport of the layout)
|
||||
- Apply certain initial viewport settings (e.g., inverting the contrast, jumping to a specific slice, etc.)
|
||||
- Add specific synchronization rules for the viewports (e.g., synchronize the zoom of the viewports of the index 1, 2 OR synchronize the VOI of the viewports of the index 2, 3)
|
||||
|
||||
|
||||
Using `hangingProtocolModule` you can provide/register the protocols for OHIF to
|
||||
utilize.
|
||||
|
||||
Here is an example protocol which if used will hang a 1x3 layout with the first viewport showing a CT image, the second viewport showing a PT image and the third viewport showing their fusion, all in Sagittal orientations to achieve a view of
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
```js
|
||||
const deafultProtocol = {
|
||||
id: 'defaultProtocol',
|
||||
const oneByThreeProtocol = {
|
||||
id: 'oneByThreeProtocol',
|
||||
locked: true,
|
||||
hasUpdatedPriorsInformation: false,
|
||||
name: 'Default',
|
||||
createdDate: '2021-02-23T19:22:08.894Z',
|
||||
modifiedDate: '2021-02-23T19:22:08.894Z',
|
||||
modifiedDate: '2022-10-04T19:22:08.894Z',
|
||||
availableTo: {},
|
||||
editableBy: {},
|
||||
protocolMatchingRules: [],
|
||||
toolGroupIds: ['default'],
|
||||
imageLoadStrategy: 'interleaveTopToBottom',
|
||||
protocolMatchingRules: [
|
||||
{
|
||||
attribute: 'ModalitiesInStudy',
|
||||
constraint: {
|
||||
contains: ['CT', 'PT'],
|
||||
},
|
||||
},
|
||||
],
|
||||
displaySetSelectors: {
|
||||
ctDisplaySet: {
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'CT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'isReconstructable',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
ptDisplaySet: {
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: 'PT',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'isReconstructable',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
attribute: 'SeriesDescription',
|
||||
constraint: {
|
||||
contains: 'Corrected',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
stages: [
|
||||
{
|
||||
id: 'hYbmMy3b7pz7GLiaT',
|
||||
@@ -31,164 +112,26 @@ const deafultProtocol = {
|
||||
layoutType: 'grid',
|
||||
properties: {
|
||||
rows: 1,
|
||||
columns: 2,
|
||||
columns: 3,
|
||||
},
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'displaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
],
|
||||
viewports: [
|
||||
{
|
||||
viewportOptions: {
|
||||
toolGroupId: 'default',
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
options: [],
|
||||
id: 'displaySet',
|
||||
viewportId: 'ctAXIAL',
|
||||
viewportType: 'volume',
|
||||
orientation: 'sagittal',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
createdDate: '2021-02-23T18:32:42.850Z',
|
||||
},
|
||||
],
|
||||
numberOfPriorsReferenced: -1,
|
||||
};
|
||||
|
||||
function getHangingProtocolModule() {
|
||||
return [
|
||||
{
|
||||
id: 'default',
|
||||
protocol: deafultProtocol,
|
||||
},
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Skeleton of A Hanging Protocol
|
||||
|
||||
The skeleton of a hanging protocol is as follows:
|
||||
|
||||
|
||||
```js
|
||||
const testProtocol = {
|
||||
id: 'test',
|
||||
locked: true,
|
||||
hasUpdatedPriorsInformation: false,
|
||||
name: 'Default',
|
||||
createdDate: '2021-02-23T19:22:08.894Z',
|
||||
modifiedDate: '2021-02-23T19:22:08.894Z',
|
||||
availableTo: {},
|
||||
editableBy: {},
|
||||
toolGroupIds: ['default'],
|
||||
protocolMatchingRules: [
|
||||
{
|
||||
id: 'wauZK2QNEfDPwcAQo',
|
||||
weight: 1,
|
||||
attribute: 'StudyDescription',
|
||||
constraint: {
|
||||
contains: {
|
||||
value: 'PETCT',
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: 'wauZK2QNEfDPwcAQo',
|
||||
weight: 1,
|
||||
attribute: 'StudyDescription',
|
||||
constraint: {
|
||||
contains: {
|
||||
value: 'PET/CT',
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
stages: [
|
||||
{
|
||||
id: 'hYbmMy3b7pz7GLiaT',
|
||||
name: 'default',
|
||||
viewportStructure: {
|
||||
type: 'grid',
|
||||
properties: {
|
||||
rows: 1,
|
||||
columns: 1,
|
||||
viewportOptions: [],
|
||||
},
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'ctDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'CT',
|
||||
},
|
||||
syncGroups: [
|
||||
{
|
||||
type: 'voi',
|
||||
id: 'ctWLSync',
|
||||
source: true,
|
||||
target: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
{
|
||||
id: 'ptACDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'PT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
{
|
||||
id: 'ptNACDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'SeriesDescription',
|
||||
constraint: {
|
||||
contains: {
|
||||
value: 'Uncorrected',
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
],
|
||||
viewports: [
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'ctAxial',
|
||||
viewportType: 'stack',
|
||||
background: [0, 0, 0],
|
||||
orientation: 'AXIAL',
|
||||
toolGroupId: 'default',
|
||||
],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
@@ -198,22 +141,49 @@ const testProtocol = {
|
||||
},
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'ptAxial',
|
||||
viewportType: 'stack',
|
||||
background: [1, 1, 1],
|
||||
orientation: 'AXIAL',
|
||||
toolGroupId: 'default',
|
||||
viewportId: 'ptAXIAL',
|
||||
viewportType: 'volume',
|
||||
orientation: 'sagittal',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'ptDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'fusionSAGITTAL',
|
||||
viewportType: 'volume',
|
||||
orientation: 'sagittal',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
syncGroups: [
|
||||
{
|
||||
type: 'voi',
|
||||
id: 'ctWLSync',
|
||||
source: false,
|
||||
target: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'ctDisplaySet',
|
||||
},
|
||||
{
|
||||
options: {
|
||||
colormap: 'hsv',
|
||||
voi: {
|
||||
windowWidth: 5,
|
||||
windowCenter: 2.5,
|
||||
},
|
||||
voiInverted: true,
|
||||
},
|
||||
id: 'ptACDisplaySet',
|
||||
id: 'ptDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -223,12 +193,31 @@ const testProtocol = {
|
||||
],
|
||||
numberOfPriorsReferenced: -1,
|
||||
};
|
||||
|
||||
|
||||
function getHangingProtocolModule() {
|
||||
return [
|
||||
{
|
||||
id: 'oneByThreeProtocol',
|
||||
protocol: oneByThreeProtocol,
|
||||
},
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Let's discuss each property in depth.
|
||||
|
||||
## Skeleton of a Protocol
|
||||
|
||||
The skeleton of a hanging protocol is as follows:
|
||||
|
||||
|
||||
### Id
|
||||
unique identifier for the protocol
|
||||
unique identifier for the protocol, this id can be used inside mode configuration
|
||||
to specify which protocol should be used for a specific mode. A mode can
|
||||
request a protocol by its id (which makes OHIF to apply the protocol without
|
||||
matching), or provides and array of ids which will
|
||||
make the ProtocolEngine to choose the best matching protocol (based on
|
||||
protocolMatching rules, which is next section).
|
||||
|
||||
### protocolMatchingRules
|
||||
A list of criteria for the protocol along with the provided points for ranking.
|
||||
@@ -237,8 +226,12 @@ A list of criteria for the protocol along with the provided points for ranking.
|
||||
protocols get sorted based on the weights, and the winning protocol gets
|
||||
applied to the viewer.
|
||||
- `attribute`: tag that needs to be matched against. This can be either
|
||||
Study-level metadata or a custom attribute.
|
||||
[Learn more about custom attribute matching](#custom-attribute)
|
||||
Study-level metadata or a custom attribute such as "StudyInstanceUID",
|
||||
"StudyDescription", "ModalitiesInStudy", "NumberOfStudyRelatedSeries", "NumberOfSeriesRelatedInstances"
|
||||
In addition to these tags, you can also use a custom attribute that you have registered before.
|
||||
We will learn more about this later.
|
||||
|
||||
|
||||
|
||||
- `constraint`: the constraint that needs to be satisfied for the attribute. It accepts a `validator` which can be
|
||||
[`equals`, `doesNotEqual`, `contains`, `doesNotContain`, `startsWith`, `endsWidth`]
|
||||
@@ -259,9 +252,74 @@ A list of criteria for the protocol along with the provided points for ranking.
|
||||
},
|
||||
```
|
||||
|
||||
### displaySetSelectors
|
||||
Defines the display sets that the protocol will use for arrangement.
|
||||
|
||||
```js
|
||||
displaySetSelectors: {
|
||||
ctDisplaySet: {
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'CT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'isReconstructable',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
ptDisplaySet: {
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: 'PT',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
weight: 1,
|
||||
attribute: 'isReconstructable',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
attribute: 'SeriesDescription',
|
||||
constraint: {
|
||||
contains: 'Corrected',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
As you see above we have specified two displaysets: 1) ctDisplaySet , 2) ptDisplaySet
|
||||
The ctDisplaySet will match against all the series that are CT and reconstructable
|
||||
The ptDisplaySet will match against all the series that are PT and reconstructable.
|
||||
|
||||
As you see each selector is composed of an `id` as the key and a set of `seriesMatchingRules` (displaySetMatchingRules) which gives score to the displaySet
|
||||
based on the matching rules. The displaySet with the highest score will be used for the `id`.
|
||||
|
||||
### stages
|
||||
Each protocol can define one or more stages. Each stage defines a certain layout and viewport rules.
|
||||
Therefore, the `stages` property is array of objects, each object being one stage.
|
||||
Each protocol can define one or more stages. Each stage defines a certain layout and viewport rules. Therefore, the `stages` property is array of objects, each object being one stage.
|
||||
|
||||
### viewportStructure
|
||||
Defines the layout of the viewer. You can define the number of `rows` and `columns`. There should be `rows * columns` number of
|
||||
@@ -304,88 +362,6 @@ viewportStructure: {
|
||||
},
|
||||
```
|
||||
|
||||
### displaySets
|
||||
Defines the display sets that are available for the stage. Each
|
||||
include an `id` and some `seriesMatchingRules`
|
||||
|
||||
```js
|
||||
displaySets: [
|
||||
{
|
||||
id: 'ctDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'CT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
{
|
||||
id: 'ptACDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'PT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
{
|
||||
id: 'ptNACDisplaySet',
|
||||
imageMatchingRules: [],
|
||||
seriesMatchingRules: [
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'Modality',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'PT',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
id: 'GPEYqFLv2dwzCM322',
|
||||
weight: 1,
|
||||
attribute: 'SeriesDescription',
|
||||
constraint: {
|
||||
contains: {
|
||||
value: 'Uncorrected',
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
studyMatchingRules: [],
|
||||
},
|
||||
],
|
||||
```
|
||||
|
||||
As you see in the above `displaySets` entry in the example above, there are
|
||||
three defined displaySets that __will__ become available later on in the `viewports`
|
||||
section of the protocol.
|
||||
|
||||
|
||||
1. `ctDisplaySet` which is matched against the CT modality
|
||||
2. `ptACDisplaySet` which is matched against the PT modality
|
||||
3. `ptNACDisplaySet` which is matched against the PT modality and also contains the `Uncorrected` series description
|
||||
|
||||
### viewports
|
||||
This field includes the viewports that will get hung on the viewer.
|
||||
@@ -394,11 +370,20 @@ This field includes the viewports that will get hung on the viewer.
|
||||
viewports: [
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'ctAxial',
|
||||
viewportType: 'stack',
|
||||
background: [0, 0, 0],
|
||||
orientation: 'AXIAL',
|
||||
toolGroupId: 'default',
|
||||
viewportId: 'ctAXIAL',
|
||||
viewportType: 'volume',
|
||||
orientation: 'sagittal',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
syncGroups: [
|
||||
{
|
||||
type: 'voi',
|
||||
id: 'ctWLSync',
|
||||
source: true,
|
||||
target: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
@@ -406,44 +391,78 @@ viewports: [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'ptAxial',
|
||||
viewportType: 'stack',
|
||||
background: [1, 1, 1],
|
||||
orientation: 'AXIAL',
|
||||
toolGroupId: 'default',
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
options: {
|
||||
voi: {
|
||||
windowWidth: 5,
|
||||
windowCenter: 2.5,
|
||||
},
|
||||
voiInverted: true,
|
||||
},
|
||||
id: 'ptACDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
// the rest
|
||||
],
|
||||
```
|
||||
|
||||
As you can see there are two viewports defined. The first one is a CT viewport and the second one is a PT viewport.
|
||||
|
||||
Each viewport has two properties:
|
||||
As you can see in the hanging protocol we defined three viewports (but only showing one of them right above). Each viewport has two properties:
|
||||
|
||||
1. `viewportOptions`: defines the viewport properties such as
|
||||
- `viewportId`: unique identifier for the viewport (optional)
|
||||
- `viewportType`: type of the viewport (required - currently only stack)
|
||||
- `viewportType`: type of the viewport (optional - options: stack, volume - default is stack
|
||||
- `background`: background color of the viewport (optional)
|
||||
- `orientation`: orientation of the viewport (optional)
|
||||
- `orientation`: orientation of the viewport (optional - if not defined for volume -> acquisition axis)
|
||||
- `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)
|
||||
|
||||
|
||||
2. `displaySets`: defines the display sets that are available for the viewport. It is an array of objects, each object being one display set.
|
||||
2. `displaySets`: defines the display sets that are displayed on a viewport. It is an array of objects, each object being one display set.
|
||||
- `id`: id of the display set (required)
|
||||
- `options` (optional): options for the display set
|
||||
- voi: windowing options for the display set
|
||||
- voi: windowing options for the display set (optional: windowWidth, windowCenter)
|
||||
- voiInverted: whether the VOI is inverted or not (optional)
|
||||
- colormap: colormap for the display set (optional: 'hsv' etc.)
|
||||
|
||||
|
||||
### Custom attribute
|
||||
For any matching rules you can specify a custom attribute too. For instance,
|
||||
if you have a timepoint attribute in for each of your studies, you can use that in the matching rules.
|
||||
|
||||
```js
|
||||
{
|
||||
id: 'wauZK2QNEfDPwcAQo',
|
||||
weight: 1,
|
||||
attribute: 'timepoint',
|
||||
constraint: {
|
||||
equals: {
|
||||
value: 'baseline',
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
```
|
||||
|
||||
and then you need to register a callback in the HangingProtocolService to get the value for the attribute.
|
||||
|
||||
```js
|
||||
HangingProtocolService.addCustomAttribute(
|
||||
'timepoint', // attributeId
|
||||
'addCustomAttribute', // attributeName
|
||||
study => { // callback that returns the value for the attribute
|
||||
const timePoint = fetchFromMyCustomBackend(study.studyInstanceUid);
|
||||
return timePoint;
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Matching on Prior Study with UID
|
||||
|
||||
Often it is desired to match a new study to a prior study (e.g., follow up on
|
||||
a surgery). Since the hanging protocols run on displaySets we need to have a
|
||||
way to let OHIF knows that it needs to load the prior study as well. This can
|
||||
be done by specifying both StudyInstanceUIDs in the URL. Below we are
|
||||
running OHIF with two studies
|
||||
|
||||
```bash
|
||||
http://localhost:3000/viewer?StudyInstanceUIDs=1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5&StudyInstanceUIDs=1.3.6.1.4.1.25403.345050719074.3824.20170125095722.1
|
||||
```
|
||||
|
||||
Now you have access to both studies and you can use matchingRules to match
|
||||
displaySets.
|
||||
|
||||
|
||||
|
||||
Our roadmap includes enabling matching on prior studies without the UID (e.g., baseline, most recent and index).
|
||||
@@ -298,8 +298,12 @@ properties inside the [route documentation](./routes.md)
|
||||
### HangingProtocols
|
||||
|
||||
Currently, you can pass your defined hanging protocols inside the
|
||||
`hangingProtocols` property of the mode's config. This will get registered
|
||||
inside `HangingProtocolService`.
|
||||
`hangingProtocols` property of the mode's config. If you specify the hanging protocol
|
||||
explicitly by its name (only string and not array), it will be THE hanging protocol
|
||||
that the mode runs with. However, if you specify an array of hanging protocols,
|
||||
they will get ranked based on the displaySetSelector requirements and the winner
|
||||
will be the hanging protocol that the mode runs with.
|
||||
|
||||
|
||||
### SopClassHandlers
|
||||
|
||||
|
||||
@@ -7,33 +7,25 @@ sidebar_label: Hanging Protocol Service
|
||||
|
||||
## Overview
|
||||
|
||||
`HangingProtocolService` is a migration of the `OHIF-v1` hanging protocol
|
||||
engine along with various improvements and fixes.
|
||||
|
||||
This service handles the arrangement of the images in the viewport. In
|
||||
short, the registered protocols will get matched with the DisplaySets that are
|
||||
available. Each protocol gets a score, and they are ranked. The
|
||||
winning protocol gets applied and its settings run for the viewports.
|
||||
winning protocol (highest score) gets applied and its settings run for the viewports
|
||||
to be arranged.
|
||||
|
||||
You can read more about hanging protocols
|
||||
[here](http://dicom.nema.org/dicom/Conf-2005/Day-2_Selected_Papers/B305_Morgan_HangProto_v1.pdf).
|
||||
In `OHIF-v3` hanging protocols you can:
|
||||
You can read more about a HangingProtocol Structure and its properties in the
|
||||
[HangingProtocol Module](../../extensions/modules/hpModule.md).
|
||||
|
||||
- Define what layout of the viewport should the viewer starts with (2x2 layout)
|
||||
- Specify the type of the viewport and its orientation
|
||||
- Define which displaySets gets displayed in which viewport of the layout
|
||||
- Apply certain initial viewport settings; e.g., inverting the contrast, jumping to a specific slice, etc.
|
||||
- Add specific synchronization rules for the viewports
|
||||
The rest of this page is dedicated on how the Hanging Protocol Service works and
|
||||
what you can do with it.
|
||||
|
||||
## Protocols
|
||||
|
||||
A protocol can be an object or a function that returns an object (protocol generator).
|
||||
Each protocol can get added to the `HangingProtocolService` by using the `addProtocol` method given
|
||||
an `id` and the protocol itself. As an example, the `default` protocol is an object, while
|
||||
the 'mpr' protocol is a function that returns the protocol (the reason for this is that the
|
||||
`mpr` protocol needs to be generated based on the active viewport).
|
||||
Protocols are provided by each extension's HangingProtocolModule and are
|
||||
registered automatically to the HangingProtocolService.
|
||||
|
||||
All protocols are stored in the `HangingProtocolService` using their `id` as the key, and
|
||||
the protocol itself as the value.
|
||||
All protocols are stored in the `HangingProtocolService` using their `id` as the key, and the protocol itself as the value.
|
||||
|
||||
## Events
|
||||
|
||||
@@ -44,14 +36,15 @@ There are two events that get publish in `HangingProtocolService`:
|
||||
| NEW_LAYOUT | Fires when a new layout is requested by the `HangingProtocolService` |
|
||||
| STAGE_CHANGE | Fires when the the stage is changed in the hanging protocols |
|
||||
| PROTOCOL_CHANGED | Fires when the the protocol is changed in the hanging protocols |
|
||||
| HANGING_PROTOCOL_APPLIED_FOR_VIEWPORT | Fires when the hanging protocol applies for a viewport (sets its displaySets) |
|
||||
|
||||
|
||||
|
||||
## API
|
||||
|
||||
- `getMatchDetails`: returns an object which contains the details of the
|
||||
matching for the viewports, displaysets and whether the protocol is
|
||||
applied to the viewport or not
|
||||
matching for the viewports, displaySets and whether the protocol is
|
||||
applied to the viewport or not yet.
|
||||
|
||||
- `addProtocol`: adds provided protocol to the list of registered protocols
|
||||
for matching
|
||||
@@ -68,6 +61,14 @@ init.
|
||||
|
||||
- `addCustomAttribute`: adding a custom attribute for matching. (see below)
|
||||
|
||||
- `setProtocol`: applies a protocol to the current studies, it can be used for instance to apply a
|
||||
hanging protocol when pressing a button in the toolbar. We use this for applying 'mpr'
|
||||
hanging protocol when pressing the MPR button in the toolbar. `setProtocol` will
|
||||
accept a set of options that can be used to define the displaySets that will be
|
||||
used for the protocol. If no options are provided, all displaySets will
|
||||
be used to match the protocol.
|
||||
|
||||
|
||||
Default initialization of the modes handles running the `HangingProtocolService`
|
||||
|
||||
## Hanging Protocol Instance Definition
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
sidebar_label: Segmentation Service
|
||||
---
|
||||
|
||||
# Segmentation Service
|
||||
|
||||
## Overview
|
||||
|
||||
Using Segmentation Service you can create, edit and delete segmentation data, and
|
||||
change appearance of the segmentation including color, opacity, and visibility.
|
||||
|
||||
Segmentations in OHIF are based on the Segmentations in Cornerstone3D. You can
|
||||
read more about it in the [Cornerstone Segmentation](https://www.cornerstonejs.org/docs/concepts/cornerstone-tools/segmentation/). OHIF currently only supports
|
||||
one representation of the segmentation data.
|
||||
|
||||
## Events
|
||||
|
||||
There are seven events that get publish in `MeasurementService`:
|
||||
|
||||
| Event | Description |
|
||||
| --------------------- | ------------------------------------------------------ |
|
||||
| SEGMENTATION_UPDATED | Fires when a segmentation is updated e.g., segment added, removed etc.|
|
||||
| SEGMENTATION_DATA_MODIFIED | Fires when the segmentation data changes |
|
||||
| SEGMENTATION_ADDED | Fires when a new segmentation is added to OHIF |
|
||||
| SEGMENTATION_REMOVED | Fires when a segmentation is removed from OHIF |
|
||||
| SEGMENTATION_CONFIGURATION_CHANGED | Fires when a segmentation configuration is changed |
|
||||
| SEGMENT_PIXEL_DATA_CREATED | Fires when a segment group adds its pixel data to the volume |
|
||||
| SEGMENTATION_PIXEL_DATA_CREATED | Fires when the full segmentation volume is filled with its segments |
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### Segmentation Creation
|
||||
|
||||
- `createSegmentationForDisplaySet`: based on a reference displaySet, create a new segmentation. E.g., create a new segmentation based on a CT series
|
||||
- `createSegmentationForSEGDisplaySet`: given a segDisplaySet loaded by a sopClassHandler, create a new segmentation
|
||||
- `addSegmentationRepresentationToToolGroup`: given the toolGroupId, add the given segmentationId to the toolGroup.
|
||||
|
||||
|
||||
### Segmentation Behavior
|
||||
|
||||
- setActiveSegmentationForToolGroup, getSegmentations, getSegmentation, jumpToSegmentCenter, highlightSegment
|
||||
|
||||
|
||||
### Segment Behavior
|
||||
|
||||
- setSegmentLockedForSegmentation, removeSegment, addSegment, setSegmentLockedForSegmentation, setSegmentLabel, setActiveSegmentForSegmentation,
|
||||
setSegmentRGBAColorForSegmentation
|
||||
|
||||
### Segmentation Configuration
|
||||
|
||||
Setters
|
||||
|
||||
- setSegmentVisibility, setSegmentColor, setSegmentRGBA, setSegmentOpacity, toggleSegmentationVisibility,
|
||||
@@ -59,6 +59,17 @@ The following services is available in the `OHIF-v3`.
|
||||
DisplaySetService
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="./data/SegmentationService">
|
||||
SegmentationService (NEW)
|
||||
</a>
|
||||
</td>
|
||||
<td>Segmentation Service</td>
|
||||
<td>
|
||||
SegmentationService
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="./data/HangingProtocolService">
|
||||
|
||||
Reference in new issue
Block a user