One DICOM viewer, on any website
We made our free DICOM viewer embeddable in other websites. A site adds a div and a script; its own page reads the study and hands it to the viewer in the visitor’s browser, so files behind a login work and nothing is uploaded. The embed is the same viewer as our own page, but only a viewer, with no sample scans. Visitors can drop files, folders or ZIPs anywhere on it. A line above the image always says it isn’t a medical device or for diagnosis. Daily counts show how many studies and files it reads, with no file names, tag values or IP addresses.

The problem
Our free DICOM viewer opens CT, MRI, ultrasound and X-ray files in the browser, in 2D and 3D, without uploading them. Clinics, imaging centers and teaching sites have the same need on their own pages: show a study to a patient, a student or a referring office without sending them a download and a program to find.
Four things had to hold:
- No upload, anywhere. Medical files carry names, IDs and dates.
- Nothing to change on the site’s server.
- The site decides what’s shown. No sample scans of ours next to theirs.
- We learn how much it’s used, without learning anything about patients.
What a site does
<div class="aiwc-dicom" data-file="/studies/ct-chest.zip"></div>
<script src="https://aiwebcenter.com/embed/dicom-viewer.js" async></script>
| Result | How |
|---|---|
| No server changes | The site’s own page reads the study and hands it over |
| Studies behind a login open | The page reads them as the visitor who’s signed in |
| Nothing uploaded | The study goes from the site to the visitor’s browser and is read there |
| Visitors’ own files | Without data-file, they open or drop files, a folder or a ZIP |
| Only a viewer | No samples; what it shows is up to the site and its visitors |
| Fits the site | data-theme, data-accent, data-height, and data-tags="popup" for the tags in a window beside the image |
| Studies from a PACS | Open from a PACS, with a password or single sign-on, as on our own page; data-pacs="off" hides it |
| AI segmentations | DICOM SEG files, from a person or a model like TotalSegmentator, in color on the scan and in 3D, in every embed |
| Four linked views | The slice, sagittal and coronal cuts and 3D side by side, pointing at one spot, in every embed |
| Reports on the scan | Measurement reports (DICOM SR, TID 1500) drawn on the images they name, key images to step through |
| Tags on a second screen | Own window moves them to a browser window of their own |
| Clear limits | Always above the image: “Not a medical device”, a link to the full disclaimer |
The decisions
One core, three homes
The viewer is one React component. Our tool page shows it with sample studies, our imaging center example shows it in a patient portal, and the embed page shows it with an embed flag. The flag changes four things: no samples, an empty start, drops anywhere in the frame, and where the counts say it ran. Every fix reaches all three.
The strip above the embedded viewer, with our name and a few rolling links, is the same component as the embedded board viewer’s, with its own messages.
The host page does the reading
The viewer runs in a frame from our site. If it fetched the site’s files itself, every site would need a header allowing it, and files behind a login wouldn’t open. So the small script on the site’s page fetches the study with the visitor’s own sign-in and transfers the bytes into the frame with postMessage. The frame accepts messages only from the page directly around it, and the script sends only to our origin. The bytes are transferred, not copied, so a large series doesn’t sit in memory twice.
Only one page may be framed
Every page of our site refuses to be shown in another site’s frame (frame-ancestors 'none' and X-Frame-Options: DENY). The nginx config makes one exception per viewer: the board viewer’s embed page and now the DICOM viewer’s. The page around the frame can’t read inside it either; that’s a different origin.
Empty, not a sample
The tool page opens on a sample CT. The embed opens on nothing: an empty viewer that says “Open DICOM files, a folder or a ZIP above, or drop them here”. When the site names a study, it says it’s opening it instead, so a visitor never sees a scan the site didn’t choose, not even for a second.
Drops anywhere in the frame
A dropped file that misses a drop target makes the browser open the file itself, replacing the viewer. In someone else’s page that’s an easy miss, so the embedded viewer listens on its whole window. The image’s own handler goes first; the window takes only drops that fell elsewhere, and only drags that carry files. Folders are walked with readEntries until it returns an empty batch, ZIPs are inflated in the tab, and the series with the most images opens. The details are in Drag and drop a DICOM folder into a web page.
A reading room inside a frame
Because the embed is the same viewer, every embed got the four linked views the day our page did: the slice, a sagittal and a coronal cut, and 3D, all pointing at one spot. A click in any view moves the other three. The cuts are read from the original images at full resolution, lengths can be measured on them, and a double-click shows any view big. A small frame stacks them, the slice first. Measurement reports open with their images, their lengths and outlines drawn on the scan. The four views · how they stay linked · reports on the scan.
The limits, always in view
The viewer is a technology demonstration, not a medical device. That has to be on screen whenever a scan is, not in a footnote a visitor scrolls past. So one line sits right above the image, on our page, in the imaging example and in every embed: Not a medical device. That link opens a popup with the rest: not for diagnosis, no medical advice, provided as is, our responsibility excluded, the visitor responsible for their own files, and the embedding site for the studies it shows. The popup’s text is in the page’s HTML from the start, closed, so it’s part of the page itself, not something fetched later.
The tags beside the image, and on a second screen
Every DICOM tag sits in a table under the viewer. Inside a small frame that table is out of sight, so data-tags="popup" puts it behind a Tags button. The first version was a modal dialog, and it had two faults Jan spotted at once: it couldn’t be moved, and it switched the viewer off while open. Now it’s an ordinary window inside the frame: it opens on the right half, beside the image, is dragged by its title bar and resized from its corner, can’t be dragged out of reach, and leaves the viewer fully usable.
Own window puts the tags in a browser window of their own, as the board viewer does with its schematic. A BroadcastChannel, the usual way for two windows of one site to talk, fails inside another website: browsers keep a framed page’s storage and channels apart from the same site opened on its own. So the viewer hands the tags to the window it opened, by that window’s handle, with postMessage, and each side accepts messages only from the other. The board viewer’s schematic window now works the same way inside other websites. The window follows the viewer to the next study, is cleared by Close and delete, and closes itself when the viewer’s page closes or reloads, or, as a backstop, notices that the viewer is gone. The tags never leave the browser.
Counts, never patients
To know how many files the viewer actually reads, each opened study sends one count: what happened, where, how, the modality, the transfer syntax UID, the number of files and megabytes, and the embedding site’s name. Never a file name or a tag’s value. The server checks each field against a short list, refuses anything else, and adds it to a daily total. The admin shows studies and files by place, how they were opened, which compressions showed no image, and which websites use it. The whole design.
How it was checked
- Two local servers on different ports, one playing a clinic’s site and one ours, so the browser treated them as separate sites. In headless Chromium, on November 13, 2026:
- A study named by the site’s page opened, with no sample studies shown.
- The site’s page couldn’t read inside the frame.
- The strip rolled, and its links carried their tag.
- The Disclaimers popup opened and closed.
- A file dropped on the notice above the image, outside the usual drop targets, opened.
- The counts sent were exactly the fields above.
- The tag window opened beside the image, moved and stayed inside the frame, while Invert and window/level still worked on the image.
- Own window, from inside the embed, received all 116 tags of the test CT, was cleared by Close and delete, and closed when the site’s page was closed or reloaded.
- The tool page still showed its samples and the disclaimer line.
- The four views, on November 16, 2026, at desktop and phone size: a click on the sagittal cut and in the 3D view each moved the slice, a length drawn on a cut read its true size in mm and was deleted with the Delete key, and a double-click showed a view big and back. Tests check the 3D click on a made-up CT with known values.
- The first build had a hydration error: the popup’s list sat inside a paragraph, which HTML doesn’t allow, so the browser’s page and React’s didn’t match. It was found in that testing and fixed before release.
- The server’s field checks have their own unit tests, including a patient’s name sent as a modality, which is refused.
What it means for your product
Medical and financial software has to be useful to people outside the building without letting the data out. The same patterns work in any product: let the partner’s page do the reading, frame one page and nothing else, start empty, and count use without collecting people. If that’s on your table, the first 30-minute call is free.
Try it: the viewer · the guide for websites · for site owners · counting without tracking patients · drag and drop a folder · AI segmentations in 2D and 3D · four linked views