Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserWarning: Invalid value for VR UI #39

Closed
dmd opened this issue Feb 9, 2023 · 1 comment
Closed

UserWarning: Invalid value for VR UI #39

dmd opened this issue Feb 9, 2023 · 1 comment

Comments

@dmd
Copy link
Contributor

dmd commented Feb 9, 2023

I'm seeing:

(useful) ddrucker@mic-dicom-router-mercure:~$ dicom-anonymizer E12034344 anon
  0%|                                                  | 0/3612 [00:00<?, ?it/s]/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '1.1.16.7.6707.3.3.60.06253.2332294204858050509242727.5.1.9'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '7.6.013.026981.5934635445.0220487836.2'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '5.1.59.6.4683.0.4.60.82574.0199929790689920395106101.5.8.8'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '3.9.59.4.0298.8.4.72.68889.658132895322857682744131'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
  0%|                                          | 2/3612 [00:00<03:52, 15.55it/s]/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '0.2.08.6.9364.4.6.39.26563.3829691537983094193002813.7.1.1'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
  0%|                                          | 5/3612 [00:00<02:50, 21.12it/s]/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '5.6.63.5.3208.2.0.67.68311.0344948525748214621517980'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
  0%|                                          | 8/3612 [00:00<02:32, 23.65it/s]/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '5.3.40.7.9556.8.5.07.50254.3682606057412565359545607'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '2.3.42.7.0184.5.4.49.35639.4066135185099479761379104'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/valuerep.py:290: UserWarning: Invalid value for VR UI: '8.4.08.0.3756.8.9.48.29829.1828695589432128234084115'. Please see <https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1> for allowed values for each VR.
  warnings.warn(msg)
  0%|▏                                        | 12/3612 [00:00<02:09, 27.87it/s]Traceback (most recent call last):
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 762, in get
    key = Tag(key)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/tag.py", line 84, in Tag
    raise ValueError("Tag must be an int or a 2-tuple")
ValueError: Tag must be an int or a 2-tuple

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/tag.py", line 28, in tag_in_exception
    yield
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 2390, in walk
    callback(self, data_element)  # self = this Dataset
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 387, in range_callback
    action(dataset, tag)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 164, in delete
    element = dataset.get(tag)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 764, in get
    raise TypeError("Dataset.get key must be a string or tag") from exc
TypeError: Dataset.get key must be a string or tag

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ddrucker/useful/bin/dicom-anonymizer", line 8, in <module>
    sys.exit(main())
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/anonymizer.py", line 161, in main
    anonymize(input_path, output_path, new_anonymization_actions, not args.keepPrivateTags)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/anonymizer.py", line 50, in anonymize
    anonymize_dicom_file(input_files_list[cpt], output_files_list[cpt], anonymization_actions, deletePrivateTags)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 295, in anonymize_dicom_file
    anonymize_dataset(dataset, extra_anonymization_rules, delete_private_tags)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 393, in anonymize_dataset
    dataset.walk(range_callback)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 2396, in walk
    dataset.walk(callback)
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/tag.py", line 32, in tag_in_exception
    raise type(exc)(msg) from exc
TypeError: With tag (6000, 3000) got exception: Dataset.get key must be a string or tag
Traceback (most recent call last):
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 762, in get
    key = Tag(key)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/tag.py", line 84, in Tag
    raise ValueError("Tag must be an int or a 2-tuple")
ValueError: Tag must be an int or a 2-tuple

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/tag.py", line 28, in tag_in_exception
    yield
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 2390, in walk
    callback(self, data_element)  # self = this Dataset
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 387, in range_callback
    action(dataset, tag)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/dicomanonymizer/simpledicomanonymizer.py", line 164, in delete
    element = dataset.get(tag)
  File "/home/ddrucker/useful/lib/python3.8/site-packages/pydicom/dataset.py", line 764, in get
    raise TypeError("Dataset.get key must be a string or tag") from exc
TypeError: Dataset.get key must be a string or tag

  0%|▏                                        | 12/3612 [00:00<02:29, 24.13it/s]
(useful) ddrucker@mic-dicom-router-mercure:~$
@dmd
Copy link
Contributor Author

dmd commented Feb 9, 2023

Sorry, I was using the released package rather than the head of main.

@dmd dmd closed this as completed Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant