ruby-dicom 0.9.5 released!

66 views
Skip to first unread message

Christoffer Lervåg

unread,
Mar 27, 2013, 5:19:31 AM3/27/13
to ruby-...@googlegroups.com
Hello all

After 74 commits and 6 months of development time, it is a big pleasure to announce that a new ruby-dicom gem has been published: Version 0.9.5!

I was looking back at the history of ruby-dicom, and I noticed that this is the 15th gem release, and its already been 5 years since I first started learning the Ruby programming language by trying to make my own DICOM library. Version 0.1 was released a few months after this, in July 2008.

For those of you eager to learn every detail of what's new in this latest gem release, please head straight over to the Changelog at our github repository:
https://github.com/dicom/ruby-dicom/blob/master/CHANGELOG.rdoc

Alright, lets try to sum up what has happened since the previous version 0.9.4:

The DICOM module has been given a new load method designed to make it easier to load a group of DICOM files/objects. It accepts a wide variety of arguments, like one or more directories, one or more file paths, one or more DICOM binary strings, or one or more DObjects. It returns the loaded DObjects in an array.

There's' a couple of exciting changes to the network code. The DServer will now by default bind to 0.0.0.0 instead of localhost, which should get rid of some Econnrefused errors, and the code for receiving network data is significantly faster (thanks to a patch by Felix Petriconi). So if you've been let down by the DServer peformance before, I urge you to try it again with version 0.9.5, it might just be up to the task!

By far, the most changes in this release has been focused on the Anonymizer class. The most important feature change was actually the result of me being made aware of the following video presentation on the synergy between testability and good design:
http://vimeo.com/15007792#

I've sort of long known that the #execute method of the Anonymizer class, which is the one used for actually performing the anonymization, was a nightmare to test. However, this presentation really gave me the final push needed to realize that it had to be refactored to something that had a better design, and was more easily testable. The result was the deprecation of Anonymizer#execute, and the introduction of Anonymizer#anonymize.

This method takes the DICOM data to be anonymized directly as an argument, and uses the above mentioned DICOM::load method, which means it is very flexible as far as what arguments you pass in. It can be files, directories, or even plain DObject instances. Anonymized DObject instances are returned in an array. If you pass DICOM files to the method, it will write the anonymized DICOM objects back to file, if you pass DObjects, you will simply get the anonymized DObjects back (nothing written to file).

Outside of this refactoring work, there's been a lot of enhancements made to the Anonymizer as well. Check out the changelog for all the details. I'll just mention a couple of the most important ones. There's a new option to recursively anonymize the entire DICOM element tree (before only top level anonymization was possible). The audit trail has gotten a new encryption feature, which allows the encryption of key values to preserve privacy, but still keeping track of all anonymized values (which may be quite handy if you really need to use the audit trail and enumeration feature, but are prohibited by privacy laws to record any sensitive information in your audit trail record). Furthermore, UID replacement has been given a lot of attention, and it is now possible to use the Anonymizer to completely remap UIDs of DICOM files and preserve valid relations between files, series and studies! As a side note, for those of you that are really into DICOM anonymization, I would also like to mention that there has been a lot of work done on ruby-dicom anonymization by Jeff Miller in the CBMI fork (however, most of it hasn't been merged with ruby-dicom yet):
https://github.com/cbmi/ruby-dicom

Last, but not least, there's been a few notable DObject enhancements as well. The DObject#anonymize method was added to allow simple anonymization of a single DICOM object. New add_element and add_sequence methods were implemented. Some annoying issues related to inserting pixel data and the NArray library or RMagick/mini_magick having to be loaded even though they weren't used, were fixed. Again, check out the changelog for all the details.

I hope you enjoy this release (and your easter holidays), and please report any issues you may run into at the github tracker (I am especially aware that we may run into some issues/regressions as we switch from Anonymizer#execute to Anonymizer#anonymize):
https://github.com/dicom/ruby-dicom/issues

In closing, I'd like to say a few words about what lies ahead. ruby-dicom is maturing, and we're definitely approaching a 1.0 release. I'm quite happy about large parts of the library code, but some work needs to be done to refactor the network code, before I am comfortable with slapping the 1.0 label on it. As it stands, my idea for the network code (when I get the time) is to:
* Make it more object oriented and testable
* Separate it into its own gem
* Use 3rd party gems to improve performance. I was originally planning to use EventMachine, but may end up using Celluloid instead, as per Simon Rascovsky's previous suggestion to this group:
http://www.slideshare.net/KyleDrake/hybrid-concurrency-patterns?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+hnycombinator+%28HN+-+hnycombinator%29
https://github.com/celluloid/celluloid-io

Best regards,
Chris

Simon

unread,
Apr 19, 2013, 12:34:00 AM4/19/13
to ruby-...@googlegroups.com
Awesome! will test it out.
Reply all
Reply to author
Forward
0 new messages