Plugin Page

DICOM — WP Medical Image Viewer

View Plugin

Gutenberg Block

The DICOM Viewer Gutenberg block is the recommended way to add medical image viewers to your pages and posts.


Inserting the Block

  1. Edit or create a post or page in the WordPress block editor.
  2. Click the + button to add a new block.
  3. Search for DICOM Viewer or scroll to find it.
  4. Click the DICOM Viewer block to insert it.

The block is inserted into your page as a placeholder. The actual viewer renders on the frontend.


Selecting a File

  1. With the block inserted, click Select DICOM File in the block placeholder.
  2. A media picker dialog opens — select a .dcm file or .zip archive from your media library.
  3. If the file isn’t in your library yet, click Upload Files to add it.
  4. Once selected, the block shows an interactive preview in the editor.

Block Settings Panel

When the block is selected, the right sidebar shows these setting groups:

GroupPurpose
SettingsFile URL, sizing, info/download visibility, front-end controls, and anonymization
Default ViewCaptured viewport defaults such as series, slice, zoom, pan, and window/level
Grid LayoutLayout mode, columns, auto-grid threshold, reference lines, and selector toggles

All settings are optional — unset values inherit the global defaults from DICOM Viewer. The editor preview stays interactive, and the current viewport is captured automatically when you save or update the post.


Alignment

The block supports the wide and full alignment options (available via the alignment control in the block toolbar).


Block Settings

This page documents all attributes available in the DICOM Viewer Gutenberg block (dicom-viewer/viewer).


File Selection

AttributeTypeDefaultDescription
attachmentIdnumber0WordPress media library attachment ID of the DICOM file or ZIP
fileUrlstring""Direct URL to a DICOM file (used when attachment ID is not set)

Note: Provide either attachmentId or fileUrl, not both. attachmentId is preferred because it integrates with WordPress’s media library and permissions.


Display Settings

AttributeTypeDefaultDescription
heightstring""CSS height of the viewer (e.g., 480px, 60vh). Empty = use global default from settings
widthstring""CSS width or max-width of the viewer wrapper (e.g., 100%, 960px). Empty = use the default full width

Viewer Controls

AttributeTypeDefaultDescription
showInfostring""Show the Info button: "yes", "no", or "" (inherit global). Warning: Info overlay may display PHI.
showDownloadstring""Show or hide the download link: "yes", "no", or "" (inherit global)
showPanControlstring""Show or hide the Pan tool on the front end
showZoomControlstring""Show or hide the Zoom tool and zoom buttons on the front end
showWLControlstring""Show or hide the window/level controls on the front end
showNavButtonsstring""Show or hide the next / previous slice buttons on the front end
showSliderstring""Show or hide the slice slider on the front end

Note: Boolean attributes use string values ("yes" / "no") rather than true/false because an empty string is needed to represent "inherit global default".


Anonymization

AttributeTypeDefaultDescription
anonLevelstring""Tag redaction level: off, basic, standard, strict, or "" (inherit global default)

See Anonymization Settings for details on each level.


Layout & Grid

AttributeTypeDefaultDescription
layoutstring""Layout mode: auto, single, grid, or "" (inherit global default)
gridColsnumber0Grid columns (1–4). 0 = use global default. Only applies when layout is grid.
gridMinSeriesnumber0Series threshold for auto-grid activation (0 = use global default). Only applies when layout is auto.
refLinesstring""Show reference lines in grid: "yes", "no", or "" (inherit global default)
showSeriesSelectorstring""Show or hide the series selector UI on the front end
showPaneSelectorstring""Show or hide the pane count selector in grid mode

See Grid Layout for details.

Older saved content may still contain a seriesDisplay attribute. In current versions this is only kept for legacy compatibility, mainly for none to hide the selector on older embeds.


Single-Pane Viewport Defaults

These attributes preset the viewer’s zoom, pan, and window/level when the page loads. They only apply to the single-pane view (not grid layout).

AttributeTypeDefaultDescription
defaultSeriesnumber0Zero-based series index to display on load
defaultSlidenumber0Zero-based slice index within the series
defaultZoomnumber0Zoom factor (1.0 = 100%, 2.0 = 200%, etc.)
defaultPanXnumber0Horizontal pan offset in pixels
defaultPanYnumber0Vertical pan offset in pixels
defaultWCnumber0Starting window center
defaultWWnumber0Starting window width

Multi-Pane Viewport Defaults

These attributes preset the state of each pane in grid layout. Values are comma-separated (one per pane).

AttributeTypeDefaultDescription
defaultPanesnumber0Number of grid panes to open initially
defaultSlidesstring""Comma-separated slice indices (e.g., 0,5,10 for three panes)
defaultZoomsstring""Comma-separated zoom factors
defaultPanXsstring""Comma-separated horizontal pan offsets
defaultPanYsstring""Comma-separated vertical pan offsets
defaultWCsstring""Comma-separated window center values
defaultWWsstring""Comma-separated window width values
defaultPaneSeriesstring""Comma-separated series indices for each pane

Example: To open 3 panes showing slices 0, 5, and 10 with zoom 1.5x each:

defaultPanes: 3
defaultSlides: "0,5,10"
defaultZooms: "1.5,1.5,1.5"
defaultPanXs: "0,0,0"
defaultPanYs: "0,0,0"
defaultWCs: "40,40,40"
defaultWWs: "400,400,400"

Block Supports

  • Alignment: wide and full are supported
  • HTML: HTML editing is disabled for this block

Inheritance & Defaults

All unset (empty string or 0) attributes inherit from the global settings under DICOM Viewer. This makes it easy to set site-wide defaults and override only on specific blocks where needed.

To check what the global defaults are, visit the appropriate Admin Settings tab.