Handling of renamed tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
andreasb
Posts: 24
Joined: Thu, 2011-02-24, 11:27
Location: Bremen

Handling of renamed tags

#1 Post by andreasb »

Hi,

with dcmtk 3.6.0, a lot of tags have been renamed (because of the renaming in the DICOM standard). Is there a possibility to have both the new and old tag names for lookup?
Background: we have a lot of code (mostly scripting) that uses the old tag names for lookup, and it would be good to have a lookup for both for the new and the old names (with an additional warning logged) to avoid to break existing code. Adapting all code at once is not an option...

Thanks,

Andreas

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Not only the attribute names have been renamed between DCMTK 3.5.4 and 3.6.0 in order to be consistent with the official keywords of the standard, but also the names of some SOP Classes and Transfer Syntaxes.

The changes of the attribute names have been documented in the DCMTK Wiki - as you probably already noticed.
Is there a possibility to have both the new and old tag names for lookup?
We also discussed this internally when we did the name changes. However, we thought that this is a one-time change and the release 3.6.0 is a major release of the DCMTK - after about 5 years. There already have been name changes in the past but neither so many for a single release nor so prominent examples like "PatientsName" -> "PatientName".

To answer your question: Currently, the DCMTK does not support multiple names for the same tags, because the last processed tag definition (either from the built-in dictionary or from the external dictionary files) "wins". This allows for example for renaming tags as it is used for the DICONDE standard (e.g. PatientName is called ComponentName). Also for the output of the tag name: Which one should be used if there were more than one?

andreasb
Posts: 24
Joined: Thu, 2011-02-24, 11:27
Location: Bremen

#3 Post by andreasb »

Thanks - I was afraid that this would be the answer. I have seen that the last processed tag definition overwrites the old one, I was just checking if there was some option I did not see.
About the tag names: we would need the lookup only in the direction from old tag names to tags; the other direction should always give the correct (aka new) names. Usually, this direction is used for display only, while the other direction is used for tag lookup in scripts.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Btw, I used the "search & replace" function of my text editor to change the code of all DCMTK tools and related files (like the DCMCHECK IOD descriptions) ... this was a one-time process, of course. Maybe, this is also an option for you.

andreasb
Posts: 24
Joined: Thu, 2011-02-24, 11:27
Location: Bremen

#5 Post by andreasb »

Yes, thanks, that is definitely an option for the code we have access to. The problem is that there is a lot of code that we do not have direct access to, and we don't want to break the code of other developers. A deprecation warning for some transition time should do the job. We probably will add this ourselves...

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

When you have a solution that you think could also be interesting for other DCMTK developers, please feel free to send an email with the patch to us (dicom/at/offis/dot/de).

andreasb
Posts: 24
Joined: Thu, 2011-02-24, 11:27
Location: Bremen

#7 Post by andreasb »

I have hacked together a solution that works for us, but that only supports built-in dictionaries (which we use exclusively). I can send you the patch anyway, if you are interested.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

Yes, please send us the patch by email (dicom/at/offis/dot/de). Of course, we cannot guarantee that it will make it into the public DCMTK ...

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest