changing dicom-dict.txt has no effect

Hi,
I have MR images with a large amount of dicom private tags. I have copied and edited the dicom-dict.txt file to include as the final line
(2005,10A9) UT DistortionCorrection 1
and saved this as dicom-dict-copy.txt, which I had to manually import into the toolbox folder given the permissions on my pc.
I set dicom-dict-copy.txt as the new dictionary using dicomdict('set',filepath)
this is confirmed with dicomdict('get') = 'C:\Program Files\MATLAB\R2021b\toolbox\images\iptformats\dicom-dict-copy.txt'
However, the tag I have set is not recognised when i call inf.DistortionCorrection (inf = dicominfo(image)). Does anyone know why this does not work?

 Accepted Answer

You may refer to the following and try to create a new DICOM tag and write it to a new DICOM image.
After that, the DICOM header in the new image should contains your required information.
filename = 'Original.dcm';
I = dicomread(filename);
header = dicominfo(filename);
header.(dicomlookup('2005', '10A9'))='1';
newname = 'New.dcm';
dicomwrite(I,newname,header,'CreateMode','copy','WritePrivate',true);
new_header = dicominfo(newname);

4 Comments

Hi Simon, thanks for your help. Unfortunately I don't want to create any more headers, but I do need to be able to update the dicom tag lookup document. At present I am unable to access the private tags, which matlab just reads as a size of variable whilst undeclared. The problem is, despite declaring this variable, it is still unrecognised.
The private tag will be something like this from the DICOM header:
Private_01f1_1026: [6×1 uint8]
Private_01f1_1027: [2×1 uint8]
Private_01f1_1032: [14×1 uint8]
You can access via
header.Private_01f1_1032
Take the transpose of the header in a character array:
char(header.Private_01f1_1032')
give the following result:
'VIEW_FROM_FEET'
So if you know the content is a number, you may use function str2double to convert it.
Brilliant, thanks very much. I am now able to access the information I'm after. I will need to revisit the topic of editing the dicom dictionary though. I'm sure this will be handy in the future.
Great! Please accept the answer if you feel it useful.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!