Skip to content

docs(dicom-json): clarify metadata requirements#6120

Open
driavysinus wants to merge 1 commit into
OHIF:masterfrom
driavysinus:docs/dicom-json-metadata-guidance
Open

docs(dicom-json): clarify metadata requirements#6120
driavysinus wants to merge 1 commit into
OHIF:masterfrom
driavysinus:docs/dicom-json-metadata-guidance

Conversation

@driavysinus

@driavysinus driavysinus commented Jul 5, 2026

Copy link
Copy Markdown

Context

Related to #3093.

The required metadata FAQ already documents the broad set of fields OHIF needs, but DICOM JSON users still have to decide which metadata to keep when reducing JSON payload size. This update clarifies the practical baseline metadata and modality-specific fields needed for display set creation, rendering, sorting, cine, ultrasound, PT SUV correction, SEG, RTSTRUCT, SR, PDF, and video handling.

Changes & Results

  • Reworked the required metadata FAQ into baseline image metadata, rendering metadata, modality/feature metadata, and DICOM JSON specific notes.
  • Clarified PlanarConfiguration for color/RGB images, NumberOfFrames for multi-frame objects, and zero-based frame query parameters.
  • Expanded PT SUV correction notes to include the required radiopharmaceutical sequence fields used by OHIF's PT metadata helper.
  • Added a short DICOM JSON guide note about metadata pruning and multi-frame frame URLs.
  • Updated both current docs and the version-3.11 docs copy.

Testing

  • git diff --check
  • corepack pnpm dlx prettier@3.6.2 --check platform/docs/docs/faq/technical.md platform/docs/docs/configuration/dataSources/dicom-json.md platform/docs/versioned_docs/version-3.11/faq/technical.md platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md
  • Verified the current and versioned FAQ copies match after the update.

Full docs build was not run because the monorepo dependencies were not installed locally.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: Windows 11
  • Node version: v24.14.0
  • Browser: Not run; docs-only change

Summary by CodeRabbit

  • Documentation
    • Clarified DICOM JSON metadata requirements for viewer display, rendering, sorting, and modality-specific tools.
    • Updated guidance on reducing payload size, multi-frame instances, zero-based frame access, and metadata consistency.
    • Reworked technical FAQ guidance into clearer structured tables and notes for required vs. optional metadata.

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit fe750a0
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6a49fc4862ac580008bc044d
😎 Deploy Preview https://deploy-preview-6120--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation-only update revising DICOM JSON data source pages and FAQ technical pages (both current and versioned-3.11 copies) to replace generic mandatory/optional metadata lists with structured tables covering baseline, rendering, and modality-specific metadata, plus new notes on multi-frame handling, UID consistency, and frame indexing.

Changes

DICOM JSON Metadata Requirements Documentation

Layer / File(s) Summary
Metadata-reduction and multi-frame guidance in dicom-json.md
platform/docs/docs/configuration/dataSources/dicom-json.md, platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md
Adds guidance to retain required OHIF tags when reducing metadata size, references the required-metadata list, notes the generator script adds SR CodeSequences, and expands multi-frame NumberOfFrames/zero-based frame parameter guidance.
Required metadata intro and baseline tables in technical.md
platform/docs/docs/faq/technical.md, platform/docs/versioned_docs/version-3.11/faq/technical.md
Replaces Mandatory/Optional tag lists with guidance that OHIF will not later fetch missing metadata, and adds a Baseline Image Metadata table for identity, pixel, geometry, and sorting tags.
Rendering and feature/modality metadata tables
platform/docs/docs/faq/technical.md, platform/docs/versioned_docs/version-3.11/faq/technical.md
Adds Rendering Metadata guidance (grayscale/color windowing) and a Feature and Modality Metadata table covering CT/MR/DX/CR/MG, multi-frame, ultrasound, PT SUV, SEG, RTSTRUCT, SR, PDF, and video requirements.
DICOM JSON specific notes and optional metadata
platform/docs/docs/faq/technical.md, platform/docs/versioned_docs/version-3.11/faq/technical.md
Adds a DICOM JSON Specific Notes subsection (URL placement, UID consistency, frame indexing, NumberOfFrames consistency) and revises the Optional Metadata description.

