mieweb / OHIF-Viewers

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

Framerate & Cine issues #4

Open norman-ma opened 2 years ago

norman-ma commented 2 years ago

In this code when we run the multiframe US, the viewportSpecificData object does not have a cine property and so the cine framerate remains the default of 24. viewportSpecificData does have a framerate property however.

https://github.com/mieweb/OHIF-Viewers/blob/1cc94f36a77cccb34cab68dcd7f991241801290f/extensions/cornerstone/src/ConnectedCornerstoneViewport.js#L41

if (viewportSpecificData && viewportSpecificData.cine) {
    const cine = viewportSpecificData.cine;

    isPlaying = cine.isPlaying === true;
    frameRate = cine.cineFrameRate || frameRate;
  }
norman-ma commented 2 years ago

This is where the FrameTime property is retireved and the framerate derived.

This is eventually added to the viewportSpecificData but not to a viewportSpecificData.cine object.

https://github.com/mieweb/OHIF-Viewers/blob/78f1a7f3e5df07fc6adeb10dda4f8672a4cc1d79/extensions/cornerstone/src/components/OHIFCornerstoneViewportOverlay.js#L63

const cineModule = cornerstone.metaData.get('cineModule', imageId) || {};
const { frameTime } = cineModule;
const frameRate = formatNumberPrecision(1000 / frameTime, 1);
norman-ma commented 2 years ago

This is the CINE_MODULE handler in the metaDataProvider. It only gets the frameTime.

https://github.com/mieweb/OHIF-Viewers/blob/1d85f7a74e887f628ca8171bfd595340c8960b97/platform/core/src/classes/MetadataProvider.js#L430

case WADO_IMAGE_LOADER_TAGS.CINE_MODULE:
        metadata = {
          frameTime: instance.FrameTime,
        };

        break;