Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on DICOM images in MATLAB. I want to know how to save the changed values of dicom images in MATLAB .I have read the DICOM image and performed the following steps.

dicomread('dcm_image.dcm');

info=dicominfo('dcm_image.dcm');
Value of PatinetName is Usman

info.PatientName

ans =

Usman

Now i have changed the value of PatientName to Khan

info.PatientName='Khan';

info.PatientName

ans =

Khan


Here after this step I want to know how i am going to save my changed values, So that when i >>clear the matlab and run >>dicominfo('dcm_image'); command it should show me the changed value of PatientName which will be Khan.

Regards,
Posted

1 solution

Please use the function dicomwrite to write back the metadata into the image.

C#
image = dicomread('sample.dcm');
info= dicominfo('sample.dcm');
......
//Update info
......
dicomwrite(image, 'sample.dcm', info);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900