DTI-TK

Diffusion Tensor Imaging ToolKit

DTI-TK Logo

Quicklook Plugin: Quickly browse through images on your Mac

This plugin uses the Mac OS X Leopard's built-in innovative Quick Look framework to enable a quick assessment of any 3-dimensional image volume in the supported medical image formats directly from the Finder. Using the Finder's Cover Flow mode, a large collection of medical images can be browsed through and quickly inspected just as easy as flipping through your photos. Furthermore, a large number of images can be compared side-by side by selecting them together in the Finder, then pressing the space bar to bring up the Quick Look preview mode.

The current version is 2.3.0, released on September 2nd, 2018. You can keep yourself informed about the new release by signing up for an email alert here.

Download and Installation

The current release can be downloaded from here, for Lion and the more recent OS X releases (10.7+), and the change log for the new version is here.

To install the plugin, simply copy (drag-and-drop from Finder) the DTITK_QuickLookPlugin.qlgenerator either to the directory /Library/QuickLook (if you want to make it available system wide) or to the directory ~/Library/QuickLook (if you want to make it available locally). Create the directory if it does not already exist.

NOTE: On Lion and the most recent OS X releases, the Library folder is hidden by default. Follow these instructions to make the visible.

Sometimes, the older version of the plugin may be cached in the memory. To purge it from the memory, you may need to run the following command from the Terminal command line (See the attached screenshot)

qlmanage -r 

Running the command to purge the older plugin version from the memory

Adjust the Plugin Settings

From version 2.2.0 onward, the plugin now has support for adjusting two settings. The most important of the two is the ability to control the preference for the image orientation, which can be either NEUROLOGICAL, RADIOLOGICAL, or NONE. This can be set with the command, running from the Terminal, as follows:

defaults write com.garyhuizhang.dtitk.qlgenerator orientation RADIOLOGICAL

You can also adjust the font size of the information panel as follows:

defaults write com.garyhuizhang.dtitk.qlgenerator fontSizePoints 9

A new setting from version 2.3.0 onward to choose your own upper bound on memory usage:

defaults write com.garyhuizhang.dtitk.qlgenerator maxMemory 512

This will set the maximum memory limit to 512MB. The default value is 128MB.

Usage and Demonstration

The standard Quick Look usage applies. See the instructions provided by Apple for detail. The following screenshots demonstrate the typical usages of the plugin.

Screenshot 1: The Cover Flow Mode
(Click the image to view in full size)

Screenshot 2: The multi-volume preview
(Click the image to view in full size)

Screenshot 3: Preview in mricron
(Click the image to view in full size)

Supported Medical Image Formats

Currently supported medical image formats include

  • NIfTI
  • Analyze
  • FreeSurfer MGH/MGZ (contributed by Nick Schmansky)
  • Biorad PIC (contributed by Gregory Jefferis)

Learn how you can help support your favorite medical image format.

How to extend the Plugin?

Would you like the plugin to support your favorite medical image formats?

Here is how you can help. The easiest way to implement such support is for you to provide a function call in c programming language that produces a nifti image structure called nifti_image. The definition of this structure is available in nifti1_io.h from the nifticlib library.

The API for the function call will then be

nifti_image *formatname_image_read (const char *filename, int load_data)

The load_data boolean flag indicates to either load just the header info (0) or both the header and the data (1). This is important because the quick look framework, as currently implemented by Apple, set a hard total memory limit, even if the limit is reached only transiently. So I need to first read the header and determine if the file size is too big. If so, I will handle it differently.

Two Important Considerations in Your Implementation:

  1. When the load_data is set to false, you shouldn't be loading the data in the memory in any way or form. If you do, it defeats the whole purpose of the call.
  2. Memory usage has to be optimized. As an example, if you use the default IO implementation of your format to read in the data first and create a new buffer for the nifti_image structure, then you are doubling the total memory usage. This in turn means that the plugin can only view images of half the maximum size set by the quick look server (on my machine, it is about 128MB). The implementation should be such that only one memory buffer is used.

An Example Implementation:

Gregory Jefferis, who contributed the Biorad PIC format support, has kindly made the codes available online. The codes can be downloaded from

http://github.com/jefferis/pic2nifti/tree/master

Here is how the codes are organized. libpic2nifti.h defines the API interface pic_image_read as suggested above and includes the header dependencies: biorad.h for the data structure of Biorad PIC support and nifti1_io.h for the data structure of nifti_image. libpic2nifti.c consists of the implementation of reading in a Biorad PIC file and filling in a nifti_image structure. Finally, pic2nifti.c implements a Biorad PIC to NIfTI converter by calling the pic_image_read.

In addition, Greg's original implementation includes all the required files from the nifticlib library to make the codes self-contained. To make it easier for inclusion in the plugin, I've instead provided a means to link the nifticlib library externally via makefile. You should modify the makefile to reflect the actual location of the nifticlib on your own machine.

Contributors to the plugin

  • Nick Schmansky, contributed FreeSurfer support (available since version 1.6.2)
  • Gregory Jefferis, contributed Biorad PIC support (available since version 1.7.0)

Show Your Support

If you enjoy using this nifty plugin and see first-hand how it enhances your productivity, please show your support and appreciation by sparing a minute of your time to join the DTI-TK sourceforge group. Your support is critical for us to justify the current and future funding support from NIH. This in turn will allow us to continue improving this plugin and providing it to you free of charge. Being part of the sourceforge group will allow you to receive future announcements of bug fixes and/or significant updates, as well as to report bugs, post questions, or make feature requests.

One more thing...

Do you work with diffusion tensor imaging (DTI) data? Why not check out the main DTI-TK as well?

Page last modified on September 02, 2018, at 01:36 PM

    SourceForge.net Logo   Valid XHTML 1.0 Transitional