Diffusion Tensor Imaging

As I mentioned previously, I’ve seen more software recently in DTI, so I’ve added a new searchable category for programs that support that modality.  I’ve identified 10 of the listed programs that have a major or minor DTI emphasis, I’m sure there are more.

Adding an all-new category encouraged me to write another new database editing program, one I’ve been putting off.  I’ve always edited project attributes using a program I wrote that lets me select attributes of one program,  like the supported input file formats, or an emphasis on neuro imaging.  But that meant that to select a new attribute (in this case DTI) for multiple programs, I’d have to edit each program in turn.  This falls under my definition of Actual Work, ie, doing the same thing more than once (under certain circumstances doing something just once still qualifies).  Since I try to embody Larry Wall’s three great virtues of a programmer, viz. laziness, impatience and hubris, I try to avoid Actual Work and I write a program to make a computer do it for me (writing programs is more of a pastime than work).  So I wrote a little program that lets me select multiple attributes, and multiple projects to which to apply them, and in one click it’s done.  In this case I selected ‘DTI’ and ‘Neuro’ to apply to the ten programs, since it seems any program that handles DTI is going to be neurologically-oriented.

This program should prove useful as I move forward in my quest to develop a meaningful search system.  I have a new categorization scheme which has better definition than the one I’ve been using all along – for instance I have just one category called ‘Surface/Volume’, while I’d like for people to be able to separately search for volume renderers, or surface generators, or multiplanar reconstructions.  But implementing this in a production environment is difficult – I’d have to start with a new database, then make a modified copy of all the programs using the new database, test it all, and one day switch it over.  Actually that’d be the better way to do it.  Instead I think I’ll do it on the fly – define the new database categories, add the attributes to the project listings using the new program, and run them in parallel for a while while I grind through recategorizing nearly 300 programs.  Once that’s done I can drop the old categories.  It’s not as elegant but it’ll get the results out sooner.

Hago Imagen

Spain has been on the ascendant in 2010 and continues that dominance with two terrific new programs added to this site, both very advanced and from academic centres in Spain.

The first is SATURN, an advanced visualization program for Diffusion Tensor Imaging (DTI), which comes from Ruben Cardenes and colleagues at the Image Processing Laboratory of the University of Valladolid.  This program is an excellent example of cross-platform development, in this case using the ‘Fast Light Toolkit’ FLTK.  I downloaded and ran the Mac, Windows and Linux versions of SATURN and they look and run identically.  It’s great to see the program released on all three platforms with the same version.

DTI employs data sets storing tensor data, represented by volumes of multidimensional data.  As such, the program uses fundamentally different data file formats than those used by most other imaging modalities, which store one scalar value per point.  SATURN stores tensor data in VTK and NRRD formats, the latter is new to me, it’s a library and file format for storing multidimensional raster data.  The MR data is loaded from regular data, and the higher level abstractions of model data, or fiber tracts, are stored in the VTK format.

I can’t claim to have tested this program extensively since I’m unfamiliar with the modality (I must now try to drop the terms ‘fractional anisotropy’ and ‘mean diffusivity’ into conversations), but I did open the sample data sets and have a run through the menus.  This is a major, solid scientific application and a significant addition to this active and growing field.

I know little about DTI but I have seen an increase recently in the amount of software coming out in this field.  I’ve been wondering whether to classify it as a specialization of MRI, or a modality in its own right, and have decided on the former.  There are several other sub-fields of MRI (FMRI, DSI), and it seems more likely to come, and I don’t want to fragment the categories too much.  Also, programs such as SATURN can read ‘scalar’ or regular MRIs in DICOM format just fine, so it seems it belongs under MRI.  And anyone in this highly advanced and specialized field is going to be an expert, and will know where to look for the right software.  I don’t think it’s quite got to the point where they send you home with your DTI images on a CD.

Continuing the Spanish theme, the other program added is GIMIAS, from Xavier Planes and colleagues at the Universitat Pompeu Fabra, in Barcelona.  GIMIAS is a large and comprehensive dataflow-based environment for prototyping processing in medical imaging and several other disciplines.  That’s a broad description and this framework, accordingly, covers a wide swath and requires some study before use.  This is an application for the heavy tasks, and yet as installed, is easy to use for the most common imaging tasks: you can use it to view images and I also tested query/retrieve from my DCM4CHEE PACS server.  There is also the ability to save in various formats, and many advanced imaging features including volume rendering, segmentation, ROI definition and statistics, volumetric meshes and many others, detailed in the 84-page manual and large website that includes tutorials and demonstration videos.

The real power of the GIMIAS framework, though, is enabled by its workflow capabilities.  A workflow (several are included) is defined by the user as a series of processing steps, as shown her in the AngioMorphology clinical workflow.

Each step can be anything from loading the images, to image processing, to a complex process involving the user.  The workflow is defined using a drag-and-drop editor and of course can be saved and new workflows can be downloaded.

And if that’s not enough, the framework is fully extensible through a plugin architecture and a comprehensive API; source code is also available to download.  GIMIAS makes good use of existing free software including several popular toolkits used by other programs on this site: ITK, VTK, DCMTK and MITK.  Each one of these is a leader in its field: used well, as here, in a major project from a top academic lab, and great things result.

Sorry it didn’t work out, Movable Type

I have changed my blogging software from Movable Type to WordPress, and it took a little while to get over feeling guilty about it.  I never really gave Movable Type a real chance, as I didn’t learn to use it beyond just writing posts and having them presented in the default appearance.  If it’s possible to feel a sense of betrayal for abandoning something that is not only inanimate but ephemeral, I felt it.  For a few hours.

The blog had been added, as had many features of the site, quickly and improperly.  I kept meaning to go back and alter the appearance to fit the rest of the site, and to integrate my own header so the menus were present.  As so often happens, it didn’t happen.  Finally this weekend after constructive criticism from my sister, I put in a bit of time to get the blog looking like every other page.

Movable Type is excellent software and makes great blogs.  A couple of things about its design, though, meant I hand’t learnt how to fully customize it.  It uses a proprietary system of markup tags to enable formatting and page layout, and I didn’t really want to learn another markup language.  Also, pages are implemented as static files, so changing the layout resulted in a lengthy republishing step, even for my small blog.  Mostly, though, it was a feeling that I was dealing with an application rather than a language.  I’d have to ask MT to do something for me, and then guess where the files were that had been changed, and what had been done to them.  I suppose the point is that you’re expected to deal only with the application, and allow it to perform the site publication.  But I wanted to change things, take out their header and include my own, and to have snippets of the blog on other pages, and so on.  I’m sure there’s a way to do this in MT, but it wasn’t something I could learn quickly.

WordPress LogoSo I had a look at WordPress, and liked several things I saw.  For starters, it’s written in PHP, so to learn to change things I’d have to improve my minimal PHP knowledge, which would be a good thing.  It seemed easy to customize and there was not the same feeling of separation from the source files that I’d had with MT.  The programmer in me isn’t happy unless I can see the source, and preferably, work on it directly.  Anyway it took only a couple of hours from starting reading about WordPress, until I had it running, with my previous content imported, and the header file modified to include my own header and menus.  This will also shame me into upgrading the 90′s-era server side includes (.shtml) files) currently serving as the front and back pages, which include a variety of Perl CGI  programs through a rather fragile system of hacks I put together.  I’ll re-do all the static pages in PHP, and put the CGI functionality directly into the page rather than off in a separate process.  Hopefully this will speed things up.

So overall a positive experience, I felt definite pangs particularly when I asked MT to export its own content so another program could take over, but I’m glad it’s pushed me to PHP and the many advantages that offers.