フィルターのクリア

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

11 ビュー (過去 30 日間)
blues
blues 2021 年 2 月 23 日
コメント済み: Rik 2021 年 6 月 4 日
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 Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by