FUNCTION REFERENCE

dicomCollection

Scan a DICOM folder or file and group series into a table.

Scan a DICOM folder or file and group series into a table.

Syntax

collection = dicomCollection(source); collection = dicomCollection(source,'IncludeSubfolders',tf)

Returns a table with one row per series (row names s1, s2, ...) and variables StudyDateTime, SeriesDateTime, PatientName, PatientSex, Modality, StudyDescription, SeriesDescription, StudyInstanceUID, SeriesInstanceUID, Rows, Columns, Channels, Frames and Filenames. Absent or invalid Gregorian dates and invalid times become NaT; an absent time on a valid date means midnight. TM accepts HH, HHMM or HHMMSS with optional 1-6 fractional digits after seconds. PS3.5 6.2 permits second 60 for a leap second; this engine returns NaT for it because fixed 86400-second datetime days cannot preserve a leap second. Frames sums NumberOfFrames across all files in each series, and Filenames holds a cell of string arrays sorted by InstanceNumber then filename. Non-DICOM files are skipped silently; DICOM files whose headers cannot be collected are skipped with warning dicomCollection:skipped. Retained text is capped in encoded bytes: UI 64, LO 64, PN 320 and descriptions 1024 (the LO cap also applies to LO descriptions); a longer field skips the whole file.

Differences from MATLAB: DICOMDIR input is not supported yet and errors explicitly. Scanning is bounded to 100000 files and 10000 distinct directories, stops at the first top-level pixel tag, and polls cancellation between files and during header reads. Files larger than 256 MiB are listed without reading native pixel payloads; deflated input decodes only the header with bounded compressed read-ahead. Header storage is capped at 16 MiB and the remaining memory budget. Nested pixel attributes are not supported and skip the file. File summaries, UID group indexes, paths, directory state and table construction are admitted against the remaining engine memory budget; exhaustion errors explicitly. Admission conservatively reserves 8 KiB plus path storage per candidate file, including skipped files, for the duration of a scan. Directory links are followed only within the canonical source root and duplicate canonical directories are scanned once; file symlinks use their opened target metadata. Native file I/O is unavailable in the browser.

Example

exist('dicomCollection','builtin')   % 5

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.