Describe Your Question
- I am trying to display DICOM SEG file as an overlay over DICOM PET file. I checked the metadata for frameOfReference, it’s matching. I’m using a custom mode and a hanging protocol along with it. When I’m trying to drag and drop the SEG file over PET viewport then instead of overlaying it is replacing the viewport and then going blank. How can I stop the SEG replacing the PET viewport?
- Which OHIF version you are using?
v3.10.2
Adding my hanging protocol.
import { Types } from '@ohif/core';
import { studyWithImages } from '@ohif/extension-default/src/hangingprotocols/utils/studySelectors';
import { seriesWithImages } from '@ohif/extension-default/src/hangingprotocols/utils/seriesSelectors';
import { viewportOptions } from '@ohif/extension-default/src/hangingprotocols/utils/viewportOptions';
const PET_MODALITY = 'PT';
const CT_MODALITY = 'CT';
const SEG_MODALITY = 'SEG';
/**
* This is a purpose-built hanging protocol for viewing PET/CT studies
* with an accompanying SEG overlay.
*
* To activate, use the URL parameter: &hangingProtocolId=@ohif/hp.pt-ct-seg
*/
const ptCtSeg: Types.HangingProtocol.Protocol = {
id: 'extension-gcis/ptCtSeg',
name: 'PET/CT with SEG',
description: 'PET/CT with SEG overlay',
protocolMatchingRules: [
{
// This protocol should only be activated if the study has
// series with all three modalities: PET, CT, and SEG.
attribute: 'ModalitiesInStudy',
constraint: {
contains: [PET_MODALITY, CT_MODALITY, SEG_MODALITY],
},
},
],
toolGroupIds: ['default'],
// ------------------------- DISPLAY SET SELECTORS -------------------------
// These selectors are the "brains" of the protocol. They identify the
// different types of series we need.
displaySetSelectors: {
ctSeries: {
seriesMatchingRules: [{ attribute: 'Modality', constraint: { equals: CT_MODALITY } }],
},
ptSeries: {
seriesMatchingRules: [
{ attribute: 'Modality', constraint: { equals: PET_MODALITY } },
{
// Ensure it's a displayable image series
attribute: 'isImage',
constraint: { equals: true },
},
],
// Sort by SeriesNumber to get the primary PET
sorting: { attribute: 'SeriesNumber', type: 'number', descending: false },
},
segSeries: {
allowUnmatchedView: true,
seriesMatchingRules: [
{ attribute: 'Modality', constraint: { equals: SEG_MODALITY }, weight: 1 },
],
},
// This creates the FUSED PET/CT image
fusion: {
seriesMatchingRules: [
{
attribute: 'Modality',
constraint: {
// This special 'or' condition creates a fusion display set
or: [{ equals: PET_MODALITY }, { equals: CT_MODALITY }],
},
},
],
// Specify that this display set should be of type 'fusion'
options: {
protocol: {
id: 'fusion',
viewport: {
viewportType: 'volume',
toolGroupId: 'ptct', // Use a toolgroup with fusion tools
options: {
blendMode: 'MIP',
slabThickness: 'fullVolume',
},
},
},
},
},
},
stages: [
{
id: '2x2-pt-ct-seg',
name: '2x2',
viewportStructure: {
layoutType: 'grid',
properties: {
rows: 2,
columns: 2,
},
},
// ------------------------- VIEWPORTS -------------------------
// This is where we arrange the display sets from the selectors above.
viewports: [
{
// Viewport 1: CT with SEG Overlay
viewportOptions: { viewportType: 'stack', toolGroupId: 'default' },
displaySets: [
{ id: 'ctSeries' },
{
id: 'segSeries',
options: { referencedDisplaySetId: 'ctSeries' }, // Link SEG to CT
},
],
},
{
// Viewport 2: PET with SEG Overlay
viewportOptions: { viewportType: 'stack', toolGroupId: 'default' },
displaySets: [
{ id: 'ptSeries' },
{
id: 'segSeries',
options: { referencedDisplaySetId: 'ptSeries' }, // Link SEG to PT
},
],
},
{
// Viewport 3: Fused PET/CT with SEG Overlay
viewportOptions: { viewportType: 'volume', toolGroupId: 'ptct' },
displaySets: [
{ id: 'fusion' },
{
id: 'segSeries',
options: { referencedDisplaySetId: 'fusion' }, // Link SEG to Fusion
},
],
},
{
// Viewport 4: Empty, for dragging other series
viewportOptions: { viewportType: 'stack', toolGroupId: 'default' },
displaySets: [],
},
],
},
],
};
export default ptCtSeg;