DICOMDIR

Background & Context

    • MIME type: application/dicom
    • DICOM medical imaging format.
    • Commonly used in medical imaging equipment and picture archiving and communication systems.
    • DICOMDIR references multiple patients, studies and series of images.
    • DICOM is an acronym for Digital Imaging and Communications in Medicine.
    • DICOM stores multiple raster images together with patient and device information.
    • Binary format.
    • Supports a variety of image-encoding and data-compression methods.
    • DICOM Version 3.0 was introduced in 1993.

Import & Export

  • Import["path/to/DICOMDIR",elements] imports the specified elements.
  • Import["path/to/DICOMDIR",{elem,suba,subb,}] imports a subelement.
  • Import["path/to/DICOMDIR",{{elem1,elem2,}}] imports multiple elements.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties and settings
  • Structure elements:
  • "FileNames"an association of file names following the structure of referenced files
    "StructureGraph"a graph showing the structure of the referenced files
    "StructureGraphLegend"legend for the structure graph
    "Summary"summary of properties
  • Metadata elements:
  • "MetaInformation"metadata per DICOM file
    "PatientCount"total number of patients referenced
    "Patients"an association of patient IDs and available metainformation
    "StudyCount"total number of studies referenced
    "Studies"an association of patients and corresponding studies
    "SeriesCount"total number of series referenced
    "Series"an association of patients, studies and corresponding series
  • Data elements:
  • "CenterImage"an association of center images
    "Image"an association of first images
    "Image3D"an association of Image3D objects
    "ImageList"an association of list of images
    "RawData"raw data as stored in the file
  • Overlay element:
  • "Overlays"an association of overlay images
  • Import by default uses the "FileNames" element.
  • Import of a multi-image series with the "Image" element gives the first image.
  • Subelements for partial data import for any element elem can take patient, study or series specification in the form {elem,patient,study,series}, where either of the patient, study or series can be any of the following:
  • nnth entry
    -ncounts from the end
    idspecific entry by ID
    {n1,n2,}a list of entry indices or IDs

Options

  • Import option:
  • BoxRatiosAutomaticbounding 3D box ratios
    "ScalingWindow"Automatichow to scale image data
  • "ScalingWindow" can take the following settings:
  • Automaticautomatic scaling
    Noneno scaling
    "MinMax"scale to min and max of data in all frames
    "MinMaxPerFrame"scale to min and max of each frame
    {center,w}scale to the range {center-w,center+w}
    <|"Center"center,"Width"w|>scale to the range {center-w,center+w}
    <|"Min"min,"Max"max|>scale to the range {min,max}
  • With "ScalingWindow"->Automatic, values are scaled using scaling values stored in the file. If no scaling specification is stored, values are scaled using the "MinMax" method.

Examples

open allclose all

Basic Examples  (3)

Download and unpack a sample directory with a DICOMDIR file:

Import summary of the DICOMDIR:

List of all available import elements:

Import the center image of the first patient, first study, first series:

Show the structure graph of a DICOMDIR:

Import Elements  (44)

Data Elements  (14)

"CenterImage"  (3)

Import a single image from the middle of each series in the file:

Get a single image from the middle of the first series in each study referenced by the DICOMDIR:

Get a single image from the middle of the second series of the first study for all patients in the DICOMDIR:

"Data"  (3)

Import image data of all images referenced by the DICOMDIR:

Get image data for all images from the first series in each study referenced by the DICOMDIR:

Get image data of the first three images from the second series of the first study of the first patient in the DICOMDIR:

"Image"  (3)

Import a single image from each series in the file:

Get a single image from the first series in each study referenced by the DICOMDIR:

Get a single image from the second series of the first study for all patients in the DICOMDIR:

"ImageList"  (3)

Import images contained in the first series of the first study of a particular patient:

Get the number of images for each series referenced by the DICOMDIR:

Import images from the second series of the first study for all patients in the DICOMDIR:

"Image3D"  (2)

Import a structured collection of 3D images from the DICOMDIR:

Import the 3D image of the fourth series of the first study of a particular patient:

Metadata Elements  (30)

"FileNames"  (4)

Import a structured collection of file names referenced by the given DICOMDIR:

Import file names related to a particular patient:

Import file names related to the first series of the first study of a particular patient:

Import file names related to the first series of the first study for all patients in the DICOMDIR:

"FilePaths"  (4)

Import a structured collection of absolute file paths referenced by the given DICOMDIR:

Import absolute file paths related to a particular patient:

Import absolute file paths related to the first series of the first study of particular patient:

Import absolute file paths related to the first series of the first study for all patients in the DICOMDIR:

"MetaInformation"  (4)

Import metainformation contained in each file referenced by the DICOMDIR:

Import metainformation from the first file in each series:

Import the time of acquisition from the first file in each series:

Import all metainformation related to the date from the first file in the first series in the file:

"PatientCount"  (1)

Get the total number of patients referenced by the DICOMDIR:

"Patients"  (4)

Import information about all patients referenced by the given DICOMDIR:

Get the data of a patient with a given ID:

Get the data of the first patient:

Get the name of the first patient:

"SeriesCount"  (1)

Get the total number of series referenced by the DICOMDIR:

"Series"  (4)

Import structured information about all the series referenced by the given DICOMDIR:

Get information about all series of a patient with a given ID:

Get information about the first three series of the first study of the first patient:

Get the series description of the fourth series from the first study of the first patient:

"StructureGraph"  (1)

Import the structure of the DICOMDIR:

"StructureGraphLegend"  (1)

Import the legend for "StructureGraph":

Add the legend to the structure graph:

"Studies"  (4)

Import structured information about all studies referenced by the given DICOMDIR:

Get information about all the studies of a patient with a given ID:

Get information about the first study of the first patient:

Get the date of the first study of the first patient:

"StudyCount"  (1)

Get total number of studies referenced by the DICOMDIR:

"Summary"  (1)

Import the summary:

Import Options  (5)

"ScalingWindow"  (5)

By default, values are automatically scaled:

Perform no scaling:

Scale using min and max of all frames:

Import a list of images, scaling using min and max of all frames:

Scale using min and max of every frame:

Introduced in 2020
 (12.1)