Skip to content

Iterate though Dicom tag & change to uppercase #4591

Answered by tonygermano
Ruffdraft asked this question in Q&A
Discussion options

You must be logged in to vote

There's lots of stuff that won't work in there.

  • msg['tag30060085'] means to return a list of all child elements of msg named tag30060085. Taking the toString() value of that means you now have a string instead of an XMLList, so you can't iterate over it with the for each.
  • Using msg as your loop variable is going to overwrite your actual msg.
  • I'm not familiar with the DICOM tags, but if tag30060085 is a sub-tag as you indicated in your second code block, it would not be found by msg['tag30060085'].
  • This isn't wrong, but it's not necessary in your second example to call tstr.toString() because tstr is already a string, so you can just use it directly.

I took a stab at a solution based on …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Ruffdraft
Comment options

Answer selected by Ruffdraft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants