mri3dX tutorial
Getting Started

This tutorial describes how to use Krish Singh's freeware mri3dX software for rendering brain images. This tutorial describes how to use mri3dX with scans from neurological patients, but the procedure is identical for scans from neurologically intact individuals.

mri3dX runs under Sun, SGI and Linux Unix. At the MRC-CBU, the software on Sun workstations, and PC users are able to run the program by using eXceed (which is available on the public PCs, as well as on your desktop PC). To launch mri3dX at the MRC-CBU, type 'mri3d' from the Unix prompt (this program is available to all members of the Imagers group). For users outside the MRC-CBU, you should launch mri3dX by typing 'mri3dx -3 -rgb -neuroaxial -npr' which ensures that the program runs in 24-bit color, and displays the proper windows. For a list of possible parameters, launch mri3dx with the parameter '-help'.

As the program starts, you will be requested to select an image to load. The software is able to read Analyze format images (if your image is in DICOM, NEMA or Genesis format, you can convert it using my MRIcro freeware). The current version of mri3dX only supports 8- and 16-bit Analyze format images (e.g. a 32-bit float Analyze format image will not be loaded). You can convert Analyze format images to big-endian 8-bit data images using my MRIcro freeware (select 'Save as rotated/clipped image from the file menu).

Once you have selected an image, you should see a four windows like those shown at the left: a command window, a sagittal, axial [transverse] and coronal window. Clicking in any of the three images of the brain will set all three image windows to show the location you have selected.


Skull Stripping

Skull stripping (aka brain extraction) will be required to render the exterior surface of the brain. Users of Analyze will know that this is usually a tricky and user intensive procedure. Fortunately, mri3dX implements a very clever algorithm called BET ('Brain Extraction Technique', designed by Steve Smith at Oxford's fMRIB). In order to extract the brain, you simply select the 'segment manager' from the 'seg' menu. A new window appears, pressing the 'fMRIB strip' button will start the brain extraction (this will take a while).

Once the skull stripping is complete, you can view the cortical surface by selecting 'show segmented only' from the 'seg' menu. I suggest that you carefully inspect the brain to ensure that you are happy with the extraction. BET occassionally makes errors in brain extraction, particularly if the image comes from a stroke patient, where the lesion can be excluded from the brain. If not enough of the brain is included (e.g. in the upper image shown on the picture to the left the right parietal cortex has been excluded), try reducing the 'fMRIB fract thresh' value in the segment window, and press the 'fMRIB strip' button again. The lower image on the left shows how reducing the threshold can lead to a better brain extraction.


Surface Rendering

Once brain extraction is completed, you can present a rendered image of the brain's surface. To show the rendering window, select '3D render' from the 'Views' menu. A new window will appear, similar to the view shown on the left. If you see a biege image of the head's surface, press the 'b' button to show the underlying brain. If the brain extraction has been successful, you should see a surface image, like the one shown on the left. The 'p' button selects between several standard views (sagittal left, sagittal right, coronal front, coronal back, top, bottom). To make the image appear larger or smaller, press the '+' and '-' buttons which appear in the rendered image window.

The quick view shown on the left was generated by creating a surface which averages the the nine voxels closest to the brain's surface- in other words, the sulci appear dark because they are dark in the original MRI image. Likewise, the lesion appears darker because it was darker in the MRI image. To adjust the depth of the surface used for estimating the brightness, click on the 'options' button. A new window appears which contains a number of controls. One of the controls is a slider which allows you to set the 'brain integrals', which is the depth in voxels used to generate the surface.


High Quality Rendering

To manually adjust the view point, simply right click on the rendered image and drag the mouse - you will see the brain rotated on the screen, drag the mouse until the brain is positioned at your desired orientation.

In order to see a high quality rendered view of the brain, press the 'rend' (rendering) or 'supe' (superior quality rendering). A superior quality rendering is shown on the left. Notice that the surface rendering is much better than the basic quality image shown above. Also, notice that the rendered surface shows the underlying texture of the brain (e.g. the sulci and the lesion).


Rendering Options

When you press the 'options' button from the render window, a new window appears which contains a number of controls for viewing the brain. The 'brain intervals' controls how the image intensity influences the brain's texture (as described earlier) for the low quality images. You can also set the 'SIB depth' which adjusts the averaging for Skin Interior and Brain textures for the high quality renderings.

In addition, you can remove a chunk from the surface to show the brains interior. To do this, set the X1..X2*Y1..Y2*Z1..Z2 coordinates in the 'Total ex' field, for example, in the picture on the left, a chunk at 100 200 160 240 0 100 has been removed (X 100-200 = right side, Y 160-240 = posterior, Z 0-100 = dorsal section). You can also set the brain tint (in red, green, blue and intensity, e.g. 1.00 0.80 0.25 2.5 means bright yellow) and the interior tint (here the 0.85 0.85 0.85 1.0 value describes a dull grey).

The options control also allows you to set the 'funDepth' (functional depth) which will be described later.


Overlaying a Lesion or an Activation Map

Next, I will describe how to show functional activity or the region of a brain lesion. If you want to display functional activity, use SPM to save an Analyze format image of the statistical data. In order to show an overlay of the lesion area (or the mutual overlap when working with multiple patients), use MRIcro to draw a lesion. The MRIcro tutorial describes how to trace the lesion to create a region of interest. Once you have defined the entire region of interest, use MRIcro's 'Export ROI to Analyze image' function (from the 'file' menu). This will create an Analyze format image of the lesion, which mri3dX can read.

Follow the steps described earlier in this guide to launch mri3dX, show the rendered view and skull strip the image. To show the lesion (or functional activity), select 'Load SPM results data' from the 'Fun' (functional) menu. The lesion (or activity) should appear on the axial, sagittal and coronal slices of the brain.


Lesion/Activation Options

You can adjust how the lesion (or statistical map of functional data) appears on the brain surface by adjusting the 'FunDepth' parameter. This value is found by pressing the 'options' button in the rendering window and modifying the 'funDepth' value. This value describes the depth beneath the surface which will influence the surface map. For example, a 'FunDepth' of 0.005 will show activity 5mm beneath the brain's surface. Note that the options window also allows you to adjust the overlay's opactiy (i.e. whether the overlay is transparent or opaque).

mri3dX takes into account the surface curvature when determining whether an activation (or lesion) is beneath the surface of the brain. This means that the renderings are viewpoint independent.

The upper image on the left show lesions plotted on a patient's brain. Notice that the lesion is mapped on the patient's own brain, rather than a generic brain surface template.

The bottom left image shows functional activity plotted onto the brain of a single subject (whose brain was used for normalizing the data from all the subjects used in the functional study). Again, notice that the funDepth setting can be used to adjust how much activity is displayed on the brains surface.