Tuesday, May 24, 2011

Direct optimization of treatment machine parameters in RT - Been there, done that!

In the early 90s I did my Ph.D. on radiotherapy optimization at Karolinska Insitute, supervised by professors Anders Brahme and Bengt Lind. The core part of this work concerned the development of a dose calculation formulation that facilitated the direct optimization of practically any beam delivery parameters that are relevant in external beam radiotherapy.

In the article Simultaneous optimization of dynamic multileaf collimation and scanning patterns or compensation filters using a generalized pencil beam algorithm, published in the AIP journal Medical Physics in July, 1995, I describe this algorithm in detail. In particular, I describe how the algorithm can be applied to optimize beam weights, effective wedge angles and jaw and MLC leaf positions.

To illustrate the power of the algorithm, it is applied to a number of different optimization scenarios. Two of these scenarios concern the optimization of leaf positions in multiply segmented MLC beams in combination with one or multiple beam scanning patterns (once relevant for the Scanditronix MM50 Racetrack Microtron, nowadays primarily applicable to proton therapy).

As far as I have been able to find out, this article is the first where MLC leaf positions of multiply segmented beams are optimized directly. Prior to my work, MLC segmented beams had been optimized in a two-step process, where initially an optimal fluence modulation pattern was obtained, and this pattern was then approximated by a finite number of MLC segments.

In retrospect, the direct MLC segment optimization could perhaps have merited an article of its own. Anyway, the new approach was recognized for example by professor Steve Webb who in his review books The physics of Conformal Radiotherapy: Advances in Technology and Intensity-modulated Radiation Therapy devotes one section per book on my algorithm. In Intensity-modulated Radiation Therapy, professor Webb also identifies subsequent work by other authors along the same lines of direct leaf position optimization of multiply segmented MLC beams.

In the IMRT optimization that I implemented in Helax-TMS in the late 90s, I applied some of the developments from my 1995 article. I deliberately excluded direct optimization of the leaf positions though, due to development time constraints. In the Helax-TMS successor, Oncentra External Beam, the direct optimization of leaf positions has eventually been incorporated through the optimization component that Raysearch has provided Nucletron with.

In 2002, Dr. David Shephard published his article on Direct Aperture Optimization, DAO, in Medical Physics. DAO is yet another implementation of direct optimization of jaw and MLC positions in single and multiply segmented beams. The main novelty is that Dr. Shephard uses a simulated annealing optimization engine, whereas I in my work from 1995 used a gradient-based optimization engine, since my dose calculation formulation allowed me to. Dr. Shephard references some of the direct optimization predecessors that were also identified by professor Webb in his Intensity-modulated Radiation Therapy book. Intriguingly enough, my article from 1995 is not referenced.

The DAO algorithm has been implemented in the commercially available Prowess Panther treatment planning system.

It is fascinating to see that, despite the preceding work that I and other authors have published on the direct optimization of jaw and leaf positions of multiply segmented radiation beams, Dr. Shephard and his co-workers have still managed to claim a US patent for the DAO technique.

Just recently, Prowess filed a complaint against Raysearch, claiming that Raysearch infringes on the DAO patent with their implementation of the direct optimization technique. It will be interesting to follow the legal process of this case. Who knows, I might even get a recognition in the court ruling? :-)

Thursday, May 12, 2011

Logging now working in Silverlight mdcm

Another troublesome issue in the mdcm Silverlight DICOM class library has been the logging.

In the main mdcm project, the NLog class library for logging can be used without restrictions. There is a 2.0 beta version of NLog containing a Silverlight class library, which out of necessity is rather restricted.

However, with the help of the following response on Stackoverflow (many thanks, Stackoverflow user wageoghe) I have managed to add very simple logging capability to the Silverlight mdcm library as well.

With this solution, logging records are saved in a named file in the isolated storage of the running application. To enable logging globally, simply call the following static method:

Debug.InitializeIsolatedStorageDebugLogger();

To log something, simply access the Log member of the Debug static class:

Debug.Log.Warn("Some warning message {0}", variable);

This is a screen dump of the SL.DicomToXml Silverlight application included in the Silverlight mdcm project. To verify the logging functionality I have added a text box in the bottom of the application page to continuously display the contents of the NLog file:

Monday, May 2, 2011

Image codec support in Silverlight mdcm

In my Silverlight adaptation of the mdcm DICOM class library, image codec support is only barely existing. The only fully supported codec is the RLE (Run Length Encoding) format, which is also provided as a fully .NET managed implementation in the main mdcm library.

There are a number of image files in various compression formats available for testing here. I have used these images to verify that RLE compressed files can indeed be decoded by the Silverlight mdcm library.

I have also attempted to implement JPEG codec support in the Silverlight library, but I have not yet been successful. Since I am limited to fully .NET managed implementations of JPEG encoding and decoding, there are only very few open-source alternatives available.

I have thus far only identified the following two open-source alternatives:
The former is a codec library developed practically from scratch, whereas the latter library is a C# adaptation of the LibJpeg library originally developed by the Independent JPEG Group. Neither of the above implementations appear to support images with precision larger than 8 bits. More often than not, the precision of DICOM images is 12 bits, so neither FJCore nor LibJpeg.Net seem to be capable of providing sufficient JPEG codec support in the DICOM context at this stage.

As a sidenote, Leadtools provide codecs for JPEG and several other image formats in its DICOM Silverlight SDK. This SDK however comes at a price...