修改dicom图像并将其另存为原始数据? [英] Modifying a dicom image and saving it as raw data?

查看:554
本文介绍了修改dicom图像并将其另存为原始数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是matlab数据,我正在尝试修改dicom图像像素.

Here is the matlab data, where I'm trying to modify the dicom image pixels.

dicom图像为4D,Rgb图像为3d,其他尺寸代表着名.我拍摄每帧图像,然后修改一些特定的像素值,然后尝试将它们保存为原始格式的整个dicom图像数据.

The dicom image is of 4D, 3d for the Rgb image and other dimension represents the fames. I take each frame and I modify the some specific pixel values and I try to save them whole dicom image data in raw format.

之所以将其保存为原始格式是因为我想将此数据用作dcmtk的dcmodify命令中的文件.所以,我的第一个问题是,我是否以正确的格式保存原始数据?如果没有,请建议我该怎么做.此外,您是否知道dcmodify命令dcmtk是否可以像在这种情况下那样处理4d数据,或者只能修改一个帧?谢谢.

The reason why I'm saving it in raw format is that I want to use this data as file in dcmodify command of dcmtk. So, my first question is, am I saving the raw data in correct format? If not, kindly suggest me how I should do so. Moreover, do you know whether or not dcmodify command dcmtk can handle 4d data like in this case or it can only modify just one single frame? Thanks.

clc
clear all
close all
img=dicomread('Bad001_2CH_01_anon.dcm');
%%implay(img);
[rows,columns,colors,frames]=size(img);
for i=1:frames
    img(1:25,:,:,i)=0;
    disp(i);
    figure(1)
    imshow(img(:,:,:,i))
end
fid=fopen('image.raw','w+');
cnt=fwrite(fid,img,'uint8');
fclose(fid);

推荐答案

您可能想看看 gdcmraw 取决于您真正想做的事情

You may want to have a look at gdcmimg and or gdcmraw depending on what you really want to do

这篇关于修改dicom图像并将其另存为原始数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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