MATLAB Answers

dicomwrite error in copying metadata: "Undefined function 'fieldnames' for input arguments of type 'uint8'."

2 views (last 30 days)
Sangeetha
Sangeetha on 24 Feb 2015
I'm trying to modify the metadata of a DICOM file and copy ALL the fields over to a new file. The default dicomwrite does not copy all the fields. I tried to use 'createmode','copy' and I get the following error: Undefined function 'fieldnames' for input arguments of type 'uint8'.
The DICOM dictionary has all the fields I need to copy over, so thats not the issue! Any help would be greatly appreciated. My code is below:
X=dicomread(filename); hdr.PatientName=subjid;
dicomwrite(X,'file_copy.dcm',hdr,'CreateMode','Copy');
%% Using dicomwrite(X,'file_copy.dcm',hdr) successfully copies, but leaves some fields out in the metadata.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by