如何在MATLAB中保存或更新DICOM图像的更改值 [英] How to Save or Update the changed Values of DICOM images in MATLAB

查看:1576
本文介绍了如何在MATLAB中保存或更新DICOM图像的更改值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MATLAB中的DICOM图像。我想知道如何在MATLAB中保存更改的dicom图像值。我已经阅读了DICOM图像并执行了以下步骤。



dicomread(' dcm_image.dcm');



info = dicominfo('dcm_image.dcm');

PatinetName的值是Usman



info.PatientName



ans =



Usman


现在我已将PatientName的值更改为Khan



info.PatientName ='Khan'; < br $>


info.PatientName



ans =







在这一步之后我想知道如何保存我改变的值,这样当我>>清除时matlab和运行>> dicominfo('dcm_image');命令它应该显示PatientName的更改值将是Khan。



问候,

解决方案

请使用函数 dicomwrite 将元数据写回图像。



 image = dicomread(< span class =code-string>'  sample.dcm'); 
info = dicominfo(' sample.dcm');
......
// 更新信息
......
dicomwrite(图片,' sample.dcm',info) ;


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,

解决方案

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

image = dicomread('sample.dcm');
info= dicominfo('sample.dcm');
......
//Update info
......
dicomwrite(image, 'sample.dcm', info);


这篇关于如何在MATLAB中保存或更新DICOM图像的更改值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