Skip to main content
Version: Version 3.0 ๐Ÿšง


You can launch the OHIF Viewer with a JSON file which points to a DICOMWeb server as well as a list of study and series instance UIDs along with metadata.

An example would look like

As you can see the url to the location of the JSON file is passed in the query after the dicomjson string, which is (this json file has been generated by OHIF team and stored in an amazon s3 bucket for the purpose of the guide).

DICOM JSON sample#

Here we are using the LIDC-IDRI-0001 case which is a sample of the LIDC-IDRI dataset. Let's have a look at the JSON file:


JSON file stores the metadata for the study level, series level and instance level. A JSON launch file should follow the same structure as the one below.

Note that at the instance level metadata we are storing both the metadata and also the url for the dicom file on the dicom server. In this case we are referring to dicomweb: which is stored in another directory in our s3. (You can actually try downloading the dicom file by opening the url in your browser).

{  "studies": [    // first study metadata    {      "StudyInstanceUID": "",      "StudyDate": "20000101",      "StudyTime": "",      "PatientName": "",      "PatientID": "LIDC-IDRI-0001",      "AccessionNumber": "",      "PatientAge": "",      "PatientSex": "",      "series": [        // first series metadata        {          "SeriesInstanceUID": "",          "SeriesNumber": 3000566,          "Modality": "CT",          "SliceThickness": 2.5,          "instances": [            // first instance metadata            {              "metadata": {                "Columns": 512,                "Rows": 512,                "InstanceNumber": 1,                "SOPClassUID": "1.2.840.10008.",                "PhotometricInterpretation": "MONOCHROME2",                "BitsAllocated": 16,                "BitsStored": 16,                "PixelRepresentation": 1,                "SamplesPerPixel": 1,                "PixelSpacing": [0.703125, 0.703125],                "HighBit": 15,                "ImageOrientationPatient": [1, 0, 0, 0, 1, 0],                "ImagePositionPatient": [-166, -171.699997, -10],                "FrameOfReferenceUID": "",                "ImageType": ["ORIGINAL", "PRIMARY", "AXIAL"],                "Modality": "CT",                "SOPInstanceUID": "",                "SeriesInstanceUID": "",                "StudyInstanceUID": "",                "WindowCenter": -600,                "WindowWidth": 1600,                "SeriesDate": "20000101"              },              "url": "dicomweb:"            },            // second instance metadata            {              "metadata": {                "Columns": 512,                "Rows": 512,                "InstanceNumber": 2,                "SOPClassUID": "1.2.840.10008.",                "PhotometricInterpretation": "MONOCHROME2",                "BitsAllocated": 16,                "BitsStored": 16,                "PixelRepresentation": 1,                "SamplesPerPixel": 1,                "PixelSpacing": [0.703125, 0.703125],                "HighBit": 15,                "ImageOrientationPatient": [1, 0, 0, 0, 1, 0],                "ImagePositionPatient": [-166, -171.699997, -12.5],                "FrameOfReferenceUID": "",                "ImageType": ["ORIGINAL", "PRIMARY", "AXIAL"],                "Modality": "CT",                "SOPInstanceUID": "",                "SeriesInstanceUID": "",                "StudyInstanceUID": "",                "WindowCenter": -600,                "WindowWidth": 1600,                "SeriesDate": "20000101"              },              "url": "dicomweb:"            }            // ..... other instances metadata          ]        }        // ... other series metadata      ],      "NumInstances": 133,      "Modalities": "CT"    }    // second study metadata  ]}

Local Demo#

You can run OHIF with a JSON data source against you local datasets (given that their JSON metadata is extracted).

First you need to put the JSON file and the folder containing the dicom files inside your public folder. Since files are served from your local server the url for the JSON file will be http://localhost:3000/LIDC-IDRI-0001.json and the dicom files will be dicomweb:http://localhost:3000/LIDC-IDRI-0001/01-01-2000-30178/3000566.000000-03192/1-001.dcm.

After yarn install and running yarn dev and opening the browser at http://localhost:3000/viewer/dicomjson?url=http://localhost:3000/LIDC-IDRI-0001.json will display the viewer.

Download JSON file from here

Sample DICOM files can be downloaded from TCIA or directly from here

Your public folder should look like this: