OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.35k stars 3.37k forks source link

Feat/multi route modes #4318

Open vlasn opened 3 months ago

vlasn commented 3 months ago

Context

The documentation mentions support for multi-route/multi-layout modes being planned in the future. Given that we'd like to start using this functionality, we'd be happy to contribute it.

Changes & Results

Updated ModeRoute (platform/app/src/routes/Mode/Mode.tsx) to accept an optional modeRoutePath prop

Updated buildModeRoutes logic (platform/app/src/routes/buildModeRoutes.tsx)

In addition to generating & registering /{mode.routeName} and /{mode.routeName}/{dataSourceID} paths, we generate & register for each route in a mode

Given that we still register the /{mode.routeName} and /{mode.routeName}/{dataSourceID} paths, the router retains previous functionality.

Testing

{
  path: 'panelless',
  /*init: ({ servicesManager, extensionManager }) => {
    //defaultViewerRouteInit
  },*/
  layoutTemplate: () => {
    return {
      id: 'some-other-id',
      props: {
        leftPanels: [],
        rightPanels: [],
        rightPanelClosed: true,
        leftPanelClosed: true,
        viewports: [
          {
            namespace: tracked.viewport,
            displaySetsToDisplay: [ohif.sopClassHandler],
          },
        ],
      },
    };
  },
},

โš ๏ธ The following steps are written assuming you chose to modify the longitudinal mode. Please modify URL-s as appropriate in case you installed the basic dev mode instead.

  • Confirm the default mode route still works on the bare /viewer?... URL
  • Confirm the default dataset-specific route (/viewer/dicomweb?....) still works
  • Confirm the explicit longitudinal route (/viewer/longitudinal?....) works
  • Confirm the newly added route (viewer/panelless?...) works and renders without any side panels
  • Confirm the newly added route works with the explicit datasource suffix (viewer/panelless/dicomweb?...)

Checklist

PR

Code

Public Documentation Updates

Tested Environment

netlify[bot] commented 3 months ago

Deploy Preview for ohif-platform-docs ready!

Name Link
Latest commit 6ee404f1fd6925cc59f353354ecff4cc96a6771e
Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/66a7873c4b26980008aee86f
Deploy Preview https://deploy-preview-4318--ohif-platform-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 3 months ago

Deploy Preview for ohif-dev ready!

Name Link
Latest commit 6ee404f1fd6925cc59f353354ecff4cc96a6771e
Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/66a7873c929c6600085b0f12
Deploy Preview https://deploy-preview-4318--ohif-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

vlasn commented 3 months ago

Should mode.route.layoutTemplate({...}) return an unique layout ID? Does any other viewer logic rely on these being unique & should these be enforced?

salimkanoun commented 2 weeks ago

Hi there, this is a nice addition, any chance to get it merged ?

vlasn commented 5 days ago

Hi, thank you for the feedback! Just to keep you in the loop, I will circle back to making the suggested changes, just not sure we have the time & bandwidth before RSNA ๐Ÿคž