Write dicom with output