: dicomwrite(im, filename)
: dicomwrite(im, filename, info)

Write a DICOM format file to filename.

Inputs

im - image data or empty matrix, [], if only metadata save is required

filename - filename to write dicom to. if [], then function runs in verbose trial mode.

info - struct, like that produced by dicominfo

Examples

Create a dicom file using default info, and the supplied data:

> wdata = uint8 (10*rand (10,10));
> dicomwrite (wdata, 'test.dcm');

Create a dicom file using data and meta info:

> wdata = dicomread(file_in_loadpath('imdata/CT-MONO2-16-ankle.dcm');
> info = dicominfo(file_in_loadpath('imdata/CT-MONO2-16-ankle.dcm');
> dicomwrite(wdata, info);

See also: dicomread, dicominfo.

Package: dicom