Estimated code review effort: 2 (Simple) | ~10 minutes

Related issues: None referenced.

Related PRs: None referenced.

Suggested labels: documentation

Suggested reviewers: None identified.

🐰 Poem

A rabbit reads the DICOM scroll,
Baseline tags now take their toll,
Frames start counting from a zero,
Tables sorted, docs the hero,
Hop along, the metadata's whole. 🐇📄

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, semantic-release compliant, and accurately summarizes the main documentation change.
Description check ✅ Passed The description matches the required template sections and includes completed context, changes, testing, and checklist details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@driavysinus driavysinus marked this pull request as ready for review July 5, 2026 06:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platform/docs/docs/configuration/dataSources/dicom-json.md`:
- Around line 45-46: The DICOM JSON docs wording is misleading because the
script does not create SR metadata; it only preserves existing SR-related fields
when they are already present in the source metadata. Update the copy in
dicom-json.md around the metadata guidance to say the script retains or carries
over CodeSequences for SR when available, rather than saying it will add them,
and keep the explanation aligned with the generator behavior.

In
`@platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md`:
- Around line 48-52: The DICOM JSON generator is emitting one-based frame URLs
while the docs specify that frame indexing must be zero-based. Update the logic
in the DICOM JSON generation path, especially the code that builds the
multi-frame URL in dicom-json-generator.js, so it uses frame values starting at
0 rather than 1. Keep the URL construction consistent wherever the frame query
parameter is generated, and verify any related frame loops or counters are
adjusted to match.
- Around line 45-46: The DICOM JSON documentation currently implies the script
generates SR metadata, but it should state that the script preserves and
forwards existing SR sequences from the source metadata instead. Update the
wording around the script description and the SR example to make it clear that
sequences such as ConceptNameCodeSequence are retained for display, not created
by the script.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 93a3c449-0635-4da1-9aaa-6d3febe1877d

📥 Commits

Reviewing files that changed from the base of the PR and between 2800f82 and fe750a0.

📒 Files selected for processing (4)
  • platform/docs/docs/configuration/dataSources/dicom-json.md
  • platform/docs/docs/faq/technical.md
  • platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md
  • platform/docs/versioned_docs/version-3.11/faq/technical.md

Comment on lines +45 to +46
Some modalities require additional metadata to be added to the JSON file. You can read more about the minimum and recommended metadata required for the viewer to work [here](../../faq/technical#what-are-the-list-of-required-metadata-for-the-ohif-viewer-to-work). We will handle this in the script. For example, the script will add the CodeSequences for SR in order to display the measurements in the viewer.
:::

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant documentation section and generator implementation.
git ls-files 'platform/docs/docs/configuration/dataSources/dicom-json.md' '.scripts/dicom-json-generator.js'

echo
echo '--- doc excerpt ---'
sed -n '35,60p' platform/docs/docs/configuration/dataSources/dicom-json.md

echo
echo '--- generator excerpt ---'
sed -n '160,300p' .scripts/dicom-json-generator.js

Repository: OHIF/Viewers

Length of output: 6312


Clarify that SR fields are retained, not synthesized platform/docs/docs/configuration/dataSources/dicom-json.md:45-46 — the generator only copies SR-related sequences when they already exist in the source metadata. Reword this to say the script preserves those fields when present, rather than “adding” them.

🧰 Tools
🪛 LanguageTool

[style] ~45-~45: Consider a more concise word here.
Context: ...cript will add the CodeSequences for SR in order to display the measurements in the viewer....

(IN_ORDER_TO_PREMIUM)

🪛 markdownlint-cli2 (0.22.1)

[warning] 45-45: Link text should be descriptive

(MD059, descriptive-link-text)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@platform/docs/docs/configuration/dataSources/dicom-json.md` around lines 45 -
46, The DICOM JSON docs wording is misleading because the script does not create
SR metadata; it only preserves existing SR-related fields when they are already
present in the source metadata. Update the copy in dicom-json.md around the
metadata guidance to say the script retains or carries over CodeSequences for SR
when available, rather than saying it will add them, and keep the explanation
aligned with the generator behavior.

