Serve wado data for cornerstone3D core samples

What wadors service do I need to serve my own data for cornerstone3D core samples?

  • I am not using OHIF yet, just using cornerstone3D.
  • I can run some of the example code (for example, the StackAPI example) from my local node.js server. But the image data is still grabbed from a remote wadoRsRoot: ‘OHIF Viewer’. I have tried to change it to use my local wadoRs server, which is written in Python/Flask. I implemented two REST APIs:
    def dicomweb_series_metadata(study, series):

    def dicomweb_frame_request(study, series, instance, frame):

After I changed the content in the function createImageIdsAndCacheMetaData to my new content:
const imageIds = await createImageIdsAndCacheMetaData({
wadoRsRoot: ‘http://localhost:3000/dicomweb’,

I got nothing (no images) in the web browser (StackAPI example). I don’t see any errors on the Browser’s development tool page.

Here is the code details of my 2nd wadoRs service:

def dicomweb_frame_request(study, series, instance, frame):

# Construct the path to the DICOM file
dicom_path = f"{DICOM_SERIES_DIR}/{instance}.dcm"
temp_jls_frame_path = '/workspaces/SyntheticMRI/temp_jls_frame.dcm'

    ret = changeToJpeg_JLS_format(dicom_path, temp_jls_frame_path)
    if ret > 0:
    # Read the compressed tmp jls DICOM file using pydicom
    ds = pydicom.dcmread(temp_jls_frame_path)
    # Create a BytesIO object for the multipart response
    output = io.BytesIO()
    # Add a boundary between metadata and pixel data
    output.write(b'Content-Type: image/jls;transfer-syntax=1.2.840.10008.\r\n\r\n')

    # Write JLS image data:

    # Add closing boundary

    # Send the DICOM frame data as a multipart response
    return send_file(output, mimetype='multipart/related; type=image/jpeg-ls; boundary=boundary', as_attachment=True, download_name="test.mht")

Could anyone please analyze the reason for me - why cannot I see images loaded in the viewer in browsers? What’s wrong with my REST api function?