Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] PDF appear dark (wont properly load)

Open niirdan opened this issue 1 year ago • 2 comments

Describe the Bug

Screenshot 2024-05-12 101944 Looks like pdf couldn't be loaded properly

Steps to Reproduce

open a study containing pdf document

*note! i am using google healthcare api .

The current behavior

pdf viewer inside ohif wont load

The expected behavior

pdf presented correctly

OS

window 11

Node version

v18.17.1

Browser

latest chrome update

niirdan avatar May 12 '24 07:05 niirdan

What is your server? can you provide the anonymized data?

Could you kindly provide the data if it has been anonymized and you can confirm that there is no patient health information present in any of the headers or embedded within the pixel data?

sedghi avatar May 14 '24 13:05 sedghi

@sedghi hey sedghi , i am not sure i understood you 100% , but i attach the dicom's meta data (censoring its patient info ) I am using dcmtk for encapsulating the pdf to dicom and dcmtk dcmodify to add necessary information about the study and patient Screenshot 2024-05-15 090416

niirdan avatar May 15 '24 06:05 niirdan

good morning, popping up due that it is still appears in the latest version

niirdan avatar May 28 '24 07:05 niirdan

Could you kindly provide the data if it has been anonymized and you can confirm that there is no patient health information present in any of the headers or embedded within the pixel data?

sedghi avatar May 28 '24 15:05 sedghi

Hey alizera thanks for your response, I uploaded a photo of the meta data’s file (pdf) I confirm it doesn’t contain real patient information- it has been censored

On Tue, 28 May 2024 at 18:42 Alireza @.***> wrote:

Could you kindly provide the data if it has been anonymized and you can confirm that there is no patient health information present in any of the headers or embedded within the pixel data?

— Reply to this email directly, view it on GitHub https://github.com/OHIF/Viewers/issues/4118#issuecomment-2135572281, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5B2UZTXLZUCQD3ZEZNKICTZESQWNAVCNFSM6AAAAABHSST46OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZVGU3TEMRYGE . You are receiving this because you authored the thread.Message ID: @.***>

niirdan avatar May 28 '24 15:05 niirdan

No i meant the actual dicom file, do you have it and can you share it?

sedghi avatar May 28 '24 15:05 sedghi

No i meant the actual dicom file, do you have it and can you share it? Yes Of course ! unfortunately github doesn't allow dcm format so i will upload it here : https://www.jumbomail.me/l/en/gallery/697273696E617777705662464B3342347436653838673D3D/1181030228 let me know if you have an issue downloading it

niirdan avatar May 28 '24 16:05 niirdan

So when i drag and drop it in local it works fine https://viewer-dev.ohif.org/localbasic

CleanShot 2024-05-28 at 18 10 46@2x

What server are you using? these things are most likely server depndent

Have you seen this https://docs.ohif.org/configuration/datasources/dicom-web/#singlepart

sedghi avatar May 28 '24 22:05 sedghi

I saw you use google healthcare

I uploaded your data to our google healthcare and i see the instance is this

CleanShot 2024-05-28 at 18 18 26@2x

And basically this comes back undefined

 const pdfUrl = dataSource.retrieve.directURL({
      instance,
      tag: 'EncapsulatedDocument',
      defaultType: MIMETypeOfEncapsulatedDocument || 'application/pdf',
      singlepart: 'pdf',
    });

Since there is not EncapsulatedDocument tag that google sends back and as I understand this is a type 1 attribute

https://dicom.innolitics.com/ciods/encapsulated-pdf/encapsulated-document/00420011

Our demo server (static dicom web) provides a bulkDataURI

CleanShot 2024-05-28 at 18 20 58@2x

And Orthanc provides this too

CleanShot 2024-05-28 at 18 22 01@2x

So i believe this is a issue with how google is responding back.

Tagging @jasonklotzer to see if he knows more about DICOM PDF on Google Healthcare

sedghi avatar May 28 '24 22:05 sedghi

BulkDataURI is only available when using the beta API right now. Please try it out and tell me how it goes.

jasonklotzer avatar May 29 '24 02:05 jasonklotzer

BulkDataURI is only available when using the beta API right now. Please try it out and tell me how it goes.

Hey jason @jasonklotzer , thanks for responding do to mean to change this by adding beta1 to the version section of this url ? (v1beta1) ? 'https://healthcare.googleapis.com/v1/projects/XXXX/locations/me-west1/datasets/XX-dataset/dicomStores/XX-datastore/dicomWeb' on ohif's google.js settings ? as far as i understand it still return undefined due to the fact that the file's meta data haven't changed .. I will be happy for a tiny explanation what to change in this process ?

niirdan avatar May 29 '24 11:05 niirdan

@sedghi It would be helpful for you to take a look at the API and validate whether that conforms to the OHIF expectations for interacting with a BulkDataURI provider?

@niirdan Yes, the Google Healthcare API DICOM store added support for generating BulkDataURI's and retrieving their referenced payload, and that support is currently in the v1beta1 version of the API. The underlying database has also been populated (backfilled) with any relevant bulk data references, so upon using this version of the API you should see BulkDataURI references.

jasonklotzer avatar May 29 '24 18:05 jasonklotzer

Interesting, I'll check

sedghi avatar May 29 '24 18:05 sedghi

@sedghi It would be helpful for you to take a look at the API and validate whether that conforms to the OHIF expectations for interacting with a BulkDataURI provider?

@niirdan Yes, the Google Healthcare API DICOM store added support for generating BulkDataURI's and retrieving their referenced payload, and that support is currently in the v1beta1 version of the API. The underlying database has also been populated (backfilled) with any relevant bulk data references, so upon using this version of the API you should see BulkDataURI references.

Thanks for the response , after using v1beta1 looks like it's still returning undefined

niirdan avatar May 31 '24 06:05 niirdan

@sedghi Hey Alizera , just to make sure, does it appear to be a bug in ohif ? or it seems to be a bad behavior of google's api ? I tried using the beta version of the api as @jasonklotzer told , and it is still seems to appear dark .

niirdan avatar Jun 03 '24 13:06 niirdan

I see the bulkDataURI in the v1beta1

CleanShot 2024-06-05 at 22 57 22@2x

and i was able to render it

CleanShot 2024-06-05 at 23 02 17@2x

these are the changes required

CleanShot 2024-06-05 at 23 02 32@2x

Note the bulkDataURI enabled

@niirdan Would you be able to add a section to our documentation with a pull request describing the v1beta1 and bulkDataURI?

Maybe here https://docs.ohif.org/configuration/datasources/dicom-web/#bulkdatauri

sedghi avatar Jun 06 '24 03:06 sedghi

I see the bulkDataURI in the v1beta1

CleanShot 2024-06-05 at 22 57 22@2x

and i was able to render it

CleanShot 2024-06-05 at 23 02 17@2x

these are the changes required

CleanShot 2024-06-05 at 23 02 32@2x

Note the bulkDataURI enabled

@niirdan Would you be able to add a section to our documentation with a pull request describing the v1beta1 and bulkDataURI?

Maybe here https://docs.ohif.org/configuration/datasources/dicom-web/#bulkdatauri

Done ! issue has been fixed , you can close this issue, Thanks!

niirdan avatar Jun 06 '24 13:06 niirdan

@sedghi

I'm experiencing a similar issue where the page is blank, but only for the PDF viewer. All other viewers work well with the same setup, and the PDF viewer does work when I upload documents locally (https://viewer-dev.ohif.org/localbasic). I am using a dicomjson datasource with the following JSON data:

{
  "studies": [
      {
          "StudyInstanceUID": "1.2.276.0.7230010.3.1.2.2344313775.14992.1458058363.6979",
          "StudyDate": "20130812",
          "StudyTime": "164709.000",
          "PatientName": "CARDIO",
          "PatientID": "7B23891B-E78E-43DC-AE6C-55AFC72FC51C",
          "AccessionNumber": "",
          "PatientAge": "",
          "PatientSex": "",
          "Modalities": "OT",
          "NumInstances": 0,
          "series": [
              {
                  "SeriesInstanceUID": "1.2.276.0.7230010.3.1.3.1901948703.36080.1484835349.617",
                  "SeriesNumber": 0,
                  "Modality": "OT",
                  "SliceThickness": 0,
                  "instances": [
                      {
                          "metadata": {
                              "Columns": 0,
                              "Rows": 0,
                              "InstanceNumber": 0,
                              "SOPClassUID": "1.2.840.10008.5.1.4.1.1.104.1",
                              "PhotometricInterpretation": "",
                              "BitsAllocated": 0,
                              "BitsStored": 0,
                              "PixelRepresentation": 0,
                              "SamplesPerPixel": 0,
                              "PixelSpacing": [],
                              "HighBit": 0,
                              "ImageOrientationPatient": [1, 0, 0, 0, 1, 0],
                              "ImagePositionPatient": [0, 0, 0],
                              "FrameOfReferenceUID": "",
                              "ImageType": [],
                              "Modality": "OT",
                              "SOPInstanceUID": "1.2.276.0.7230010.3.1.4.1901948703.36080.1484835349.618",
                              "SeriesInstanceUID": "1.2.276.0.7230010.3.1.3.1901948703.36080.1484835349.617",
                              "StudyInstanceUID": "1.2.276.0.7230010.3.1.2.2344313775.14992.1458058363.6979",
                              "WindowCenter": 0,
                              "WindowWidth": 0,
                              "SeriesDate": "20130814"
                          },
                          "url": "dicomweb:https://bytepadstoragedev.blob.core.windows.net/dicom-dev-data/DCM/2.25.274511628741404487568958573697750835997/DCM_WITH_PDF_OT000000.dcm?sv=2023-01-03&st=2024-09-01T13%3A59%3A58Z&se=2027-12-31T14%3A00%3A00Z&sr=c&sp=rl&sig=oqZTTck06%2BipiSptCd4i7pmh8Y2A1ikNuB6Rx0%2BC22E%3D"
                      }
                  ]
              }
          ]
      }
  ]
}

My current configuration is:

/** @type {AppTypes.Config} */
window.config = {
  routerBasename: '/',
  extensions: [],
  modes: [],
  dataSources: [
    {
      namespace: '@ohif/extension-default.dataSourcesModule.dicomjson',
      sourceName: 'dicomjson',
      configuration: {
        friendlyName: 'dicom json',
        name: 'json',
        singlepart: 'bulkdata,video,pdf',
        bulkDataURI: {
          enabled: true,
          relativeResolution: 'series',
        },
      },
    },
  ],
  defaultDataSourceName: 'dicomjson',
};

Additionally, in the console, I am seeing the following error message:

rendered:1  Uncaught (in promise) InvalidStateError: Failed to get ServiceWorkerRegistration objects: The document is in an invalid state.

I've tried different configurations without success. Are there any specific settings or configurations that might address the blank page in the PDF viewer? Any guidance would be appreciated.

thereddycr avatar Oct 28 '24 10:10 thereddycr