Sie sind auf Seite 1von 2

dicomread -Read DICOM image

Syntax
X = dicomread(filename) X = dicomread(info) [X,map] = dicomread(...) [X,map,alpha] = dicomread(...) [X,map,alpha,overlays] = dicomread(...) [...] = dicomread(filename, 'frames', v)

Description

X = dicomread(filename) reads the image data from the compliant Digital Imaging and Communications in Medicine (DICOM) file filename. For single-frame grayscale images, X is an M-by-N array. For single-frame true-color images, X is an M-by-N-by-3 array. Multiframe images are always 4-D
arrays.

X = dicomread(info) reads the image data from the message referenced in the DICOM metadata structure info. The info structure is produced by the dicominfo function. [X,map] = dicomread(...) returns the image X and the colormap map. If X is a grayscale or truecolor image, map is empty. [X,map,alpha] = dicomread(...) returns the image X, the colormap map, and an alpha channel matrix for X. The values of alpha are 0 if the pixel is opaque; otherwise they are row indices into map. The RGB value in map should be substituted for the value in X to use alpha. alpha has the same height and width as X and is 4-D for a multiframe image. [X,map,alpha,overlays] = dicomread(...) returns the image X, the colormap map, an alpha channel matrix for X, and any overlays from the DICOM file. Each overlay is a 1-bit black and white image with the same height and width as X. If multiple overlays are present in the file, overlays is a 4D multiframe image. If no overlays are in the file, overlays is empty. [...] = dicomread(filename, 'frames', v) reads only the frames in the vector v from the image. v must be an integer scalar, a vector of integers, or the string 'all'. The default value is 'all'.

Tips

The dicomread function supports both reversible (lossless) and irreversible (lossy) JPEG-2000 compression in DICOM files.

Class Support

X can be uint8, int8, uint16, or int16. map must be double. alpha has the same size and type as X. overlays is a logical array.

Examples

Use dicomread to retrieve the data array, X, and colormap matrix, map, needed to create a montage.

[X, map] = dicomread('US-PAL-8-10x-echo.dcm'); montage(X, map, 'Size', [2 5]);


Call dicomread with the information retrieved from the DICOM file using dicominfo and display the image using imshow. Adjust the contrast of the image using imcontrast.

info = dicominfo('CT-MONO2-16-ankle.dcm'); Y = dicomread(info); figure, imshow(Y); imcontrast;

dicomanon -Anonymize DICOM file


Syntax
dicomanon(file_in, file_out) dicomanon(..., 'keep', FIELDS) dicomanon(..., 'update', ATTRS)

Description
dicomanon(file_in, file_out) removes confidential medical information from the DICOM file file_in and creates a new file file_out with the modified values. Image data and other attributes
are unmodified.

dicomanon(..., 'keep', FIELDS) modifies all of the confidential data except for those listed in FIELDS, which is a cell array of field names. This syntax is useful for keeping metadata that does not
uniquely identify the patient but is useful for diagnostic purposes (e.g., PatientAge, PatientSex, etc.).

Note

Keeping certain fields might compromise patient confidentiality.

dicomanon(..., 'update', ATTRS) modifies the confidential data and updates particular confidential data. ATTRS is a structure whose fields are the names of the attributes to preserve. The structure values
are the attribute values. Use this syntax to preserve the Study/Series/Image hierarchy or to replace a specific value with a more generic property (e.g., remove PatientBirthDate but keep a computed PatientAge). For information about the fields that will be modified or removed, see DICOM Supplement 55 from http://medical.nema.org/.

Examples

Remove all confidential metadata from a file.

dicomanon('patient.dcm', 'anonymized.dcm')
Create a training file.

dicomanon('tumor.dcm', 'tumor_anon.dcm', 'keep',... {'PatientAge', 'PatientSex', 'StudyDescription'})


Anonymize a series of images, keeping the hierarchy.

values.StudyInstanceUID = dicomuid; values.SeriesInstanceUID = dicomuid; d = dir('*.dcm'); for p = 1:numel(d) dicomanon(d(p).name, sprintf('anon%d.dcm', p), ... 'update', values) end

Das könnte Ihnen auch gefallen