{"id":12668,"date":"2026-02-14T15:04:24","date_gmt":"2026-02-14T18:04:24","guid":{"rendered":"https:\/\/rtmedical.com.br\/dicom-files-dicomdir-media\/"},"modified":"2026-03-28T12:29:44","modified_gmt":"2026-03-28T15:29:44","slug":"dicom-files-dicomdir-media","status":"publish","type":"post","link":"https:\/\/rtmedical.com.br\/en\/dicom-files-dicomdir-media\/","title":{"rendered":"DICOM Files and DICOMDIR: Structure, Media and Security"},"content":{"rendered":"<h2>What are DICOM files and why does their structure matter?<\/h2>\n<p>DICOM files are the backbone of medical image data exchange outside of network environments. Whether we&#8217;re talking about patient CDs, USB drives with exams, or email attachments with radiological images, we&#8217;re dealing with DICOM files &mdash; and understanding their internal anatomy is essential for anyone working with imaging system integration.<\/p>\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-file-binary-header-structure.jpg\" alt=\"Hex dump of a DICOM file showing the 128-byte preamble, DICM prefix, and group 0002 file meta information elements\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 688px; --smush-placeholder-aspect-ratio: 688\/542;\"><figcaption>Binary view of a DICOM file with DICM prefix and header attributes<\/figcaption><\/figure>\n<p>In daily practice, most professionals interact with these files without giving a second thought to what happens under the hood. But if you&#8217;ve ever had to deal with a patient CD that &ldquo;won&#8217;t open&rdquo; on another system, or tried to import data that simply wasn&#8217;t recognized by the receiving PACS, the problem likely lay in the file structure. For a complete overview of the DICOM ecosystem, check our <a href=\"https:\/\/rtmedical.com.br\/?p=12596\">comprehensive guide to DICOM in clinical practice<\/a>.<\/p>\n<h2>Anatomy of a DICOM file: from preamble to data object<\/h2>\n<p>Every DICOM file follows a rigorously defined structure specified in parts PS3.10, PS3.11, and PS3.12 of the standard. This structure consists of four sequential sections, and understanding each one saves a lot of headaches.<\/p>\n<h3>Preamble and DICM prefix<\/h3>\n<p>The first 128 bytes of any DICOM file constitute the <strong>preamble<\/strong>. The DICOM standard doesn&#8217;t define specific content for this area &mdash; each application can use it as it sees fit. In practice, most software simply fills these 128 bytes with zeros. Right after that, in bytes 129 through 132, we find the four uppercase letters <strong>D I C M<\/strong>: the prefix that unambiguously identifies a DICOM file.<\/p>\n<p>This is, in fact, the only truly reliable method for identifying whether a file is DICOM or not. Forget about the &ldquo;.dcm&rdquo; extension &mdash; it&#8217;s merely a convention, and the standard itself oscillates between prohibiting and requiring it in different contexts. If you&#8217;re writing software to identify DICOM files, skip the first 128 bytes and verify the DICM prefix. Period.<\/p>\n<h3>Group 0002: file meta information<\/h3>\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-validation-tool-attribute-check.jpg\" alt=\"DICOM Validation Tool showing attribute verification of the General Study Module with Type 2 errors\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 691px; --smush-placeholder-aspect-ratio: 691\/606;\"><figcaption>DICOM validation tool checking mandatory header attributes<\/figcaption><\/figure>\n<p>Starting at byte 133, we find the <strong>File Meta Information<\/strong> &mdash; a set of DICOM attributes belonging to group 0002. These elements are always encoded with explicit VR, regardless of how the actual data object is encoded. Among the most important attributes are:<\/p>\n<ul>\n<li><strong>Media Storage SOP Class UID<\/strong> (0002,0002): identifies the type of stored object (CT, MR, US, etc.)<\/li>\n<li><strong>Media Storage SOP Instance UID<\/strong> (0002,0003): unique instance identifier<\/li>\n<li><strong>Transfer Syntax UID<\/strong> (0002,0010): defines how the data object is encoded &mdash; arguably the most critical attribute in the entire group<\/li>\n<li><strong>Implementation Class UID<\/strong> (0002,0012): identifies the implementation that created the file<\/li>\n<\/ul>\n<p>In my experience, the Transfer Syntax UID is where many interoperability problems begin. In DICOM network communication, the Transfer Syntax is negotiated during association establishment. In files, it&#8217;s recorded in the header &mdash; and if the receiving software doesn&#8217;t interpret it correctly, it simply can&#8217;t decode the images.<\/p>\n<h3>The data object<\/h3>\n<p>After group 0002, we find the actual DICOM object &mdash; the same data structures used in network communication. Group numbering starts at 0008, making it easy to identify where meta information ends and clinical data begins. As discussed in our post about <a href=\"https:\/\/rtmedical.com.br\/?p=12628\">DICOM objects and data encoding<\/a>, VR encoding defines how each attribute is interpreted.<\/p>\n<p>A critical consideration: group 0002 <em>always<\/em> uses explicit VR, but the data object may use implicit VR, depending on the Transfer Syntax indicated in field (0002,0010). Software that doesn&#8217;t make this switch during reading will fail. For this reason, the DICOM standard recommends explicit VR throughout the entire file &mdash; even though DICOM&#8217;s default Transfer Syntax is Implicit Little Endian.<\/p>\n<h2>DICOMDIR: the index that organizes (and complicates) everything<\/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-ultrasound-image-measurements.jpg\" alt=\"DICOM ultrasound image of abdomen with distance measurements showing patient data and equipment parameters\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 689px; --smush-placeholder-aspect-ratio: 689\/516;\"><figcaption>DICOM ultrasound image stored as a file on removable media<\/figcaption><\/figure>\n<p>The DICOMDIR is a special DICOM file that functions as an index &mdash; a miniature database listing all DICOM files present in a given directory. It organizes information into four hierarchical levels: <strong>Patient &rarr; Study &rarr; Series &rarr; Image<\/strong>.<\/p>\n<p>When you insert a DICOM CD into a PACS workstation, the software typically reads the DICOMDIR first to present the list of patients, studies, and series contained on the media. Patient names, study dates, modalities &mdash; all extracted from the selection keys stored in the DICOMDIR.<\/p>\n<p>Internally, the DICOMDIR uses an SQ sequence (0004,1220) that contains all directory records. Each entry holds two types of data: selection keys for searching (such as modality and patient name) and Basic Directory Information Object entries (group 0004), which store file IDs and relationships between records.<\/p>\n<h3>Practical problems with DICOMDIR<\/h3>\n<p>In practice, DICOMDIRs present significant limitations. There are at least three concrete reasons to be skeptical:<\/p>\n<p><strong>1. Questionable utility.<\/strong> Any well-designed DICOM program should scan all files in a given folder, identifying those in DICOM format. Even a full DVD can be scanned fairly quickly. For PACS import or viewing &mdash; the two most common use cases &mdash; DICOMDIR adds negligible efficiency.<\/p>\n<p><strong>2. Fragility.<\/strong> When we export data to removable media, users inevitably copy, rename, and reorganize files. Any of these actions invalidates the DICOMDIR. If the receiving software depends solely on it for import, results will be incorrect. There are even dedicated tools for fixing invalid DICOMDIRs &mdash; which by itself demonstrates the scale of the problem.<\/p>\n<p><strong>3. Maintenance complexity.<\/strong> The DICOMDIR needs to be updated every time any file in the directory changes. On write-once media (CD-R), it must be the last file recorded to accurately reflect the contents.<\/p>\n<h2>File services and DICOM application roles<\/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\/pacs-server-data-storage.jpg\" alt=\"Data center server room with illuminated racks representing PACS storage infrastructure in a hospital environment\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1880px; --smush-placeholder-aspect-ratio: 1880\/1251;\"><figcaption>Server infrastructure for PACS storage &mdash; Photo: Brett Sayles\/Pexels<\/figcaption><\/figure>\n<p>The DICOM standard defines five media services for file operations: <strong>M-WRITE<\/strong> (create), <strong>M-READ<\/strong> (read), <strong>M-DELETE<\/strong> (delete), <strong>M-INQUIRE FILE-SET<\/strong> (query space), and <strong>M-INQUIRE FILE<\/strong> (query creation date\/time). Based on these services, any Application Entity takes one of three roles:<\/p>\n<ul>\n<li><strong>File Set Creator (FSC)<\/strong>: creates the DICOMDIR and DICOM files<\/li>\n<li><strong>File Set Reader (FSR)<\/strong>: reads only, without modifying any files<\/li>\n<li><strong>File Set Updater (FSU)<\/strong>: can read, create, and delete &mdash; in practice functions as FSC + FSR with M-DELETE capability<\/li>\n<\/ul>\n<p>The comparison with DICOM network communication is instructive. In the network model, Application Profiles are negotiated during association establishment. With files, this negotiation simply doesn&#8217;t exist &mdash; profiles must be compatible from the start. If one application writes MR images and the other expects CT, there&#8217;s no friendly error mechanism. This led the standard to define extremely detailed Application Profiles, as explored in our article on <a href=\"https:\/\/rtmedical.com.br\/?p=12612\">DICOM fundamentals: objects, communication, and data<\/a>.<\/p>\n<h2>DICOM file security: encryption and signatures<\/h2>\n<p>A fundamental difference between transmitting DICOM objects over a network and exchanging them as files is the scope of security risks. Intercepting network messages requires specialized skills; copying, deleting, or modifying a file is something anyone can do.<\/p>\n<p>The secure DICOM file format provides three protection properties:<\/p>\n<ul>\n<li><strong>Confidentiality<\/strong>: the entire file is encrypted and unreadable without the correct key<\/li>\n<li><strong>Origin authentication<\/strong>: certificates and digital signatures identify who created or modified the file<\/li>\n<li><strong>Integrity<\/strong>: checksums and signatures prevent undetected alterations to data like patient name or report date<\/li>\n<\/ul>\n<p>In practice, adoption of secure DICOM files remains quite limited. Few PACS software products implement this feature, and the standard definition remains superficial. If data security on removable media is a concern &mdash; and it should be, considering regulations like HIPAA and GDPR &mdash; the best strategy remains eliminating physical media from the process entirely.<\/p>\n<h2>Common mistakes and how to avoid them<\/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-teleradiology-upload-portal.jpg\" alt=\"PatientSite teleradiology web portal with DICOM file upload interface and integrated image viewer\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 691px; --smush-placeholder-aspect-ratio: 691\/611;\"><figcaption>Teleradiology portal with DICOM upload &mdash; a modern alternative to CD exchange<\/figcaption><\/figure>\n<p>Over years of DICOM integration work, certain problems recur with concerning frequency:<\/p>\n<p><strong>1. Relying on filename for identification.<\/strong> The &ldquo;.dcm&rdquo; extension is not standardized. Many implementations use SOP UIDs as filenames, resulting in long, potentially problematic strings. Always identify DICOM files by the DICM prefix in the header.<\/p>\n<p><strong>2. Not handling the VR switch between header and data.<\/strong> Group 0002 is <em>always<\/em> Explicit VR. If the data object&#8217;s Transfer Syntax specifies Implicit VR, the software must make this switch. This is one of the most frequent bugs in DICOM readers.<\/p>\n<p><strong>3. Using backslashes in File IDs.<\/strong> The File ID component separator uses backslash (\\), which is also the DICOM wildcard character for &ldquo;logical OR.&rdquo; Splitting filenames by backslash into separate components is one of the most widespread bugs. Use forward slashes (\/) instead.<\/p>\n<h2>When NOT to use DICOM media<\/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-portable-tablet-viewer.jpg\" alt=\"Physician viewing DICOM cranial CT images on a portable tablet connected to PACS\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 691px; --smush-placeholder-aspect-ratio: 691\/503;\"><figcaption>Remote access to DICOM images via tablet &mdash; alternative to physical media exchange<\/figcaption><\/figure>\n<p>Physical DICOM media exchange should be avoided whenever possible. Scenarios where DICOM networking or web solutions should be preferred:<\/p>\n<ul>\n<li><strong>Frequent inter-institutional transfers<\/strong>: VPN networks with DICOM C-Store are infinitely more efficient than burn\/ship\/import CD cycles<\/li>\n<li><strong>External referring physicians<\/strong>: web teleradiology solutions provide immediate access without requiring installed DICOM software<\/li>\n<li><strong>Any scenario where re-sending is likely<\/strong>: burn a CD, mail it, discover thin slices are missing, re-burn&#8230; this cycle is unproductive and costly<\/li>\n<\/ul>\n<p>The concept of <em>medialess<\/em> has gained traction in the community: completely eliminating CDs and DVDs from data exchange workflows. If you can adopt this approach, do it. No media = no media problems.<\/p>\n<p>For a deeper analysis of DICOM network communication as an alternative to media exchange, see our article on <a href=\"https:\/\/rtmedical.com.br\/?p=12643\">DICOM communication: SOPs, DIMSE, and networking in practice<\/a>. To understand the encoding of objects stored in these files, check our post about <a href=\"https:\/\/rtmedical.com.br\/?p=12628\">DICOM objects and data structure<\/a>.<\/p>\n<h2>The future: DICOM storage beyond current limitations<\/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-touchscreen-webpacs-demo.jpg\" alt=\"Touchscreen kiosk with WebPACS viewer displaying a chest X-ray in a public access point\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 692px; --smush-placeholder-aspect-ratio: 692\/541;\"><figcaption>WebPACS access kiosk &mdash; the evolution of DICOM image access without physical media<\/figcaption><\/figure>\n<p>The current DICOM media storage model is, frankly, excessively detailed in aspects it shouldn&#8217;t control &mdash; like boot sectors and media-specific filename rules. At the same time, it leaves gaps where flexibility would be most useful.<\/p>\n<p>An interesting proposal would be creating a DICOM packaging utility &mdash; something like a &ldquo;DICOMPack&rdquo; that works similarly to ZIP and RAR archivers but with medical imaging-specific features: JPEG2000 or JPEG-LS compression (far more efficient than ZIP for image data), encryption support, file splitting, and even built-in anonymization. This approach would eliminate media-specific dependencies, making data exchange more portable and secure.<\/p>\n<p>The DICOM standard already allows ZIP for compressing DICOM folders (Annex L of PS3.11) and archiving file sets (Annex V of PS3.12), but with restrictions that limit practical utility &mdash; predefined names, only one file set per archive, no image-specific compression. The natural evolution involves abstracting the media layer and focusing on intelligent packaging functionality.<\/p>\n<p>Until these improvements materialize, the practical recommendation is clear: invest in network infrastructure and remote access solutions, reserving physical media only for situations where there&#8217;s truly no alternative.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn the anatomy of DICOM files, the role of DICOMDIR, and how media storage works. A practical technical guide for imaging professionals.<\/p>\n","protected":false},"author":1,"featured_media":12646,"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":[227,101,230],"tags":[106,157,167,161,159,152,158,160],"class_list":{"0":"post-12668","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-dicom-en","8":"category-pacs-en","9":"category-software-en","10":"tag-dicom","11":"tag-dicom-2","12":"tag-dicomdir","13":"tag-digital-radiology-2","14":"tag-hl7-2","15":"tag-pacs","16":"tag-pacs-3","17":"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":[{"q":"What is a DICOM file and what is it used for?","a":"A DICOM (Digital Imaging and Communications in Medicine) file is a standardized format for storing and transmitting medical images along with associated patient and study metadata. It is used universally in radiology, cardiology, and other imaging specialties to ensure interoperability between different medical imaging equipment, PACS systems, and viewing software."},{"q":"How can I open a DICOM file on my computer?","a":"You can open DICOM files using free viewers such as Horos (macOS), RadiAnt (Windows), or 3D Slicer (cross-platform). Most patient CDs include a built-in viewer application. Note that standard image viewers cannot open DICOM files because they contain medical metadata beyond simple pixel data."},{"q":"What is a DICOMDIR file and why is it needed?","a":"A DICOMDIR file is a directory index that organizes DICOM files on removable media such as CDs, DVDs, or USB drives. It provides a hierarchical listing of all patients, studies, series, and images contained on the media, allowing viewer applications to quickly locate and display the correct files without scanning the entire disk."},{"q":"Why does my patient CD not open on some PACS systems?","a":"Patient CDs may fail to import into certain PACS systems due to missing or malformed DICOMDIR files, incorrect file encoding, non-standard DICOM transfer syntax, or missing required metadata tags. The most reliable way to verify a DICOM file is to check for the DICM prefix at bytes 129-132, rather than relying on file extensions."},{"q":"What is the difference between DICOM and regular image formats like JPEG or PNG?","a":"Unlike JPEG or PNG, DICOM files contain not only image data but also embedded patient demographics, acquisition parameters, equipment settings, and study context. DICOM supports higher bit depths (12-16 bit) essential for diagnostic accuracy, and follows strict standardization rules that ensure images can be correctly interpreted across different hospital systems worldwide."}],"video":[],"gtin":"","mpn":"","brand":"","aggregate_rating":[]},"_links":{"self":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/12668\/"}],"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=12668"}],"version-history":[{"count":1,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/12668\/revisions\/"}],"predecessor-version":[{"id":15480,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/posts\/12668\/revisions\/15480\/"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/media\/12646\/"}],"wp:attachment":[{"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/media\/?parent=12668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/categories\/?post=12668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rtmedical.com.br\/en\/wp-json\/wp\/v2\/tags\/?post=12668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}