MATLAB Answers

Copy DICOM header and use it to different DICOM images

12 ビュー (過去 30 日間)
Mar 2018 年 11 月 13 日
コメント済み: Mar 2018 年 11 月 14 日
I have a stack of 2D DICOM images. I want to replace the DICOM header of these DICOM images (without affecting pixel intensities) with another DICOM header (DICOM header from another dataset) that has all the info I need. Can I do this in Matlab?
  4 件のコメント
Mar 2018 年 11 月 14 日
I wanted to make a loop to do this procedure to the 300 images that I have but for some reason it doesn't read the data in the right order. I want to take the DICOM header from IM1 from the one folder and the data from IM1 from the other folder. The two folders have the same size of images. Below is the code I used:
pwd1 = ‘path to folder with DICOM images’;
pwd2 = ‘path to folder with the DICOM headers I want to use’;
dicomlist = dir(fullfile(pwd1,’IM*'));
headerlist = dir(fullfile(pwd2,'IM*'));
for cnt = 1 : numel(dicomlist)
info{cnt} = dicominfo(fullfile(pwd2,headerlist(cnt).name));
I{cnt} = dicomread(fullfile(pwd1,dicomlist(cnt).name));
status{cnt} = dicomwrite(I{cnt},num2str(cnt),info{cnt});
Can anyone help with that?


回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by