DICOMDIR Parser

버전 1.1.0.0 (3.8 KB) 작성자: Jadrian Miles
Automatically generates a parse tree from a DICOMDIR file, for easy non-interactive processing.
다운로드 수: 1.5K
업데이트 날짜: 2010/5/26

라이선스 보기

A DICOMDIR file describes a collection of (usually cryptically-named) DICOM medical image files and contains rich metadata for these images. Given the path to a DICOMDIR file, this function parses the file and generates a tree of the metadata.

Syntax:
- patient = parseDicomdir(fname);

Arguments:
- fname (string): the filename for a DICOMDIR file.

Returns:
- patient (cell array of structs): the root of a metadata tree with the following levels of nodes: patient, study, series, image. Each node is a struct, with an "info" field containing all the metadata as stored in the DICOMDIR file and another field, named for the next deeper level of nodes, that is a cell array of node structs.

Examples:
After calling the function,
- metadata for the i-th image in the j-th series in the k-th study for the l-th patient described by this DICOMDIR is
patient{l}.study{k}.series{j}.image{i}.info;
- metadata for the k-th study for the l-th patient is
patient{l}.study{k}.info;
- the birth date for the l-th patient is
patient{l}.info.PatientBirthDate;
- the date of the k-th study for the l-th patient is
patient{l}.study{k}.info.StudyDate;
- the description of the j-th series in the k-th study for the l-th patient is
patient{l}.study{k}.series{j}.info.SeriesDescription;
- the relative path from the DICOMDIR file to the actual image file for the i-th image in the j-th series in the k-th study for the l-th patient is
patient{l}.study{k}.series{j}.image{i}.info.ReferencedFileID;

Note that this relative path may be formatted using a path separator different from the one used on your system. For example, if the DICOMDIR was generated on a Windows machine but you're on Linux or Mac OS X,
strrep(patient{l}.study{k}.series{j}.image{i}.info.ReferencedFileID, '\', pathsep)
will give you a properly-formatted relative path, which you can then use as an argument to the fullfile() function to create an absolute path.

The zip file also includes copySeriesFromDicomdir.m, a script that uses parseDicomdir() to copy all images that belong to series matching a certain regular expression to a chosen destination directory.

인용 양식

Jadrian Miles (2024). DICOMDIR Parser (https://www.mathworks.com/matlabcentral/fileexchange/27740-dicomdir-parser), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Fixed a typo in the original M-file that caused a syntax error, and also included a new M-file with an example use of the function.

1.0.0.0