Answer DICOM questions
Each section below starts with a kind of question and shows the CLI command
that answers it. The MCP tool of the same name, with a dicom_ prefix, gives
the same answer. Examples were run against the 2026d edition.
Answers are markdown and end with a Source: line. Hints inside an answer are
written as MCP calls, such as dicom_module("General Series", detail="full");
on the command line, run the matching command (dicom-kb module "General Series" --full).
What does an object need?
Section titled “What does an object need?”Start from the IOD. iod takes an IOD name, or a SOP Class name, UID or
keyword, and lists its modules with their usage:
dicom-kb iod "CT Image"**CT Image IOD**SOP Class: CT Image Storage `1.2.840.10008.5.1.4.1.1.2`; CT Image Storage - For Processing `1.2.840.10008.5.1.4.1.1.2.3`
| IE | Module | Reference | Usage ||---|---|---|---|| Patient | Patient | C.7.1.1, Table C.7-1 | M || | Clinical Trial Subject | C.7.1.3, Table C.7-2b | U |...| | Contrast/Bolus | C.7.6.4, Table C.7-12 | C: Required if contrast media was used in this image |...Attributes of the M and C modules: dicom_iod("CT Image", expand=true); only the required ones: dicom_iod("CT Image", type="required"). One module: dicom_module("<module>").
Source: PS3.3 Table A.3-1 (2026d)For the attributes an instance must carry, ask for the required Types. This expands the M and C modules, keeps Types 1, 1C, 2 and 2C, and ends with what it left out:
dicom-kb iod "CT Image" --type required### Patient Module: M (C.7.1.1, Table C.7-1)
| Attribute | Tag | VR | VM | Type | Description ||---|---|---|---|---|---|| PatientName | (0010,0010) | PN | 1 | 2 | || PatientID | (0010,0020) | LO | 1 | 2 | |...Kept Type 1/1C/2/2C, in sequences of those Types. Not shown: 220 attributes of other Types. 952 Type 1/1C/2/2C attributes sit inside sequences of other Types: PerformedProtocolCodeSequence (70), ...That is 2 pages for CT Image. --expand without a Type gives every attribute
of the M and C modules (6 pages), --usage M,C,U adds the U modules, and
--module "General Series,Image Pixel" keeps only the modules you name.
To look at one module, start from its outline:
dicom-kb module "General Series"**General Series Module** (C.7.3.1, Table C.7-5a)
| Attribute | Tag | VR | VM | Type | Description ||---|---|---|---|---|---|| Modality | (0008,0060) | CS | 1 | 1 | Type of device, process or method that originally acquired or produced the data used to create the Instances in this Series. |...| PerformingPhysicianIdentificationSequence | (0008,1052) | SQ | 1 | 3 | Identification of the physician(s) administering the Series. || >Include Table 10-1 “Person Identification Macro Attributes” (25 attributes) |...7 macro includes not expanded; open one with dicom_module("<macro>"). Descriptions cut to their first sentence and condition. Everything: dicom_module("General Series", detail="full").
Source: PS3.3 Table C.7-5a (2026d)The outline lists the module’s own rows, each included macro as one line with
its size, and descriptions cut to their first sentence and condition. Open a
macro by name, add --type 1 to keep only Type 1 attributes, or add --full
for every macro expanded in place with full descriptions. A macro that
appears a second time in a full answer is marked “listed above”.
Where is an attribute used, and with what Type?
Section titled “Where is an attribute used, and with what Type?”dicom-kb element "Pixel Spacing"**(0028,0030) Pixel Spacing** `PixelSpacing` · VR DS · VM 2
| Used in | Reference | Type | Within ||---|---|---|---|| Image Plane Module | C.7.6.2, Table C.7-10 | 1 | || NM Image Pixel Module | C.8.4.7, Table C.8-6 | 2 | |...| Pixel Measures Macro | Table C.7.6.16-2 | 1C | PixelMeasuresSequence |
In 57 IODs. For its Type and conditions in one: dicom_element("PixelSpacing", iod="<IOD>").
Source: PS3.6 Table 6-1 (2026d)Tags ((0028,0030)), keywords (PixelSpacing) and names all work. Add
--iod for the attribute’s Type, condition, nesting and the module that brings
it into one IOD:
dicom-kb element Modality --iod "CT Image"What values may an attribute hold?
Section titled “What values may an attribute hold?”dicom-kb values "Patient's Sex"**(0010,0040) Patient's Sex** `PatientSex` · VR CS · VM 1
**Enumerated Values** in Patient Demographic Module, Performed Procedure Step Relationship Module, Patient Module, Unified Procedure Step Relationship Module
| Value | Meaning ||---|---|| M | male || F | female || O | other |
Source: PS3.6 Table 6-1 (2026d)Enumerated Values and Defined Terms are kept apart. When different modules
give different lists, each list names where it applies; --within keeps only
the lists for one IOD, module or macro.
For a code sequence, values names the context group each module gives it:
dicom-kb values "Anatomic Region Sequence" --within "CT Image"**Context groups** for its Code Sequence items:
| Where | Codes ||---|---|| CT Image Module | Anatomic Region Sequence DCID 4030 “CT, MR and PET Anatomy Imaged”. (via General Anatomy Optional Macro) || General Image Module | Anatomic Region Sequence BCID 4031 “Common Anatomic Region” for humans. ... |What codes, templates and concepts does PS3.16 define?
Section titled “What codes, templates and concepts does PS3.16 define?”code takes a context group, a template, a code value or a name:
dicom-kb code "CID 4031"dicom-kb code "TID 1500"dicom-kb code 121071A context group lists its codes with included groups expanded once. A template reads its section and table. A code gives its meaning, its PS3.16 Annex D definition and the groups that list it:
**(121071, DCM, "Finding")**Definition: An observation found on an imaging study.In CID 3419 Finding Title; CID 6053 Breast Imaging Report Element; CID 7002 Diagnostic Imaging Report Element; CID 9000 Physical Quantity Descriptor.
Source: PS3.16 Table D-1; PS3.16 CID 3419; PS3.16 CID 6053; PS3.16 CID 7002 (2026d)A name such as Finding returns every code with that meaning, from every
scheme. --scheme DCM narrows a code value that more than one scheme uses.
How is it encoded?
Section titled “How is it encoded?”read takes a transfer syntax UID or keyword and gives its encoding facts:
dicom-kb read 1.2.840.10008.1.2.4.90**1.2.840.10008.1.2.4.90** JPEG 2000 Image Compression (Lossless Only)`JPEG2000Lossless` · Transfer Syntax · PS3.5
| VR | Byte order | Pixel Data | Deflate ||---|---|---|---|| Explicit VR | Little Endian | Encapsulated | No |
Rules: PS3.5 Section A.4.4 JPEG 2000 Image CompressionAlso named in: PS3.5 Table 8.2.4-1
Source: PS3.6 Table A-1; PS3.5 Section A.4.4 (2026d)A VR code gives its PS3.5 definition and Explicit VR header layout:
dicom-kb read OBAny other UID (a SOP Class, a well-known instance) returns its PS3.6 registry
entry. For encoding rules beyond those facts, read the section:
dicom-kb read "PS3.5 7.5.2".
Where does the standard say something?
Section titled “Where does the standard say something?”When no structured command fits, search, then read what it finds:
dicom-kb search "basic offset table" --limit 4| Ref | Title | Context ||---|---|---|| PS3.3 Section C.7.6.3.1.8 | Extended Offset Table | …See also the example of the Basic Offset Table in PS3.5 Table A… || PS3.2 Table N.9-50 | Basic Directory IOD | Table N.9-50: Basic Directory IOD Attribute Name Tag Source Presence of Attribute… || PS3.3 Table C.7-11a | Image Pixel Module Attributes | …Unlike a Basic Offset Table, an Extended Offset Table, if the Attribute is present… || PS3.5 Section A.4 | Transfer Syntaxes for Encapsulation of Encoded Pixel Data | …The Basic Offset Table Item Value, however, is not required to be present: - When… |Pass a Ref to read:
dicom-kb read "PS3.5 Section A.4"read returns the node as markdown, with cross references kept as their
targets. A node that fits in one page comes with all its subsections; a larger
one ends with a list of its subsections to read next. --part PS3.5 limits a
search to one part.
If a section label exists in more than one part, read asks which one:
Section 7.5.2 is in several parts; name one, e.g. `PS3.3 Section 7.5.2`.