Main Content

dicomCollection

R2026b

Gather details about related series of DICOM files

Description

collection = dicomCollection(directory) gathers details about the DICOM files contained in directory and returns the file details in the table collection. The dicomCollection function aggregates details by DICOM series, using the value of the SeriesInstanceUID metadata field in each file to determine series membership. A DICOM series is a logically related set of images from an imaging operation.

example

collection = dicomCollection(filenames) gathers details about the DICOM files with the specified filenames, filenames.

example

collection = dicomCollection(DICOMDIR) gathers details about the DICOM files referenced in the DICOM directory file DICOMDIR. A DICOM directory file (DICOMDIR) is a special DICOM file that serves as a directory to a collection of DICOM files stored on removable media, such as CD- or DVD-ROMs.

example

collection = dicomCollection(___,Name=Value) specifies one or more optional name-value arguments.

Examples

collapse all

Gather information about the DICOM files in the Image Processing Toolbox™ sample image folder.

details = dicomCollection(fullfile(matlabroot,"toolbox/images/imdata"))
details = 5×16 table
    30-Apr-1993 11:27:24    30-Apr-1993 11:27:24    "Anonymized"              ""     ""          "CT"    512    512    1     1                        "RT ANKLE"                  ""                    "1.2.840.113619.2.1.1.322987881.621.736170080.681"                    "1.2.840.113619.2.1.2411.1031152382.365.736169244"                                                                    ""      "Y:\matlab\toolbox\images\imdata\CT-MONO2-16-ankle.dcm"
    04-Sep-1994 08:42:00                     NaT    "VS-SEG-001"    "VS-SEG-001"    "M"    "RTSTRUCT"      0      0    0     1    "Avanto RoutineImage Guidance"                  ""     "1.3.6.1.4.1.14519.5.2.1.267424821384663813780850856506829388886"     "1.3.6.1.4.1.14519.5.2.1.100364245183930759730290495595573094436"     "1.3.6.1.4.1.14519.5.2.1.326365742769246023985018090388737654442"    "Y:\matlab\toolbox\images\imdata\RTSTRUCT-VS-SEG-001.dcm"
    03-Oct-2011 19:18:11    03-Oct-2011 18:59:02              ""              ""    "M"          "MR"    512    512    1     1                      "RIGHT KNEE"                  ""    "1.3.6.1.4.1.9590.100.1.2.320418845013189618318250681693358291211"    "1.3.6.1.4.1.9590.100.1.2.287740981712351622214874344032214809569"     "1.3.6.1.4.1.9590.100.1.2.82751394713859146812798698723231105880"                  "Y:\matlab\toolbox\images\imdata\knee1.dcm"
    03-Oct-2011 19:18:11    03-Oct-2011 19:05:04              ""              ""    "M"          "MR"    512    512    1     1                      "RIGHT KNEE"                  ""    "1.3.6.1.4.1.9590.100.1.2.320498134711034521212730362051554545799"    "1.3.6.1.4.1.9590.100.1.2.316302984111738034326701385064023497963"    "1.3.6.1.4.1.9590.100.1.2.323830557912726559733008306283743938947"                  "Y:\matlab\toolbox\images\imdata\knee2.dcm"
    30-Jan-1994 11:25:01                     NaT    "Anonymized"              ""     ""          "US"    430    600    1    10                  "Echocardiogram"    "PS LAX MR & AI"                                                     "999.999.3859744"                                                    "999.999.94827453"                                                                    ""      "Y:\matlab\toolbox\images\imdata\US-PAL-8-10x-echo.dcm"

Gather information about DICOM files in a folder from a DICOMDIR file.

details = dicomCollection(fullfile(matlabroot,"toolbox/images/imdata/DICOMDIR"))
details = 4×16 table
    30-Apr-1993 11:27:24    NaT    "Anonymized"    "1"    ""    "CT"    512    512    1     1          "RT ANKLE"    ""    ""                    "1.2.840.113619.2.1.2411.1031152382.365.736169244"    ""    "Y:\matlab\toolbox\images\imdata\CT-MONO2-16-ankle.dcm"
    03-Oct-2011 19:18:11    NaT              ""    "2"    ""    "MR"    512    512    1     1        "RIGHT KNEE"    ""    ""    "1.3.6.1.4.1.9590.100.1.2.287740981712351622214874344032214809569"    ""                "Y:\matlab\toolbox\images\imdata\knee1.dcm"
    03-Oct-2011 19:18:11    NaT              ""    "2"    ""    "MR"    512    512    1     1        "RIGHT KNEE"    ""    ""    "1.3.6.1.4.1.9590.100.1.2.316302984111738034326701385064023497963"    ""                "Y:\matlab\toolbox\images\imdata\knee2.dcm"
    30-Jan-1994 11:25:01    NaT    "Anonymized"    "1"    ""    "US"    430    600    1    10    "Echocardiogram"    ""    ""                                                    "999.999.94827453"    ""    "Y:\matlab\toolbox\images\imdata\US-PAL-8-10x-echo.dcm"

Input Arguments

collapse all

Name of a folder containing DICOM files, specified as a string scalar or character vector.

Example: details = dicomCollection(fullfile(matlabroot,"toolbox/images/imdata"))

Data Types: char | string

List of DICOM filenames, specified as a vector of strings specifying the names of files that make up one or more multi-file DICOM volumes.

Data Types: string

DICOM directory file, specified as a string scalar or character vector.

A DICOM directory file (DICOMDIR) is a special DICOM file that serves as a directory to a collection of DICOM files stored on removable media, such as CD- or DVD-ROMs. When devices write DICOM files to removable media, they typically write a DICOMDIR file on the disk to serve as a list of the disk contents.

You can specify DICOMDIR using its absolute path, relative path, or location on the MATLAB® path.

Example: details = dicomCollection(fullfile(matlabroot,"toolbox/images/imdata/DICOMDIR"))

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: dicomCollection(directory,IncludeSubfolders=true) recursively searches for DICOM files below directory.

Include subfolders in search, specified as a logical 1 (true) or 0 (false). When set to true, the dicomCollection function recursively searches for DICOM files below directory. When set to false, the dicomCollection function only includes files within directory in the search.

Data Types: logical

Since R2025a

Display waitbar, specified as a logical 1 (true) or 0 (false). The function displays a waitbar when you specify DisplayWaitbar as true.

Data Types: logical

Output Arguments

collapse all

Metadata from DICOM files, returned as a table. The dicomCollection function aggregates the information by DICOM series.

Extended Capabilities

expand all

Version History

Introduced in R2017b

expand all

See Also

Apps

Functions

Objects