How to copy the Dicom private tags in another Dicom file using the dicomwrite function accurately?

조회 수: 4 (최근 30일)
Hi, I need to copy the Dicom info from one file to another. The Dicom file I have consists of many private tags and I want to copy them to the another file that I am writing using the MATLAB dicomwrite function.
info = dicominfo('ABCD.1.img'); % it has may private tags
fileID1 = fopen('data.s', 'r');
data1 = fread(fileID1); % I am writing this as a dicom file
fclose(fileID1);
dicomwrite(data1, 'new_image.img', info, 'CreateMode', 'Copy','WritePrivate', true);
metadata = dicominfo('new_image.img');
isequal(info, metadata) % .....> returns logical 0.
When I do this, all the private tags becomes uint8 and [0;0;0;0]...... format (some nonsense values). How can I copy the info accurately?
  댓글 수: 7
Ken K
Ken K 2021년 6월 4일
I am facing the same problem. Can you elaborate on your statement about appending the dicom dictionary? How did you manage to write the private tags such that they are not in uint8? Would you mind sharing the script for this?
Cheers
Rik
Rik 2021년 6월 4일
The private tags are private, so there isn't a general definition. The definition might be standard for your specific field/application. Once you know what a specific tag means, you can define the VR and VM. The VR will ensure the data is read in the correct data type.
Doing custom work with DICOM is not trivial. Know what you're getting yourself into. There will be a lot of googling involved and a lot of conflicting information.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by