Skip to content

Commit

Permalink
fix(updateIndex): getNumberOfSlices is defined when used with a 3D vi…
Browse files Browse the repository at this point in the history
…ewport (#4424)
  • Loading branch information
Ceciliadrc authored Oct 17, 2024
1 parent ac1cad2 commit d5bcf54
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { Enums, Types, utilities } from '@cornerstonejs/core';
import { Enums, VolumeViewport3D } from '@cornerstonejs/core';
import { utilities as csToolsUtils } from '@cornerstonejs/tools';
import { ImageScrollbar } from '@ohif/ui';

Expand Down Expand Up @@ -39,7 +39,7 @@ function CornerstoneImageScrollbar({

const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);

if (!viewport) {
if (!viewport || viewport instanceof VolumeViewport3D) {
return;
}

Expand All @@ -64,6 +64,7 @@ function CornerstoneImageScrollbar({

const updateIndex = event => {
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
if(!viewport || viewport instanceof VolumeViewport3D) return
const { imageIndex, newImageIdIndex = imageIndex } = event.detail;
const numberOfSlices = viewport.getNumberOfSlices();
// find the index of imageId in the imageIds
Expand Down

0 comments on commit d5bcf54

Please sign in to comment.