docs: beginnings of SOPClassHandlerModule docs
This commit is contained in:
parent
fd7620ced9
commit
f06ef53e83
@ -1,6 +1,37 @@
|
|||||||
# Module: SOP Class Handler
|
# Module: SOP Class Handler
|
||||||
|
|
||||||
...
|
An extension can register a SOP Class Handler Module by defining a
|
||||||
|
`getSopClassHandlerModule` method. The SOP Class Handler is a bit different from
|
||||||
|
the other modules, as it doesn't provide a `1:1` schema for UI or provide it's
|
||||||
|
own components. It instead defines:
|
||||||
|
|
||||||
|
- `sopClassUids`: an array of string SOP Class UIDs that the
|
||||||
|
`getDisplaySetFromSeries` method should be applied to.
|
||||||
|
- `getDisplaySetFromSeries`: a method that maps series and study metadata to a
|
||||||
|
display set
|
||||||
|
|
||||||
|
A `displaySet` has the following shape:
|
||||||
|
|
||||||
|
```js
|
||||||
|
return {
|
||||||
|
plugin: 'html',
|
||||||
|
modality: 'SR',
|
||||||
|
displaySetInstanceUid: 0,
|
||||||
|
wadoRoot: study.getData().wadoRoot,
|
||||||
|
wadoUri: instance.getData().wadouri,
|
||||||
|
sopInstanceUid: instance.getSOPInstanceUID(),
|
||||||
|
seriesInstanceUid: series.getSeriesInstanceUID(),
|
||||||
|
studyInstanceUid: study.getStudyInstanceUID(),
|
||||||
|
authorizationHeaders,
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Where the `plugin` key is used to influence the default `ViewportComponent` for
|
||||||
|
rendering the `displaySet`. Additional properties are passed to the
|
||||||
|
`ViewportComponent` and used by the default `StudyBrowser` to render
|
||||||
|
"thumbnails" for each `displaySet`
|
||||||
|
|
||||||
|
## Example SOP Class Handler Module
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const SOP_CLASS_UIDS = {
|
const SOP_CLASS_UIDS = {
|
||||||
@ -8,7 +39,16 @@ const SOP_CLASS_UIDS = {
|
|||||||
ENHANCED_SR: '1.2.840.10008.5.1.4.1.1.88.22',
|
ENHANCED_SR: '1.2.840.10008.5.1.4.1.1.88.22',
|
||||||
};
|
};
|
||||||
|
|
||||||
const sopClassHandlerModule = {
|
export default {
|
||||||
|
id: 'example-sop-class-handler-module',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {object} params
|
||||||
|
* @param {ServicesManager} params.servicesManager
|
||||||
|
* @param {CommandsManager} params.commandsManager
|
||||||
|
*/
|
||||||
|
getSopClassHandlerModule({ servicesManager, commandsManager }) {
|
||||||
|
return {
|
||||||
id: 'OHIFDicomHtmlSopClassHandler',
|
id: 'OHIFDicomHtmlSopClassHandler',
|
||||||
sopClassUids: Object.values(SOP_CLASS_UIDS),
|
sopClassUids: Object.values(SOP_CLASS_UIDS),
|
||||||
|
|
||||||
@ -32,5 +72,19 @@ const sopClassHandlerModule = {
|
|||||||
authorizationHeaders,
|
authorizationHeaders,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `@ohif/viewer` usage
|
||||||
|
|
||||||
|
We use the `sopClassHandlerModule`s in three different places:
|
||||||
|
|
||||||
|
- `ViewerLocalFileData.js`
|
||||||
|
- `ViewerRetrieveStudyData.js`
|
||||||
|
- `StandaloneRouting.js`
|
||||||
|
|
||||||
|
Each time, it is used to map study and series data to `displaySets`. It does
|
||||||
|
this by working alongside the `StudyMetadataManager` in `@ohif/core`. That
|
||||||
|
manager has the method `createDisplaySets` that takes an array of
|
||||||
|
`sopClassHandlerModules`.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user