WIP SR viewport.

This commit is contained in:
James A. Petts committed 2020-06-03 19:12:13 +02:00
1 parent 8674e676b7
commit 558ab00c23
22 files changed
+904 -8

No files matched your search

+104
View File
@@ -0,0 +1,104 @@
export default function mode({ modeConfiguration }) {
return {
id: 'sr-example-mode',
validationTags: {
study: [],
series: [],
},
isValidMode: (studyTags, seriesTags) => {
// All series are welcome in this mode!
return true;
},
routes: [
{
path: 'viewer',
init: ({ servicesManager, extensionManager }) => {
const { ToolBarService } = servicesManager.services;
ToolBarService.init(extensionManager);
ToolBarService.addButtons([
{
id: 'Zoom',
namespace: 'org.ohif.cornerstone.toolbarModule.Zoom',
},
{
id: 'Levels',
namespace: 'org.ohif.cornerstone.toolbarModule.Wwwc',
},
{
id: 'Pan',
namespace: 'org.ohif.cornerstone.toolbarModule.Pan',
},
{
id: 'Capture',
namespace: 'org.ohif.cornerstone.toolbarModule.Capture',
},
{
id: 'Layout',
namespace: 'org.ohif.default.toolbarModule.Layout',
},
{
id: 'Annotate',
namespace: 'org.ohif.cornerstone.toolbarModule.Annotate',
},
{
id: 'Bidirectional',
namespace: 'org.ohif.cornerstone.toolbarModule.Bidirectional',
},
{
id: 'Ellipse',
namespace: 'org.ohif.cornerstone.toolbarModule.Ellipse',
},
{
id: 'Length',
namespace: 'org.ohif.cornerstone.toolbarModule.Length',
},
]);
// Could import layout selector here from org.ohif.default (when it exists!)
ToolBarService.setToolBarLayout([
// Primary
{
tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
moreTools: ['Zoom'],
},
// Secondary
{
tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'],
},
]);
},
layoutTemplate: ({ routeProps }) => {
return {
id: 'org.ohif.default.layoutTemplateModule.viewerLayout',
props: {
// named slots
leftPanels: ['org.ohif.default.panelModule.seriesList'],
rightPanels: ['org.ohif.default.panelModule.measure'],
viewports: [
{
namespace: 'org.ohif.cornerstone.viewportModule.cornerstone',
displaySetsToDisplay: [
'org.ohif.default.sopClassHandlerModule.stack',
],
},
{
namespace: 'org.ohif.dicom-sr.viewportModule.dicom-sr',
displaySetsToDisplay: [
'org.ohif.dicom-sr.sopClassHandlerModule.dicom-sr',
],
},
],
},
};
},
},
],
extensions: ['org.ohif.default', 'org.ohif.cornerstone'],
sopClassHandlers: [
'org.ohif.default.sopClassHandlerModule.stack',
'org.ohif.dicom-sr.sopClassHandlerModule.dicom-sr',
],
};
}
window.SRViewportExample = mode({});