Free tool · For websites

The DICOM viewer on your website

Paste a div with the study’s address and one script tag, and the free AI Web Center DICOM viewer appears on your page with the study open. Your page reads the file, so nothing changes on your server and files behind a login work. Leave the address out and visitors open or drop their own files, a folder or a ZIP, or open studies from their own PACS. Nothing is uploaded. It’s only a viewer, with no sample studies, and not a medical device.

Last updated

Two lines on your page

Paste these where the viewer should appear, with the address of a study on your site:

<div class="aiwc-dicom" data-file="/studies/ct-chest.zip"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>

That’s all. Your page reads the file and hands it to the viewer in the visitor’s browser, so nothing changes on your server, and files behind a login open for visitors who are signed in. Leave out data-file and visitors open or drop their own, or open a study from their PACS (data-pacs="off" hides that).

It’s only a viewer: no sample studies, no ads for other scans. What it shows is up to you.

Questions or help setting it up: support@aiwebcenter.com.

Live: the two lines above, with data-file set to a chest CT and its AI segmentation (77 structures). Choose 3D to turn it. Drop your own DICOM files on it to try them; they stay in your browser. Scan: NLST; segmentation: TotalSegmentator-CT-Segmentations (Thiriveedhi et al., NCI Imaging Data Commons); both CC BY 4.0.

Every option

Add any of these to the div.

OptionExampleWhat it does
data-file/studies/ct-chest.zipThe study: a ZIP of a series, one DICOM file, or several addresses separated by spaces
data-height900pxThe viewer’s height. Default 720px
data-themelightdark or light, to match your site
data-accent#2563ebYour color for the selected buttons. #rgb or #rrggbb
data-pacsoffHides Open from a PACS. On by default: visitors open studies from their own archive (Orthanc, dcm4chee or any DICOMweb PACS), with a user name and password or single sign-on (Keycloak, OpenID). The browser talks to the PACS directly; nothing passes through your site or ours
data-buttonsiconsWhat the buttons show: both (an icon and its word, the default), icons (the word becomes the tooltip) or text
data-button-styleoutlineflat (the default: no boxes), outline or solid. data-accent colors the button that is on
data-toolbarbarThree sets. compact (the default): one row; Window, Zoom and Measure each have their options under a small arrow, and each menu shows its keys. bar: every button in view. menus: the mouse tools, the image and the view each fold into a menu
data-hideangle,ellipse,saveButtons to leave out. Names: 2d 3d window pan zoom scroll measure angle ellipse presets zoom-out zoom-in fit actual invert rotate flip-h flip-v clear reset text hide-patient details save save-jpeg fullscreen play speed tags volume mip planes look upside-down layout cross
data-toolswindow,pan,zoom,measureOnly these buttons, from the same names
data-tagspopupWhere every DICOM tag shows: inline, under the viewer (the default), or popup, in a window beside the image behind a Tags button. Either way, Own window moves the tags to a browser window of their own, for a second screen

To open files your page already has in memory, call AiwcDicom.open(element, [{ name: "1.dcm", data: arrayBuffer }]).

Drag and drop

  • Anywhere on the viewerVisitors drop DICOM files, a whole folder (a CD’s DICOM folder, say) or a ZIP anywhere in the frame, and it opens.
  • Or open themOpen files and Open a folder do the same, for phones and for visitors who don’t drag.
  • Read in the browserDropped files are read in the visitor’s browser and never uploaded. Close and delete removes them; so does leaving the page.

Recipes

A teaching page with a case to scroll through

Students scroll, window and measure the series on the page, with nothing to install.

<div class="aiwc-dicom" data-file="/cases/case-12-ct.zip" data-height="860px"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>

A drop zone for visitors’ own files

Leave out data-file. Visitors open or drop their own files, a folder or a ZIP, and nothing is uploaded, to you or to us.

<div class="aiwc-dicom" data-theme="light" data-accent="#2563eb"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>

A small, quiet toolbar

Icons only, folded into menus, without the measuring tools: one row, even in a narrow column.

<div class="aiwc-dicom" data-buttons="icons" data-toolbar="menus" data-hide="angle,ellipse"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>

Studies from the visitor’s own PACS

For a clinic or vendor site: staff search their archive by patient, date or modality and open a series. The PACS has to allow https://aiwebcenter.com (CORS), because the viewer runs there, in the frame.

<div class="aiwc-dicom" data-height="860px"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>

