Skip to Content
go-dicom(3)
Command line

tag-doc

Looks up a tag in the built-in DICOM data dictionary, by keyword or by tag, and prints its name, keyword, VR, VM and status; or lists the dictionary.

When to use it

Use tag-doc when you have a tag number and want its name, or a keyword and want its tag and VR, without opening PS3.6. It works offline from the dictionary compiled into the binary, the same one every other command uses.

It knows the standard dictionary and its repeater groups. It does not know vendors' private tags, and it does not say which modules use a tag (see validate for module rules).

The closest tools are dcmtk's dicom.dic file and pydicom's pydicom.datadict.dictionary_description and friends.

Examples

By keyword

go-dicom tag-doc --keyword PatientName
DICOM Tag Documentation
==================================================

Tag:      (0010,0010) (00100010)
Name:     Patient's Name
Keyword:  PatientName
VR:       PN
VM:       1
Status:   ACTIVE
Type:     STANDARD

Description:
--------------------------------------------------
VR: PN - Person Name
VM: 1 - Value Multiplicity

By tag

go-dicom tag-doc 0010,0010

The tag is given as an argument, and prints the same entry.

As JSON or Markdown

go-dicom tag-doc --keyword PatientName --format json
{
  "tag": "(0010,0010)",
  "hex": "00100010",
  "name": "Patient's Name",
  "keyword": "PatientName",
  "vr": "PN",
  "vm": "1",
  "retired": false,
  "type": "Standard"
}

--format markdown prints the entry as a Markdown heading and table.

List the dictionary

go-dicom tag-doc
DICOM Tag Dictionary
==============================================================================

Tag           Name                               VR   VM     Status
------------------------------------------------------------------------------
(0000,0000)   Command Group Length               UL   1      Active
(0000,0002)   Affected SOP Class UID             UI   1      Active
…
------------------------------------------------------------------------------
shown 50 of 4844 matching; dictionary holds 5261 standard tags (417 retired) and 88 repeater patterns
use -limit 0 for all of them, or -output <file> to write them out

Retired tags are left out unless --retired is given.

The whole dictionary, to a file

go-dicom tag-doc --limit 0 --format json --output tags.json
wrote 4844 tags to tags.json

Notes

  • A keyword that is not in the dictionary is an error, exit status 1: Error: tag-doc: keyword not found: Nope.
  • A tag with more than one possible VR prints them all, as OB or OW for Pixel Data.
  • --private includes private tags in a listing; the built-in dictionary holds standard tags, so the listing does not change.

See also

Options

COMMAND: tag-doc - Generate tag documentation

USAGE:
  go-dicom tag-doc [options]

DESCRIPTION:
  Generate documentation for DICOM tags using the built-in 5,182-tag dictionary.
  Look up tag information by keyword or list all tags.

OPTIONS:
  -h, --help             Show help for this command
  --keyword <name>       Tag keyword to look up (e.g., PatientName)
  --format <format>      Output format: text, markdown, json (default: text)
  --retired              Include retired tags
  --private              Include private tags

EXAMPLES:
  go-dicom tag-doc --keyword PatientName
  go-dicom tag-doc --keyword PatientName --format markdown
  go-dicom tag-doc --keyword PatientName --format json
  go-dicom tag-doc
  go-dicom tag-doc -h

On this page