next up previous contents
Next: 20. The VVLink Tool Up: 6 F. Neurosurgery Tools Previous: 6 F. Neurosurgery Tools   Contents

Subsections

19. Intracranial Electrode Localization

Figure 19.1: Different Views of the Electrode Editor in Action. Left: intracranial electrodes overlaid on an MRI Brain Image. Middle: Electrodes overlaid on a thresholded volume rendering of a CT image. The bright dots in the CT are the metal contacts of the electrodes. Right: A more complex rendering of the electrodes overlaid on a CT image.
Image ElecExample1 Image ElecExample2 Image ElecExample3

19.1 Introduction

BioImage Suite provides a tool for localizing and labeling electrodes based on an image that contains visible electrodes, such as a CT image. This tool is the Electrode Editor, which consists of two windows: An Image Viewer (Fig. 19.2) and an Electrode Control Window (Fig. 19.3). With these tools, you can create a custom array of electrodes and place them into an image in any configuration you like. Later, you can visualize these electrodes in other images, and load attributes for the electrodes with the Data Tree Manager (see Chapter 15). The generation of electrode location data results in the creation of a *.mgrid file, which holds the electrode properties and locations.

Figure: Electrode Editor Image Viewer. This is a normal viewer in most respects, and operates just like the 3D viewer described in Viewers. The only difference is that it has electrodes displayed in it, which are linked to the Electrode Control Window.
Image ElectrodeViewer

Figure: Electrode Editor Image Viewer. This window is where electrodes are added and their properties are set. For a description of all the functions in this window, see the Electrode Editor Function Catalog, below.
Image ElectrodeControlWin

19.1.0.0.1 Starting the Electrode Editor

The Electrode Editor is available either through the main BioImage Suite menu, or by typing pxitclelectrodeeditor on the command line.

Note: Much of the effort involved in localizing electrodes is based on the manipulating the image and the Viewer to better view the positions of the electrodes. Look at The Viewers (Chapter 5), and Image Processing (Chapter 7), for a more in-depth descriptions of these functions.

19.2 Getting Started

19.2.0.0.1 (1) Load the base image:

