OHIF / Viewers

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

DICOM JSON file multiframe not working #4114

Open kinsolutions opened 6 months ago

kinsolutions commented 6 months ago

Could you please share with me an example DICOM JSON file for multiframe? I have tried viewing it, and it shows the number of instances based on the number of frames, but when I scroll, it's not loading the next frame. Could you please suggest if there's anything I missed?

image

Originally posted by @kinsolutions in https://github.com/OHIF/Viewers/issues/2262#issuecomment-2098177053

sedghi commented 6 months ago

We haven't really tried the dicomJSON with multiframe.

@Ouwen Did you guys ever worked on this?

mochi-latte commented 6 months ago

I have the same issue. @kinsolutions did you find a solution?

mochi-latte commented 5 months ago

@sedghi I found the issue. There is two places:

Firstly, this loop should be start from 1 instead.

https://github.com/OHIF/Viewers/blob/4761bbf0c8c546b46fc5463dc608bc5dcea91044/extensions/default/src/DicomJSONDataSource/index.js#L264-L271

getImageId should update the frame query in the URL.

https://github.com/OHIF/Viewers/blob/29c02121df6eaab7443cf161d8feddf58c2075fc/extensions/default/src/DicomWebDataSource/utils/getImageId.js#L32-L34

fightroad commented 3 months ago

the same。 There are many issues when comparing the DICOMJSON and DICOMweb methods, and I hope these can be prioritized for resolution.

Ouwen commented 3 months ago

The URL for multiframe needs to include the frame such as &frame=0 then it should work as supported. However, for extremely large multiframe, this can cause issues in the caching and decaching of files.

Ideally, there is logic in multiframe to load the bytes of just the frame of interest so caching is granular at the slice level. Otherwise you'll have a slice of the multiframe decache and to get the slice back the entire multiframe may need to be re-downloaded.

In dicomweb, usually this logic is handled for you and everything is always at a slice level. However, multiframe P10 file format will not and the logic either needs to be handled in the frontend (no longer part of the dicomweb spec). Or a intermediate server needs to slice out instances within the multiframe (part of the dicomweb spec).

nilovelarde commented 1 week ago

still having issues on my end as well for US and Mg Modality or Single DICOM Instance but multiframe here is my constructed json based on DicomJson Documentation

{ "studies": [ { "StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.1188.2803.272546201471978974292888446466", "StudyDate": "20120713", "StudyTime": "121818", "PatientName": "", "PatientID": "", "AccessionNumber": "Not provided", "PatientAge": "O", "PatientSex": "Not provided", "series": [ { "SeriesInstanceUID": "1.3.6.1.4.1.14519.5.2.1.1188.2803.738581576903765604292010199710", "SeriesNumber": "1", "Modality": "US", "SliceThickness": 0, "instances": [ { "metadata": { "Columns": 1170, "Rows": 649, "InstanceNumber": 2048, "sopClassUID": "1.2.840.10008.5.1.4.1.1.3.1", "PhotometricInterpretation": "RGB", "BitsAllocated": 8, "BitsStored": 8, "PixelRepresentation": 0, "SamplesPerPixel": 3, "PlanarConfiguration": 0, "PixelSpacing": [ 0, 0 ], "HighBit": 7, "ImageOrientationPatient": [ 1, 0, 0, 0, 1, 0 ], "ImagePositionPatient": [ 0, 0, 0 ], "FrameOfReferenceUID": "", "ImageType": [ "DERIVED", "PRIMARY", "ABDOMINAL", "0000", "GEMSMULTIFRAME", "GEMSMGCOUNT1" ], "Modality": "US", "SOPInstanceUID": "1.3.6.1.4.1.14519.5.2.1.1188.2803.231755061775646009306758556574", "SeriesInstanceUID": "1.3.6.1.4.1.14519.5.2.1.1188.2803.738581576903765604292010199710", "StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.1188.2803.272546201471978974292888446466", "WindowCenter": 0, "WindowWidth": 0, "SeriesDate": "20120713", "NumberOfFrames": 105, "FrameIncrementPointer": "(0018,1063)", "FrameTime": 107.47968, "FrameDelay": 0, "ActualFrameDuration": 107, "RecommendedDisplayFrameRate": 9, "CineRate": 9, "BodyPartExamined": "LIVER", "EffectiveDuration": 11 }, "url": "dicomweb:https:**.s3.amazonaws.com/{filename}.dcm" } ] } ], "NumInstances": 1, "Modalities": "US" } ] }

DICOM file are test files on my dev environment

The MG modality Multiframe is not working as well in dicomJson but for MG modality it has no ActualFrameDuration, FrameIncrementPointer, FrameTime, Planar Config and other related to US modality

nilovelarde commented 1 week ago

please help

sedghi commented 1 week ago

We will explore DICOM JSON in the future, but unfortunately, it is not a priority at the moment.

nilovelarde commented 1 week ago

We will explore DICOM JSON in the future, but unfortunately, it is not a priority at the moment.

Thanks, I figured it out the solution... just add the frame index in url parameter

url: dicomwebEndpoint/file_name.dcm?frame=${frameIndex}

sedghi commented 1 week ago

Can we close this then?

nilovelarde commented 1 week ago

Can we close this then?

Yes Thank you, but i suggest to Update the documentation for DicomJson to also Include Multiframe Instances https://docs.ohif.org/configuration/datasources/dicom-json/

sedghi commented 1 week ago

Do you want to do that?