Open DICOM data in VS Code or Cursor
Open local DICOM files and folders in a VS Code or Cursor webview backed by the same loopback dcmview server.
Install the extension
Section titled “Install the extension”Install dcmview by publisher beatricebm from the VS Code Marketplace. Cursor users can install the same extension identifier from Open VSX. v0.2.12 bundles viewer binaries for Linux x64, macOS x64, macOS arm64, and Windows x64.
On another host platform, build or install a compatible binary and set dcmview.binaryPath to its absolute path.
Open a file or folder
Section titled “Open a file or folder”In Explorer, right-click a DICOM file or directory and choose Open with dcmview. The extension starts dcmview --no-browser --port 0 on loopback and opens the viewer beside the current editor.
For files ending in .dcm, .dicom, or .ima, you can also use Reopen With… → dcmview. Set dcmview as the default editor for those patterns if desired. Use the Explorer context menu for extensionless DICOM files and directories.
Other commands in the Command Palette:
- dcmview: Open Workspace with dcmview opens a selected workspace folder.
- dcmview: Stop All dcmview Sessions stops extension-managed viewers.
- dcmview: Show Bridge Status reports the active terminal bridge.
Use terminal interception
Section titled “Use terminal interception”New integrated terminals route dcmview, dcmview-py, and python -m dcmview_py launches into VS Code webviews when dcmview.terminalInterception.enabled is true. Existing terminals are not retrofitted when the extension activates.
Bypass the bridge for one shell session:
export DCMVIEW_VSCODE_BYPASS=1dcmview ./studyThe CLI and Python wrapper also fall back to an ordinary local viewer if the workspace bridge cannot be reached. If VS Code captured a session but later lost its bridge while a blocking caller was waiting, the wrapper reports that failure instead of launching a duplicate viewer.
Adjust settings
Section titled “Adjust settings”| Setting | Default | Purpose |
|---|---|---|
dcmview.binaryPath |
"" |
Absolute viewer binary override. |
dcmview.defaultRecursive |
true |
Recursively scan selected folders. |
dcmview.extraArgs |
[] |
Extra CLI arguments placed before selected paths. |
dcmview.startupTimeoutSeconds |
20 |
Time allowed for the server to report its URL. |
dcmview.terminalInterception.enabled |
true |
Route supported integrated-terminal launches into webviews. |
Use CLI argument/value pairs as separate dcmview.extraArgs elements. Do not put selected paths there; the extension appends them.
For binary order and bridge variables, see the VS Code reference. For startup failures, see troubleshooting.