A study your page already has

If your page holds the files in memory (from your own API, say), hand them over directly.

<div id="viewer"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>
<script>
  // files: [{ name: "1.dcm", data: arrayBuffer }, ...]
  AiwcDicom.open(document.getElementById("viewer"), files);
</script>

If something doesn’t work

  • “The study on this page could not be loaded”Your page couldn’t read the file. Check the address. If the file needs a login, the visitor has to be signed in. A file on another server needs that server to allow your site to read it (Access-Control-Allow-Origin with your site’s address).
  • Nothing shows, not even the frameYour site’s Content-Security-Policy may block it. Allow script-src and frame-src https://aiwebcenter.com.
  • A whole series is slow to loadPut the series in one ZIP rather than listing hundreds of files. Up to 1.5 GB opens.
  • “No image to show”The file opened, but it holds no image the viewer reads: a waveform such as an ECG, a presentation state, or a rare compression (progressive JPEG, video). Its tags still show. JPEG lossless, JPEG-LS, 12-bit JPEG and JPEG 2000 all open; reports and PDFs open as documents.
  • How do I delete a measurement?Click the line, angle or ellipse (tap it on a phone): it turns bold and a Delete button shows beside it. Click Delete, or press the Delete key. Clear measurements in the Image menu removes all of them from the image shown.
  • A report’s measurements don’t show on the imageOpen the report together with its images (their folder, or the image series from the PACS). Each shape goes on the image it names; one drawn on a series that isn’t open is listed as not on these images.
  • Open from a PACS: “did not answer”The PACS has to allow https://aiwebcenter.com (CORS), not your site: the viewer in the frame is on our address. A PACS on a local network address also needs the visitor’s permission: Chrome asks the first time.
  • Single sign-on: the window opens and nothing happensIn the sign-in client, the redirect URI has to be https://aiwebcenter.com/tools/dicom-viewer/ and Web origins https://aiwebcenter.com, the same as for our own page.
  • 3D is greyed out3D needs a CT or MRI series of at least 16 images of the same size, and a browser with WebGL2.
  • The viewer is crampedRaise data-height. On a wide frame the study details sit beside the image; on a narrow one, below it.

Still stuck? Email support@aiwebcenter.com with the page’s address and we’ll help.

What the viewer sends

  • The studyNever. Your page hands it to the viewer in the visitor’s browser, and it’s gone when the page closes. The same for files visitors open or drop.
  • Patient detailsNever. Names, IDs and dates in the tags are shown in the visitor’s browser only.
  • CookiesNone.

Not a medical device

Free, with a credit

The viewer is free and stays free. It shows a small AI Web Center strip with links to our site, and a credit link above it. Please leave both in place.

Frequently asked questions

Does it cost anything?

No. The viewer is free for any website. It shows a small AI Web Center strip with links to our site, a line above the image that says it's not a medical device, and a credit link above it.

Is the study uploaded to you?

No. Your page reads it and hands it to the viewer in the visitor's browser, where it's read. The same for files visitors open or drop. The viewer only counts that a study was opened, how many files it had and their modality and compression, with your site's name; never a file name or anything from the tags.

Which files open?

Uncompressed DICOM (implicit or explicit VR, little or big endian), deflated, RLE lossless, baseline and 12-bit JPEG, JPEG lossless, JPEG-LS, JPEG 2000 and HTJ2K, gray, color or palette color, single images and multi-frame clips: one file, a series or a ZIP. Segmentations, structured reports and PDFs stored as DICOM open too.

Can visitors drag and drop their own files?

Yes. They drop files, a whole folder such as a CD's DICOM folder, or a ZIP anywhere on the viewer, or use Open files and Open a folder. Nothing is uploaded.

Does it show your sample scans?

No. The embedded viewer is only a viewer. What it shows is up to your site: the study you name, the files your visitors open, or a study they open from their own PACS (data-pacs="off" hides that).

Can it be used for diagnosis?

No. It's a technology demonstration, not a medical device, and a line above the image always says so. Your site is responsible for the files it shows.

Sources

  1. DCMTK, the OFFIS DICOM Toolkit (official GitHub mirror). The tag dictionary and the decompression commands the viewer points to
  2. MDN: Window.postMessage(). How your page hands the study to the viewer
  3. MDN: Content-Security-Policy frame-ancestors. Why only the embedded viewer may be shown inside other sites