Effacer les filtres
Effacer les filtres

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

11 vues (au cours des 30 derniers jours)
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 commentaires
Ken K
Ken K le 4 Juin 2021
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 le 4 Juin 2021
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur DICOM Format dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by