DICOM anonymizer

211 views
Skip to first unread message

Primoz Peterlin

unread,
Nov 9, 2013, 8:51:48 AM11/9/13
to dicom...@googlegroups.com
Hello,

First of all, I would like to praise dicompyler in general, as well as its use as a DICOM anonymizer. However, when I recently had to anonymize a set of DICOM files, I found out that in one of them, apart from the ReferringPhysicianName (0008,0090) field, which gets properly anonymized, the field PhysiciansOfRecord (0008,1048) has also been filled-in, and was not anonymized. I suggest that in one of the next releases, this field is also included for anonymization.

All the best, Primož

Adit Panchal

unread,
Nov 12, 2013, 11:04:43 AM11/12/13
to dicom...@googlegroups.com
Dear Primož,

Thank you for the kind words. I will consider adding the field you suggested to the anonymization process.

Also for consideration would be allowing the user to specify any tags on demand that they would like to be anonymized.

Thanks,

Adit

---
Aditya Panchal, Ph.D., DABR
President, RayFlux Inc.


--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en
---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Primoz Peterlin

unread,
Nov 13, 2013, 11:10:13 AM11/13/13
to dicom...@googlegroups.com
Dear Adit,

If you want to be thorough, DICOM Supplement 142 "Clinical Trial De-identification Profiles" is probably a good start.
ftp://medical.nema.org/medical/dicom/final/sup142_ft.pdf

All the best, Primož

Dne torek, 12. november 2013 17:04:43 UTC+1 je oseba Aditya Panchal napisala:

Robin Cole

unread,
Jul 27, 2016, 8:14:24 AM7/27/16
to dicompyler
Hi there are a couple of other fields which I require to complete anonymisation, these are SOP, Study and Series Instance UID. Would be useful to replace these with a random unique value. I have spent an hour trying to edit and build the python code but have been unsuccessful owing to inability to install version 2.8 of wxpython. Thanks

Adit Panchal

unread,
Jul 27, 2016, 8:50:14 AM7/27/16
to dicom...@googlegroups.com
If you are using the binary (exe) version, you can just replace anonymize.py with an edited copy and it will take precedence over the included one. You can add in the fields you require in the list.

I will update the existing issue here: https://github.com/bastula/dicompyler/issues/45 for the case of UID anonymization.

Thanks for the suggestion.

Adit
For more options, visit https://groups.google.com/d/optout.

Marcelino Hermida

unread,
Mar 11, 2017, 8:51:43 AM3/11/17
to dicompyler
Hi Aditya:

I am trying to modify the anonymize.py source file to avoid some tags to be anonymized. I wanted to substitute the anonymize.py file in the exe binary version, as you suggest, but in the version I have (0.4.2), there is no anonymize.py, but a compiled anonymized.pyo. I am a beginner in python, and I do not know how to create a compiled version. Can you give some hints on what to do?
Thanks and good work!

Marcelino Hermida

Aditya Panchal

unread,
Mar 11, 2017, 8:56:13 AM3/11/17
to dicom...@googlegroups.com
Hi Marcelino,

Actually you can just place your updated copy of anonymize.py in the same folder as anonymize.pyo. The Python interpreter inside of dicompyler will create an updated version of anonymize.pyo once you re-run the application.

If that doesn't work, you can go to Tools, Options and locate the User Plugins folder. You can place your file there as well, as it will override the default plugins.

Hope that helps,

Adit

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en

---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.

Marcelino Hermida

unread,
Mar 11, 2017, 9:53:39 AM3/11/17
to dicompyler
Hi Adit:
Thanks! That worked perfectly, much easier than I had expected. You did a great work with dicompyler.
Regards,
Marcelino

Adit Panchal

unread,
Mar 11, 2017, 11:48:17 AM3/11/17
to dicom...@googlegroups.com
Glad to hear that it worked for you! Thanks for the kind words!

Adit

Sent from my iPhone

Wenze van Klink

unread,
Nov 8, 2017, 10:16:58 PM11/8/17
to dicompyler
Hi Aditya,

I am trying to do the exact same thing as Marcelino and tried both of your methods:
  1. Drop anonymize.py in the plugins folder.
  2. Drop anonymize.py in the dicompyler\baseplugins installation folder.
In both cases I see a new compiled file after restarting dicompyler. But when I try to anonymise a patient the export option is greyed out. This even happens when I use the original anonymize.py without modifying it.

The log file contains the following:
2017-11-08 13:36:34,858 - dicompyler.plugin - ERROR - anonymize could not be loaded
Traceback (most recent call last):
  File "dicompyler\plugin.pyo", line 51, in import_plugins
  File "C:\Users\Wenze\AppData\Local\dicompyler\plugins\anonymize.py", line 13, in <module>
ImportError: cannot import name pub

That seems to indicate that wxpython is not installed, which I verified it worked.

After that I tried it on a fresh Virtual Machine to make sure that Python wasn't have a problem with dependencies. I installed Anaconda Python 2.7 + WxPython but still run into the same error.

























Any ideas?

Thanks,
Wenze

Aditya Panchal

unread,
Nov 13, 2017, 2:26:43 PM11/13/17
to dicom...@googlegroups.com
Hi Wenze,

Are you replacing anonymize.py with the one from the latest version from master branch on GitHub? If so, that version requires updated wxPython dependencies, which the 0.4.2 binary version does not have. It is still using wxPython 2.8.10.1 or so.

I think you should start making your modifications to anonymize.py from this version: https://github.com/bastula/dicompyler/blob/4e5c570bbbf4fb26fab7afbe24d24957757711b3/dicompyler/baseplugins/anonymize.py

as that will still be compatible with the 0.4.2 binary version.

The pubsub dependency was modified in wxPython 3.0 and above so the master branch anonymize.py won't work.

Hope that helps,

Adit

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en

---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.

Wenze van Klink

unread,
Nov 14, 2017, 3:42:35 AM11/14/17
to dicompyler
Hi Aditya,

Thanks for this crucial information, it solved my problem. Didn't look into the dependencies properly apparently.

Will there be new binary versions as the current one is from 2014?

It might be interesting to modify the anonymization plugin to have users select which items they want to anonymize. If I have some spare time I will look into that.

Wenze

Aditya Panchal

unread,
Nov 15, 2017, 12:58:54 PM11/15/17
to dicom...@googlegroups.com
Hi Wenze,

Great to hear that it worked.

There will be new binary versions once the rest of dicompyler has been tested. As you can see the anonymize.py hasn't been updated. So I would like to work on this some more before setting up a release.

Modifying anonymize.py would be great. I think if you are able to get that going, we can include that in the next release.

Thanks!

Adit

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en

---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages