{"id":12628,"date":"2026-02-14T14:32:26","date_gmt":"2026-02-14T17:32:26","guid":{"rendered":"https:\/\/rtmedical.com.br\/dicom-objects-data-encoding\/"},"modified":"2026-02-14T19:29:53","modified_gmt":"2026-02-14T22:29:53","slug":"dicom-objects-data-encoding","status":"publish","type":"post","link":"https:\/\/rtmedical.com.br\/en\/dicom-objects-data-encoding\/","title":{"rendered":"DICOM Objects: Data Encoding and SQ Structure"},"content":{"rendered":"<h2>DICOM Objects and Data Encoding: What Every Professional Should Know<\/h2>\n<p>If you work with medical imaging, you&#8217;ve likely encountered situations where an exam simply &#8220;won&#8217;t open&#8221; or appears corrupted on another system. More often than not, the root cause lies in how DICOM data is encoded and structured internally. Understanding how DICOM objects work isn&#8217;t just technical curiosity \u2014 it&#8217;s the skill that separates the professional who solves problems from the one who merely reports them.<\/p>\n<p>In this article, we&#8217;ll dive deep into the anatomy of DICOM objects: how data elements are encoded, the difference between implicit and explicit encoding, how SQ sequences work, and the Patient-Study-Series-Image hierarchy. For a comprehensive overview of the DICOM standard, check out our <a href=\"https:\/\/rtmedical.com.br\/?p=12596\">complete practical guide to DICOM for medical imaging systems<\/a>.<\/p>\n<div class=\"toc\">\n<h2>In This Article<\/h2>\n<ul>\n<li><a href=\"#data-dictionary-commands\">1. Data Dictionary and DICOM Commands<\/a><\/li>\n<li><a href=\"#data-encoding\">2. Data Element Encoding<\/a><\/li>\n<li><a href=\"#sq-objects\">3. DICOM Objects and SQ Sequences<\/a><\/li>\n<li><a href=\"#hierarchy\">4. DICOM Information Hierarchy<\/a><\/li>\n<li><a href=\"#common-mistakes\">5. Common Mistakes and How to Avoid Them<\/a><\/li>\n<\/ul>\n<\/div>\n<h2 id=\"data-dictionary-commands\">Private Data Dictionary and DICOM Commands<\/h2>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"alignright lazyload\" data-src=\"https:\/\/rtmedical.com.br\/wp-content\/uploads\/2026\/02\/dicom-data-element-encoding-implicit-explicit.jpg\" alt=\"Comparison table of implicit and explicit DICOM data element encoding with binary examples\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 692px; --smush-placeholder-aspect-ratio: 692\/555;\"><figcaption>Implicit vs. explicit VR encoding in DICOM<\/figcaption><\/figure>\n<p>The DICOM Data Dictionary (PS3.6) maps every real-world attribute to a numeric tag in <strong>(Group, Element)<\/strong> format. But what happens when a manufacturer needs to store proprietary information that doesn&#8217;t exist in the standard dictionary?<\/p>\n<p>The answer lies in <strong>private groups<\/strong> \u2014 odd-numbered groups reserved exclusively for vendor-specific data. For instance, TeraRecon uses group <code>0077<\/code> in its Aquarius system to store attributes like <code>(0077,0010)<\/code> for original series UIDs and <code>(0077,0020)<\/code> for binary data names. Each manufacturer picks their own odd group, ensuring their proprietary data won&#8217;t conflict with the standard.<\/p>\n<p><strong>DICOM commands<\/strong> \u2014 such as Print, Store, Move, and Get \u2014 are encoded using the reserved <code>0000<\/code> group. Element <code>(0000,0100)<\/code> identifies the command type, while <code>(0000,0110)<\/code> stores the message ID. Unlike data elements, DICOM does <em>not<\/em> support proprietary command attributes, which limits protocol flexibility for modern scenarios like teleradiology.<\/p>\n<h3>Current Command System Limitations<\/h3>\n<p>The DICOM command set was designed for local PACS architectures that are becoming increasingly outdated. Modern digital imaging projects \u2014 teleradiology, cloud integration, AI-driven workflows \u2014 demand more flexible command structures. The inability to create proprietary command tags remains an active discussion within the DICOM community. For a deeper look at how commands work in practice, our article on <a href=\"https:\/\/rtmedical.com.br\/?p=12612\">DICOM fundamentals: objects and communications<\/a> explores DIMSE services in detail.<\/p>\n<h2 id=\"data-encoding\">Implicit vs. Explicit Encoding: How DICOM Writes Data<\/h2>\n<p>All information in DICOM is converted to byte sequences through two fundamental encoding methods: <strong>implicit<\/strong> and <strong>explicit<\/strong>. The choice between them directly affects how your systems interpret data.<\/p>\n<h3>Implicit Encoding (Implicit VR)<\/h3>\n<p>With implicit encoding \u2014 the DICOM default \u2014 each data element follows this structure:<\/p>\n<ul>\n<li><strong>Tag<\/strong>: 4 bytes (2 for Group + 2 for Element)<\/li>\n<li><strong>Value Length<\/strong>: 4 bytes (32-bit integer)<\/li>\n<li><strong>Value<\/strong>: $L$ bytes of data<\/li>\n<\/ul>\n<p>Consider the patient name &#8220;Smith^Joe&#8221;: element <code>(0010,0010)<\/code> is encoded in 18 bytes. The first 4 bytes represent the tag in Little Endian (<code>10 00 10 00<\/code>), the next 4 bytes indicate the length $L = 10$ (<code>0A 00 00 00<\/code>), and the final 10 bytes contain the string &#8220;Smith^Joe &#8221; with trailing space padding to maintain even length.<\/p>\n<div class=\"info-box note\">\n<strong>Technical Note:<\/strong> DICOM uses <em>Little Endian<\/em> by default, meaning multi-byte numbers are written starting from the lowest byte. So <code>0010<\/code> is written as <code>10 00<\/code> in the binary stream.\n<\/div>\n<h3>Explicit Encoding (Explicit VR)<\/h3>\n<p>Explicit encoding adds the VR type to each element, splitting into two variants:<\/p>\n<p><strong>For standard VRs<\/strong> (except OB, OW, OF, SQ, UT, UN): the 4-byte length field is replaced by 2 bytes of VR type + 2 bytes of length. For &#8220;Smith^Joe&#8221;, we&#8217;d see: <code>10 00 10 00 50 4E 0A 00 53 6D...<\/code> \u2014 where <code>50 4E<\/code> are the ASCII characters &#8220;PN&#8221; indicating Person Name.<\/p>\n<p><strong>For special VRs<\/strong> (OB, OW, OF, SQ, UT, UN): after the 2-byte VR, there are 2 reserved bytes (always <code>0000<\/code>) followed by 4 bytes for length. This variant accommodates elements with potentially very large data payloads, such as pixel buffers.<\/p>\n<h3>When Should You Use Each Method?<\/h3>\n<p>You cannot mix implicit and explicit encoding within the same DICOM object. This decision is negotiated between applications <em>before<\/em> any data exchange, through Transfer Syntaxes. In my experience, explicit encoding is preferable for interoperability because it carries type information alongside the data, reducing decoding errors \u2014 especially with proprietary attributes absent from the standard dictionary.<\/p>\n<h2 id=\"sq-objects\">DICOM Objects and SQ Sequences: Nested Structures<\/h2>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"alignleft lazyload\" data-src=\"https:\/\/rtmedical.com.br\/wp-content\/uploads\/2026\/02\/dicom-object-nesting-sq-encoding.jpg\" alt=\"SQ encoding diagram showing DICOM object nesting with data elements at multiple levels\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 692px; --smush-placeholder-aspect-ratio: 692\/705;\"><figcaption>DICOM object nesting structure with SQ sequences<\/figcaption><\/figure>\n<p>A <strong>DICOM object<\/strong> is essentially an ordered collection of data elements. Every medical image, command, or report is wrapped in this format. Elements within an object are organized in ascending tag order \u2014 this ordering isn&#8217;t just convention but a validation tool: if an element with a lower tag appears after one with a higher tag, the object is corrupted.<\/p>\n<p>The real complexity arises with the <strong>SQ (Sequence)<\/strong> VR type. SQ elements don&#8217;t hold simple data \u2014 they encapsulate sequences of other DICOM objects, creating a tree-like structure. Think of a book: chapters contain sections, which contain subsections. Similarly, a DICOM object can contain nested objects across multiple levels.<\/p>\n<h3>SQ Sequence Encoding<\/h3>\n<p>Each object within an SQ sequence is preceded by the delimitation tag <code>(FFFE,E000)<\/code>, followed by either:<\/p>\n<ul>\n<li><strong>Explicit length<\/strong>: a numeric value indicating how many bytes the object occupies<\/li>\n<li><strong>Undefined length<\/strong>: the value <code>FFFFFFFF<\/code>, where the end of the object is marked by tag <code>(FFFE,E00D)<\/code><\/li>\n<\/ul>\n<p>The entire SQ sequence can also have explicit or undefined length. In the latter case, the end is marked by <code>(FFFE,E0DD)<\/code>. This delimiter approach is analogous to XML opening and closing tags \u2014 and in practice, it&#8217;s more reliable than explicit length.<\/p>\n<div class=\"info-box tip\">\n<strong>Practical Tip:<\/strong> If you&#8217;re implementing DICOM software, prefer undefined-length delimiters when writing SQ sequences. They&#8217;re simpler to implement and less prone to calculation errors. However, your application <em>must<\/em> be able to read both formats, since other vendors may use explicit length.\n<\/div>\n<h3>Real-World Example: Referenced Series Sequence<\/h3>\n<p>A practical case of SQ nesting is the <code>(0008,1115)<\/code> attribute \u2014 Referenced Series Sequence. At level 0, we have the SQ; at level 1, the Series Instance UID <code>(0020,000E)<\/code> appears alongside another sequence <code>(0008,114A)<\/code>; and at level 2, we find the reference UIDs <code>(0008,1150)<\/code> and <code>(0008,1155)<\/code>. If you&#8217;re coding SQ encoding, implementing it with recursion comes naturally \u2014 just like any tree-based data structure.<\/p>\n<h2 id=\"hierarchy\">DICOM Information Hierarchy: Patient-Study-Series-Image<\/h2>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"alignright lazyload\" data-src=\"https:\/\/rtmedical.com.br\/wp-content\/uploads\/2026\/02\/dicom-information-hierarchy-patient-study.jpg\" alt=\"DICOM Patient-Study-Series-Image information hierarchy with unique identification UIDs\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 690px; --smush-placeholder-aspect-ratio: 690\/619;\"><figcaption>DICOM hierarchy: from patient to individual image<\/figcaption><\/figure>\n<p>DICOM organizes all information into four hierarchical levels that mirror the actual clinical workflow: <strong>Patient \u2192 Study \u2192 Series \u2192 Image<\/strong>.<\/p>\n<ul>\n<li><strong>Patient<\/strong>: identified by Patient ID <code>(0010,0020)<\/code><\/li>\n<li><strong>Study<\/strong>: identified by Study Instance UID <code>(0020,000D)<\/code><\/li>\n<li><strong>Series<\/strong>: identified by Series Instance UID <code>(0020,000E)<\/code><\/li>\n<li><strong>Image<\/strong>: identified by SOP Instance UID <code>(0008,0018)<\/code><\/li>\n<\/ul>\n<p>This hierarchy exists because in clinical practice, a patient may have multiple studies (CT, MRI, US), each study contains series with different protocols, and each series has one or more images. UIDs ensure each entity is globally unique \u2014 UI format with up to 64 characters made of digits and periods, such as <code>1.2.840.10008.1.2<\/code>.<\/p>\n<h3>Unique Identifiers (UIDs): Why Are They Global?<\/h3>\n<p>Picture an X-ray image being copied, annotated, and sent for teleradiology reading in another country. Now several instances of the same original image exist, each potentially modified. How do you tell them apart? Through distinct UIDs for each instance. A UID follows the structure <code>&lt;org root&gt;.&lt;suffix&gt;<\/code>, where the root identifies the organization and the suffix ensures uniqueness within that scope.<\/p>\n<h2 id=\"common-mistakes\">Common DICOM Structuring Mistakes and How to Avoid Them<\/h2>\n<p>After years of working with imaging system integration, certain problems keep surfacing with alarming frequency:<\/p>\n<p><strong>1. Inconsistent Patient IDs:<\/strong> Hospitals assigning different IDs to the same patient depending on the modality or image destination. I&#8217;ve seen cases where the ID &#8220;W\/I&#8221; (without ID) was assigned to every unregistered patient, effectively merging dozens of patients into a single PACS record. If no ID is available, using initials with birth date (e.g., <code>JS19670102<\/code>) is infinitely better than a generic placeholder.<\/p>\n<p><strong>2. Missing required elements:<\/strong> Film digitizers frequently wrap images in DICOM format without including all mandatory (Type 1) tags. A blank Patient ID can be interpreted as a wildcard, merging different patients in the archive. DICOM objects missing required elements are considered illegal by the standard.<\/p>\n<p><strong>3. Incorrect Group Length tags:<\/strong> Tag <code>(gggg,0000)<\/code> used to store the total length of a group. Although retired since 2008, many implementations still write it incorrectly. The result? Conservative DICOM software may reject the entire object. The current recommendation: don&#8217;t include it, but know how to read it when present.<\/p>\n<h2>When NOT to Parse DICOM Data Manually<\/h2>\n<p>There are scenarios where manually parsing DICOM objects creates more problems than it solves:<\/p>\n<ul>\n<li><strong>UIDs as data sources<\/strong>: Never extract information (dates, patient IDs) from UIDs. DICOM explicitly prohibits this \u2014 UIDs can be changed at any time<\/li>\n<li><strong>Implicit-to-explicit conversion with proprietary tags<\/strong>: If an odd-group attribute doesn&#8217;t exist in the standard dictionary, conversion to explicit VR may fail. Use the UN (Unknown) type in these cases<\/li>\n<li><strong>Multi-level SQ objects with explicit length<\/strong>: A 1-byte error in the length value makes all subsequent data unreadable. Prefer undefined-length delimiters<\/li>\n<\/ul>\n<p>Deep understanding of DICOM encoding is what enables you to diagnose interoperability issues that automated tools can&#8217;t resolve. To master the core concepts of the standard, be sure to read our <a href=\"https:\/\/rtmedical.com.br\/?p=12596\">complete guide to DICOM in clinical practice<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how DICOM objects encode data with implicit and explicit VR, nested SQ sequences, and the Patient-Study-Series-Image hierarchy.<\/p>\n","protected":false},"author":1,"featured_media":12617,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[16],"tags":[157,161,159,158,160],"class_list":{"0":"post-12628","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-uncategorized","8":"tag-dicom-2","9":"tag-digital-radiology-2","10":"tag-hl7-2","11":"tag-pacs-3","12":"tag-workflow-2"},"aioseo_notices":[],"rt_seo":{"title":"","description":"","canonical":"","og_image":"","robots":"default","schema_type":"default","include_in_llms":false,"llms_label":"","llms_summary":"","faq_items":[],"video":[],"gtin":"","mpn":"","brand":"","aggregate_rating":[]},"_links":{"self":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/12628\/"}],"collection":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/"}],"about":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/types\/post\/"}],"author":[{"embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/users\/1\/"}],"replies":[{"embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/comments\/?post=12628"}],"version-history":[{"count":0,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/12628\/revisions\/"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/media\/12617\/"}],"wp:attachment":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/media\/?parent=12628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/categories\/?post=12628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/tags\/?post=12628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}