Once the Electrode Editor Tool has started, you need to load an image into the viewer. Just as with all viewers in BioImage Suite, choose the ( File | Load ) menu option and open your image (or import a non-analyze format file with ( File | Import ). This image must contain recognizable (significantly bright) locations of electrodes, since these will help the software position an electrode exactly as you click in their vicinity.

19.2.0.0.2 (2) Set Editing Options:

A few options must be set for you to start editing and localizing electrodes. In Image Viewer Window: Toggle the ( Features | Enable Volume Trace ) option to ON. In Electrode Control Window: Choose the ( Edit | Full Edit Mode ) radio option, in order to allow you to edit all aspects of your electrodes. On the right side of the ``Electrode Info tab'' in the Electrode Control Window, check the ``Button Pick'' option.

19.3 Working with Electrode Grids

In the Electrode Control Window, the template electrodes start as ( X x Y ) grids. In practice, many electrode sets are actually arranged as strips of electrodes in a row. In this case, simply change the template electrode to a grid with dimensions ( 1 x Y ). Note: In this manual, the term ``grid'' refers to both this strip configuration ( 1 x Y ) and the grid configuration ( X x Y ).

19.3.0.1 Adding Grids and Setting Their Properties

19.3.0.1.1 Add/Delete Grids:

Electrode grids are added and their properties are manipulated in the Electrode Control Window. To add a new grid, or remove an unneeded grid, look in the ``Patient Info'' Tab. On the right side of the window are the Add New Grid and Delete Grid buttons. When added, a new electrode grid is placed in the ``Grid Information'' list.

To set an electrode grid's properties (length, width, name, spacing, etc.), select it in the ``Grid Information'' list, and click on the ``Electrode Info'' tab. This tab now contains options for this individual grid. By default, newly added grids are given an X dimension of 1, making them strips.

19.3.0.1.2 Grid Properties:

In this section of the ``Electrode Info'' tab, you can set the name of the grid (often the name includes some anatomical landmark). Note: Names should not contain spaces. Dimensions are set here as well. Nominal spacing sets the assumed spacing between neighboring electrode on the grid in both dimensions. You can choose what type of icon you would like to be used to display the electrode location (either sphere or disc), as well as the radius and thickness thereof. Once you have set these options correctly for the electrode grid in question, click the Update Electrode Grid button. After querying you to be sure you want to make the changes, the electrodes in the Viewer, as well as in the ``Electrode Arrangement' box will update to show the appropriate dimensions.

19.3.0.1.3 Electrode Arrangement:

In this box, you are able to select individual electrodes within a grid. Note that electrodes are numbered from the end furthest away from the leads to the end closest to the leads. A Note on Electrode Numbers. Electrodes are numbered from the end farthest away from the leads to the end closest to the leads. Thus, in a strip of electrode, electrode 1 is at the bottom of the Electrode Arrangement display, and the highest numbered electrode (whose number depends on the length of the strip) is at the top. If the electrode has been cut, so that the end distal from the leads is missing, you should still input the original length of the electrode strip in the ``Dimensions'' field, and then select the electrodes that are missing in the arrangement view, and uncheck the ``Electrode Enabled'' box on the right side of the tab window. The electrode will become grey in the dialog box and disappear in the viewer. This is important because it allows you to create shorter electrode strips that are numbered starting with numbers other than 1. (If you just create a shorter electrode, it will be numbered 1-6, for example, not 3-8). Thus, you can maintain consistency with the electrodes' real numbering scheme.

19.3.1 Localizing Electrodes

Note: If you are using a volume visualization in the viewer (see the page on Viewers), before localizing electrodes you should go to the Features menu in the viewer window and make sure that the ``Enable Volume Trace'' checkbox is checked. This allows the viewer to interpret mouse clicks as being localizations on the volume as you see it.

Once all the electrodes have been added in the ``Patient Info'' tab, and their names, dimensions, and spacings specified, you can start placing them in their proper locations in the Viewer Window. The base image should already be loaded in the Viewer (see Chapter 3). The next step is to make the electrode locations in the image readily visible by thresholding it. We have had success thresholding CT images of platinum electrodes from 3000 to maximum, and steel electrodes from 1500 to maximum, if they are present. See Chapter 7 for how to do the thresholding operation. Leaving the Viewer in the Results view is fine in this case.

Figure: example thresholded CT image. This image was thresholded at 3000 to maximum, and shows very clearly the locations of all the surface and depth electrodes that have been implanted. At the top of the image, you can see the electrode grid at its default location, ready to be localized based on the image.
Image ElecThreshExample

Once the loci of the electrodes are readily visually apparent in the base image, you can start selecting and localizing electrodes to their proper locations (Sometimes it may be helpful to use the volume control to crop the viewable image somewhat in order to temporarily remove confounding electrodes from the view).

Find and identify a specific electrode in the image. Then go back to the Electrode Control window (See Fig. 19.3), choose the ``Patient Info'' tab, and select the electrode grid that contains the electrode you have picked. Click on the ``Electrode Info'' tab, and in the ``Electrode Arrangement'' tab, click on the button in the grid that corresponds with this electrode. In the ``Editing'' Box, click the Pick Current button. Now go back to the Viewer, and Hold down Shift while left-clicking on the bright area in the image that represents the electrode. The marker for that electrode will move to where you clicked. Go back to the Electrode Control Window, select another electrode, click Pick Current and repeat.

19.3.1.0.1 Volume Trace:

The electrode is placed in the center of the bright region that is close to the location that you Shift-click on. The volume of the space searched is under your control. To set it, simply go to the Volume Trace menu, and select one of the ``VOI Size'' options. The default is a radius of 10. If two electrodes are close together in the image, it may be useful to decrease the VOI size, so that they will not be localized together by a single click.

19.3.1.0.2 Undo:

In the Edit menu there is an ``Undo Move Electrodes'' option. This can undo the last electrode placement operation performed. This operation is not cumulative, however.

Grid Color

Once all electrodes in a grid have been placed or while you are working on them, you may wish to color the grid, so that it can be easily spotted and differentiated from the others. To do this, use the ( Grid | Grid Color ) menu option. A Color selection dialog box will appear, in which you can choose a unique color for the grid.

Figure 19.5: Electrode Arrangement Box. Electrodes are numbered from the end farthest away from the leads to the end closest to the leads. Thus, in a strip of electrode, electrode 1 is at the bottom of the Electrode Arrangement display, and the highest numbered electrode is at the top.

0.8Image ElecNumbering

Saving the whole scheme

The ( File | Save ) operation saves an *.mgrid file that contains all the information you have entered: electrode grid dimensions and locations, names, numbers, color schemes, etc. This file can then be edited later or loaded into the electrode control modules of other viewer sets. These *.mgrid files are also able to be loaded into the Data Tree Manager, so that you can apply transformations to them and display the electrodes in the spaces of other images (on the pre-operative MRI, for example).

19.4 Electrode Editor Function Catalog

The functions in the viewer of the Electrode Editor program are common to all viewers, and are detailed in Chapter 3. This section explains the tools that are available in the Electrode Control Window (Figure 19.3)

19.4.1 Patient Info Tab

The Patient Info Tab contains a summary of which electrode grids are present in the current scheme, and what their numbers and names are. As described above, in Adding Electrodes, this is where you add new electrode grids and delete unneeded ones. Using the Add New Grid button will add a new grid at the bottom of the list, with a default name, which you can change in the Electrode Info Tab (See below). Clicking the Delete Grid button deletes the currently selected grid.

The Patient info tab also contains a couple fields for some info about the patient: a simple description, and a comment, in case you need them.

19.4.2 Electrode Info Tab

This tab allows the users to set various properties of the electrode grid.

19.4.2.0.1 Grid Properties:

The options in this section set the properties of each grid as a whole.

Grid Name The name of the grid or electrode strip

Grid Dimensions The length and width (in number of electrodes) of the grid. If you need to represent an electrode strip, simply use a 1 in the first field.

Nominal Spacing The initial spacing between electrodes in the grid. This is flexible, as spacing will change for each electrode as you place it, but it should be close to the actual spacing on the electrode strips before implanting (Usually 10mm or 5mm).

Electrode Type This menu contains two options for how the electrodes should be drawn: either as spheres or as discs.

Radius/Thick (mm) This pair of options specifies the size of the rendered electrode representations. Just the radius is needed for spheres, while discs are drawn according to the radius size and a thickness as well. When you have made the changes you want, click the

Update Electrode Grid button. This will remove any placements you have made on the old electrode grid, and replace it with a new grid that has the properties you have specified.

19.4.2.0.2 Electrode Arrangement:

This section of the Electrode Info Tab is just a grid of radio buttons that correspond with the electrodes that are available for you to edit and place. This is where you select an individual electrode to place, or enable/disable. See Localing Electrodes.

19.4.3 Electrode Properties

The values in this section update as you select electrodes in the Electrode Arrangement section. The top field, ``Grid/Electrode'' specifies which electrode number in which grid you are working with. The ``Position'' field gives the X, Y, and Z coordinates of the electrodes location in the image. The four ``Distances'' fields show the distance from the electrode in question to each of its neighbors (If the electrode is a strip, the top and left fields will have the same value, as will the bottom and right pair of fields). The ``Electrode Enabled'' checkbox lets you disable an electrode that is not in use (see A Note About Electrode Numbers).

19.4.3.0.1 Locate Viewers:

The buttons in this section let you quickly send the crosshairs or the view window in the viewer to the electrode selected in the Electrode Arrangement section.

19.4.3.0.2 Attributes:

The Functional Attributes and Electrical Attributes sections are simply groups of pre-set checkboxes that you can use to mark individual electrodes as having certain attributes. If you need to apply a more complex set of attributes, use the electrode attributes function in the Data Tree Manager.

19.4.4 File Menu

The file menu provides features for loading, saving, and exporting your data.

Load The electrode editor loads *.mgrid files, which contain all information about an array of electrodes, including locations (based on the base image, which should be loaded into the viewer as well for visualization purposes).

Save Save an *.mgrid file.

Export You can export a delimited text file that specifies all the values for the electrode array, you can export the electrode array as a surface file (see Chapter 12), or you can generate a new binary image file out of the electrodes, with a single pixel with non-zero value for each electrode. Finally, the ``Export Picked Function'' option saves the intensity value of the image under the electrodes. When electrodes are overlaid on s function image, this is useful in determining if an electrode is on a certain function area.

Close Exit the electrode editor.

19.4.5 Edit Menu

The Edit menu changes what feature of a grid can be edited. This can prevent accidental changes to the gird. You can choose which sets of parameters you want to be able to change during editing by selecting the appropriate editing mode in the Edit menu.

Display Only Mode Disables all editing of electrode locations and attributes. Only for visualization and export.

Only Edit Attributes Disallows placement of electrodes, but allows you to set attributes and properties of individual electrodes.

Full Edit Mode All electrode locations and properties may be set and manipulated.

19.4.5.0.1 Auto-Save:

Automatically saves your work periodically.

19.4.5.0.2 Undo Move Electrode:

Moves the most recently placed electrode back to its previous location. This only works once - it is not cumulative, so you cannot undo multiple placements.

19.4.6 Display Menu

You may not wish to display all electrodes at once, even though they all exist in the file. Thus, there are a few options in the Display menu that allow you to choose which electrodes should be shown.

Show Current: - Only show the electrode grid selected in the ``Grid Information'' section.

Show All - Show all electrode grids.

Show None - Make all grids invisible.

Show Some - Bring up ``Select Grids to Display'' box. A simple dialog appears whenever you select the ( Display | Show Some ) menu option. It contains a list of all electrode grids in the file (from the ``Grid Information'' section of the Patient Info tab). As you select or deselect grids in the list, they will be displayed or made invisible. You can also choose all or none from here.

19.4.6.0.1 Show Grid Lines:

This checkbox menu option allows you to turn the drawing of grid lines between the electrodes on and off.

19.4.6.0.2 Pick and Display Image Function:

This menu option recolors the electrodes based on the color of the voxel on which each electrode is centered. This is useful when the electrodes are shown on a functional image, since different colored functional regions will yield different colored electrodes, allowing you to quickly see which electrodes are sitting in regions of which function.

19.4.6.0.3 Show Attributes:

Brings up a dialog box similar to the ``Select Grids to Display'' dialog. In this case, the list is populated with the attribute categories that have been set for the electrode grids present. Clicking on one will highlight the electrodes that have that attribute. Note that this method of visualizing lets you only view one attribute at a time.

19.4.7 Grid Menu

The Grid Menu provides features for various grid manipulations.

19.4.7.0.1 Grid Color:

This brings up a color selection dialog box that lets you choose the color of the current grid.

19.4.7.0.2 Grid Flip X:

Performs a row flip on the selected electrode grid.

19.4.7.0.3 Grid Flip Y:

Performs a column flip on the selected electrode grid.

19.4.7.0.4 Grid Transpose:

Transposes the electrode grid, switching rows for columns.

19.4.7.0.5 Transform Grid:

Brings up a dialog box in which you can load transformation files, warping the grid into a different space. This functionality has been deprecated by the Data Tree Tool.

19.4.7.0.6 Auto Warp:

If the corners of a grid (ends for a strip electrode) have been placed, this function does a thin-spline transformation, interpolating the locations of the rest of the electrodes in the grid. This is helpful in that it brings the gird approximately into position, allowing you to make further refinements without confounding electrode connections to faraway unplaced electrodes. (In general Auto Wrap automatically detects which electrodes have been moved from their default positions and then uses these to predict the location of the rest of the electrodes.)

19.4.7.0.7 Undo Auto Warp:

Undoes the Auto Warp placing.

19.4.8 Labels Menu

The Labels Menu allows the user to show the numbers of the electrodes.

19.4.8.0.1 Font:

The top section of the Font menu contains a range of options for the font size of the labels that are displayed next to the electrodes. The default is zero, and this is equivalent to turning labeling off.

19.4.8.0.2 Skipping Labels:

If the display looks too crowded with all labels, choose one of the options in the skipping section of the Font menu, which will only label every nth electrode in a grid.

19.4.8.0.3 Labels Color:

This menu option brings up a dialog box in which you can select the color in which to display the labels.

19.4.9 Volume Trace Menu

This menu contains a range of ``VOI Size'' options, from 0 to 25. These set the size of the volume searched for voxels above a threshold which define the region whose centroid is the actual location that the electrode gets placed on. So, when you click on a location in the image, a volume this size centered on this spot is searched for voxels that are above the threshold. The voxels that remain then define a volume whose centroid is calculated. The electrode's final location is on this centroid. Thus, a VOI Size of zero causes electrodes to be placed exactly where you click. Larger sizes create a greater ``snap-to'' effect.
next up previous contents
Next: 20. The VVLink Tool Up: 6 F. Neurosurgery Tools Previous: 6 F. Neurosurgery Tools   Contents