New viewport using Layout tool not respecting hanging protocol

Describe Your Question

I am having an issue with new viewports added using the Layout tool. My hanging protocol defines new viewports to be of type volume, however any new viewport created with the Layout tool defaults to a stack viewport. It seems like the isHangingProtocolLayout parameter is always undefined when using the Layout tool (setViewportGridLayout command), which defaults it to false causing the wrong behaviour further down. I tried also adding it as a commandOptions parameter for the Layout tool itself, but no success.

I am using v3.8.3, and I was not experiencing this on v3.7.0, so I am wondering if it’s a config issue on my side or a bug.

Any help is appreciated!

What steps can we follow to reproduce the bug?

  1. Set up hanging protocol that defines new layout viewports to be of type volume
  2. Open a study with multiple series (MR)
  3. Load first series into the main viewport (automatic)
  4. Using the Layout tool, create a new viewport (2 cols, 1 row)
  5. Verify new viewport is of type volume
  6. Drag second series into new viewport
  7. Second viewport is now a stack viewport instead of a volume viewport (due to isHangingProtocolLayout being false and thus the protocol is not used to fetch the viewportOptions

Hangin protocol:

const gridHangingProtocol: Types.HangingProtocol.Protocol = {
  id: 'default',
  description: '',
  name: 'Grid',
  protocolMatchingRules: [
    {
      id: 'ModalitiesInStudy',
      weight: 100,
      attribute: 'ModalitiesInStudy',
      constraint: {
        greaterThan: 0,
      },
      required: false,
    },
  ],
  toolGroupIds: ['default'],
  displaySetSelectors: {
    defaultDisplaySetId: {
      seriesMatchingRules: [],
    },
  },
  defaultViewport: {
    viewportOptions: {
      viewportType: 'volume',
      toolGroupId: 'default',
      orientation: 'AXIAL',
      allowUnmatchedView: true,
    },
    displaySets: [
      {
        id: 'defaultDisplaySetId',
        matchedDisplaySetsIndex: -1,
      },
    ],
  },
  stages: [
    {
      name: 'default',
      id: 'default',
      stageActivation: {
        enabled: {
          minViewportsMatched: 1,
        },
      },
      viewportStructure: {
        layoutType: 'grid',
        properties: {
          rows: 1,
          columns: 1,
        },
      },
      viewports: [
        {
          viewportOptions: {
            toolGroupId: 'default',
            viewportType: 'volume',
            orientation: 'AXIAL',
            allowUnmatchedView: true,
          },
          displaySets: [
            {
              id: 'defaultDisplaySetId',
            },
          ],
        },
      ],
    },
  ],
  numberOfPriorsReferenced: -1,
};

Toolbar button

  {
    id: 'Layout',
    uiType: 'ohif.layoutSelector',
    props: {
      evaluate: 'evaluate.action',
      commands: [
        {
          commandName: 'setViewportGridLayout',
          commandOptions: {
            isHangingProtocolLayout: true,
          },
        },
      ],
    },
  },

Yeah you are right
Wait a few more days for the release of cornerstone3D 2.0. This update will significantly improve the alignment between stack and volume, resolving these issues for you.

1 Like

Thank you! Will try it out once it’s released