Comment on lines +45 to +46
Some modalities require additional metadata to be added to the JSON file. You can read more about the minimum and recommended metadata required for the viewer to work [here](../../faq/technical#what-are-the-list-of-required-metadata-for-the-ohif-viewer-to-work). We will handle this in the script. For example, the script will add the CodeSequences for SR in order to display the measurements in the viewer.
:::

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the referenced files and inspect the relevant sections.
git ls-files 'platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md' \
             '.scripts/dicom-json-generator.js'

echo '--- DOC EXCERPT ---'
sed -n '35,60p' platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md

echo '--- GENERATOR OUTLINE ---'
ast-grep outline .scripts/dicom-json-generator.js --view expanded || true

echo '--- GENERATOR RELEVANT SECTION ---'
sed -n '150,310p' .scripts/dicom-json-generator.js

Repository: OHIF/Viewers

Length of output: 7611


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- SEARCH FOR CODESEQUENCE REFERENCES ---'
rg -n "CodeSequence|CodeSequences|SR" .scripts/dicom-json-generator.js platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md

echo '--- PROCESS INSTANCE SECTION ---'
sed -n '90,170p' .scripts/dicom-json-generator.js

Repository: OHIF/Viewers

Length of output: 3225


Clarify SR metadata is preserved, not generated
This script only forwards existing SR sequences (for example, ConceptNameCodeSequence) from the source metadata; it does not add them. Reword this as a retention requirement.

🧰 Tools
🪛 LanguageTool

[style] ~45-~45: Consider a more concise word here.
Context: ...cript will add the CodeSequences for SR in order to display the measurements in the viewer....

(IN_ORDER_TO_PREMIUM)

🪛 markdownlint-cli2 (0.22.1)

[warning] 45-45: Link text should be descriptive

(MD059, descriptive-link-text)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md`
around lines 45 - 46, The DICOM JSON documentation currently implies the script
generates SR metadata, but it should state that the script preserves and
forwards existing SR sequences from the source metadata instead. Update the
wording around the script description and the SR example to make it clear that
sequences such as ConceptNameCodeSequence are retained for display, not created
by the script.

Comment on lines +48 to +52
:::note
For multi-frame instances, include `NumberOfFrames` only when it matches the
source object and the image URLs you provide. If a URL points to a specific
frame, the `frame` query parameter is zero-based, so `frame=0` is the first
frame.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the documented note and the generator around the referenced lines.
printf '\n## docs snippet\n'
sed -n '40,60p' platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md

printf '\n## generator snippet\n'
sed -n '235,270p' .scripts/dicom-json-generator.js

printf '\n## search for frame usage\n'
rg -n "frame=|NumberOfFrames|zero-based|one-based|frame parameter" platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md .scripts/dicom-json-generator.js

Repository: OHIF/Viewers

Length of output: 3654


Make the frame index zero-based in the generator .scripts/dicom-json-generator.js:265 emits ?frame=${i} starting at 1, but the docs say frame=0 is the first frame. This shifts every multi-frame URL by one.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@platform/docs/versioned_docs/version-3.11/configuration/dataSources/dicom-json.md`
around lines 48 - 52, The DICOM JSON generator is emitting one-based frame URLs
while the docs specify that frame indexing must be zero-based. Update the logic
in the DICOM JSON generation path, especially the code that builds the
multi-frame URL in dicom-json-generator.js, so it uses frame values starting at
0 rather than 1. Keep the URL construction consistent wherever the frame query
parameter is generated, and verify any related frame loops or counters are
adjusted to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant