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.

Better Menus, Better Searching


I searched for my site in Google recently, and discovered two things.  Firstly, I am the most popular “I Do Im” search result in all of Googledom.  I’m not sure this is much of an achievement since my competition is  “I do imdb”, a phrase not in common usage.  Still, it is a small victory.
The second discovery had its ups and downs.
At some point since I last vanity-searched my website, Google has deemed me worthy of sitelinks.  Either my ranking has risen, or they’ve lowered their standards, but either way, now I have them.  Great.  But man, those are some awful sitelinks.  They’re supposed to take you to useful parts of the site, but mine are just a jumble of digits.  Where did they come from?
I suspect the answer is, poor site design.  I’ve been using images for the menu bar since day one, and I suspect that the Google search engine places particular importance on the menu bar and the pages it leads to.  My menus were graphical, and I didn’t have well-formatted alt text to describe where each link went (Programs, Search and so on), so the Google bot just took links at random.  Possibly they’re links to program codes, but whatever they are, what they are not is useful.
This discovery has led to a long-overdue redesign of my menus.  When I originally put the site up (which was the middle of the Blair era, or the end of the Clinton era, whichever you prefer), graphical menus were the way to go, or so I believed.  Originally the rollover effect was Javascript-based and really the only improvement I made was to change the rollover to CSS-based, and once I updated the images.
Well time moves on and Blair/Clinton era menus aren’t in vogue (if indeed they ever were).  People tend to find content through search engines, which can often drop them somewhere deep within a site.  So it’s important that the search engine knows a bit about the layout of the site so it can choose the best page, and more recently, show good sitelinks.  Mine didn’t qualify: time to redesign.


I decided upon a design using entirely CSS, rather than Javascript.  Further, I liked the idea of not using any images – most menu designs use images at least for the background.  And to be forward-looking, I used CSS3 features that are not implemented in all browsers yet, so different people see different menus.  As far as I can tell and test, though, the menus are always visible and navigable even in the worst case (that would be IE 6.  It’s hard to believe that today’s IE, which is awesome, is related to its predecessor).  Both Chrome and Safari support colour gradients, and also the rounded edges, as in the top image.  Firefox on the Mac does the rounded corners but not the gradient (middle), and IE and Firefox on the PC do neither (bottom).  Kind of a dull menu, but it functions. I’ll look more into the CSS for those, as Firefox and IE on the PC are used by 62% of my visitors.
I like the flexibility of text-based menus; I can change them with no effort.  And the lack of images gives me the ability to change colours easily so beware of forthcoming experimentation.  One foible / unexpected feature is that my menu bar, being now a text list, will now wrap around if the browser is not wide enough for it.  I’m not sure if this is a good or bad thing.  It’s certainly unusual – most menu bars just go off the right hand side of the browser.  On the other hand, it means all the options are available.  I’ll disable this ‘feature’ if it doesn’t grow on me.
For now, though, the text-based menus are at least up, and hopefully the googlebot will make sense of them and I’ll get some useful sitelinks.  And as people upgrade their browsers, more of the advanced CSS3 features will become available, like a nice fade-in effect.  While not all the features work now, if my past record of not updating the menus in eight years is any indication, at least I’ve built in a measure of future-proofing.
(The authors wish to thank, as the expression goes, Stu Nicholls for his amazing CSSplay site with dozens of menu sites, also the Style Master Blog for the image-free CSS menu.  I combined elements of both.)