MTrackJ: Manual


MTrackJ


Quick Links


Launching and Quitting MTrackJ

MTrackJ is launched by selecting it from the Plugins menu of ImageJ. This will open the MTrackJ dialog shown below, which is then associated with the currently active image and visually attached to its window. An image can have only one instance of MTrackJ attached to it, but every image can have its own instance of the program, which enables you to work on multiple images at the same time. The program accepts all image types supported by ImageJ and can also handle HyperStacks and Image5D objects.

MTrackJ Dialog

Clear tracks Load tracks Import tracks Save tracks Add tracks Continue tracks Cluster tracks Merge tracks Split tracks Move points Delete items Set reference Set colors Set IDs Measure tracks Make movie Configure tracking Configure displaying Configure program Open manual

At any time, the above dialog window (along with the results and log windows, if open) can be put to front by pressing the F key on the keyboard (when the image window corresponding to the dialog is active). Quitting the program is done by clicking the Close button in the title bar of the dialog.

Below is a description of the functionality provided by each of the dialog buttons. Just click a button in the above image to move directly to its description. If you prefer to first do a basic tracking session to familiarize yourself a little bit with the program before studying its ins and outs, you are referred to the quick start page.


Description of Dialog Buttons

The first four buttons deal with the clearing, loading, and saving of tracks.

Clear tracks Causes all tracks to be deleted. It also resets a number of internal variables and counters to bring the program back to its ground state before starting a new tracking session.

Load tracks Opens a dialog for selecting and loading previously saved tracks. By default, files containing tracks (and additional settings) saved by MTrackJ have the extension ".mdf" (short for MTrackJ data file). Loading a data file causes all current tracks to be deleted. If you have chosen (see the description of the Configure program button) to use the track displaying settings (if any) stored in the file, these settings are loaded too and activated. If not, the displaying settings are restored from ImageJ's preferences file or reset to their default values.

Import tracks Opens a dialog for selecting and importing previously saved tracks. All current tracks are retained and the tracks from the data file are simply added to the set. Only track point coordinates are imported from the data file, any other information (additional settings) included in the file is ignored. The imported tracks form a separate cluster, or multiple clusters if they have been saved as such (see the description of the Cluster tracks button for more information on clustering).

Coordinate offsetting: It is possible to apply an offset to the point coordinates while loading or importing tracks from a data file. This may be useful if you want to display previously generated tracks in a cropped version of the original image sequence. Coordinate offsetting is achieved by pressing the Ctrl key while clicking the Load tracks or Import tracks button, which opens a dialog for specifying the offset for each coordinate. Please note that these offsets will be applied to all subsequently loaded or imported data files, until you explicitly put them back to zero again. Also note that while the dialog accepts floating-point numbers for all dimensions, at load time the resulting t- and c-coordinate values are rounded to the nearest integer index in order to allow visualizing the points in the corresponding frame and channel, respectively. See the description of the MTrackJ data file format for more information on how floating-point coordinates are handled.

Save tracks If the current tracks are not modified from a previously loaded data file, or if they have not been saved previously (in other words, if the program has no idea where to go), clicking this button will open a dialog for specifying the name of a file to save the tracks and additional settings to. If the image title permits (that is, if it does not contain any special characters that are not allowed by the file system), the dialog will propose a file name, which is the image title appended with the ".mdf" (MTrackJ data file) extension. Once a file name has been specified, it is memorized by the program and used by default for subsequent saving actions. To open the dialog again and change the file name, press the Ctrl key while clicking this button.


The following 10 buttons deal with the creation and modification of tracks. Each of the buttons represents a specific modification mode. At most one mode can be active at any time. The currently active button has its text label rendered in red rather than black. In order for any of these modes to work, the Point selections tool of ImageJ must be active (as indicated below). This tool is activated automatically when pressing any of the mode buttons of the MTrackJ dialog.

ImageJ Toolbar

Zooming in or out can be done at any time by pressing, respectively, the + (plus) or - (minus) key (when the image window is active). Scrolling the image canvas can be done by keeping the space bar down while dragging the mouse. These operations can also be carried out using the standard Magnifying glass and Scrolling tool of ImageJ. However, in that case, you need to manually switch back to the Point selections tool afterwards in order to continue.

Add tracks Mode for adding tracks. Tracking is initiated by moving the mouse pointer to a feature of interest in some time frame in the image sequence and pressing the mouse button. The point is then marked by an overlay shape and (by default) the program automatically shows the next frame. A track is formed by pressing the mouse button at the estimated position of the moving feature of interest in subsequent frames. A track is terminated by double clicking the mouse button (less than 200ms between the clicks) or by pressing the Esc key on the keyboard (when the image window is active). A new track is then initiated by moving to another feature of interest in some time frame (you may want to rewind the time index first) and repeating the procedure.

Important notes regarding tracking:

Continue tracks Mode for continuing existing tracks. Move the mouse pointer to the track to be continued, and the program will highlight that track and append its cluster ID (C) and track ID (T) to the information in the status bar. Pressing the mouse button then causes the track to be selected for continuation. This means that the program activates the selected track and automatically switches to the Add tracks mode. Also, it moves the time index to the frame following the frame corresponding to the last point of the track. If, however, the Shift key is down while selecting the track, it moves the time index to the frame preceding the frame corresponding to the first point of the track (for time-reversed tracking).

Cluster tracks Mode for clustering existing tracks. By default, all tracks are added to the default cluster (cluster 1). Move the mouse pointer in the image and the currently active cluster ID (AC) is displayed in the status bar of ImageJ, along with the pointer coordinates and image intensity. If the mouse pointer approaches a track, the program will highlight the track and append its cluster ID (C) and track ID (T) to the information in the status bar. Pressing the mouse button then causes the track to be assigned to the currently active cluster. If the Ctrl key is down while pressing the mouse button, the dialog shown below is opened, which allows specifying the active cluster, which can be an existing cluster or a New cluster.

MTrackJ: Cluster

Any subsequently clicked track is assigned to the lastly selected active cluster. As soon as there is more than one cluster, the program explicitly displays the cluster ID in front of the track ID in the image, in the form C:T.

Merge tracks Mode for merging existing tracks, two at a time. Move the mouse pointer to the first track, and the program will highlight that track and append its cluster ID (C) and track ID (T) to the information in the status bar of ImageJ. Pressing the mouse button then causes the track to be selected as the base track for merging, and it remains highlighted (click the track again if you need to deselect it). Move the mouse pointer to highlight another track (again, the corresponding cluster ID (C) and track ID (T) are displayed in the status bar), and click the mouse button to complete the merging operation.

Important notes: Since a track can have only one point per time frame, any point in the base track for which there exists a point in the secondly clicked track having the same t-coordinate (time index) is replaced by the latter (in the extreme case, when there is full time-overlap, the base track gets completely replaced by the secondly clicked track). Also note, in the case of (multispectral) 3D image sequences, that since a track can be in only one channel, the c-coordinates (channel indices) of the points in the merged track are explicitly set to the channel index of the base track.

Split tracks Mode for splitting an existing track into two tracks, at a given point. Move the mouse pointer to the point at which the track should be split, and the program will highlight that point and append its cluster ID (C), track ID (T), and point ID (P) to the information in the status bar of ImageJ. The program will also display this information in the image, in the form C:T:P (where the C: part is suppressed if there is only one cluster), and it will move the image to the time index, and, in the case of (multispectral) 3D image sequences, also the slice and channel index, corresponding to that point. pressing the mouse button then causes the track to be split at that point into two separate tracks. The first track consists of all points from the first point of the original track up to (not including) the clicked point. The second track consists of all points from the clicked point to the last point (inclusive) of the original track. If the Ctrl key is down while pressing the mouse button, (a copy of) the clicked point is included in both the first and the second track.

Move points Mode for moving (displacing) points of existing tracks, one at a time. Move the mouse pointer to the track point to be displaced, and the program will highlight that point and append its cluster ID (C), track ID (T), and point ID (P) to the information in the status bar of ImageJ. The program will also display this information in the image, in the form C:T:P (where the C: part is suppressed if there is only one cluster), and it will move the image to the time index, and, in the case of (multispectral) 3D image sequences, also the slice and channel index, corresponding to that point. Dragging the mouse then moves the point. Note that only the x-, y-, and (if applicable) the z-coordinate (slice index) can be changed. The t-coordinate (time index) and the c-coordinate (channel index) will remain fixed.

Delete items Mode for deleting points, tracks, or entire clusters. Move the mouse to the point (default), or track (Ctrl key down while moving), or cluster (Ctrl+Shift keys down while moving) to be deleted, and the program will highlight that item and append its corresponding cluster ID (C), track ID (T), and point ID (P) (whichever of these are applicable) to the information in the status bar of ImageJ. In the case of points, the program will also display this information in the image, in the form C:T:P (where the C: part is suppressed if there is only one cluster), and it will move the image to the time index, and, in the case of (multispectral) 3D image sequences, also the slice and channel index, corresponding to that point. Pressing the mouse button then deletes the highlighted item.

Set reference Mode for setting the reference. The reference is a single, landmark point in the image, with respect to which distances can be measured (see the description of the Measure tracks button for more on measuring tracks). Move the mouse pointer in the image to the x- and y-coordinate (and the z-coordinate in the case of (multispectral) 3D image sequences) corresponding to a point of interest. Pressing the mouse button then causes this point to be marked as the reference. The reference point is always displayed highlighted. To redefine the reference, simply press the mouse button at some other position of interest in the image (the point cannot be moved in the same fashion as track points).

Set colors Mode for setting (changing) the colors of tracks. Move the mouse pointer to a track, and the program will highlight that track and append its cluster ID (C) and track ID (T) to the information in the status bar of ImageJ. Pressing the mouse button then opens the dialog shown below.

MTrackJ: Colors

Move the mouse pointer over the colors in the dialog, and the program will list the color in the status bar, in the form (R,G,B) (press the Ctrl key while the dialog is active to see the numbers in hexadecimal form). Pressing the mouse button at any of the colors then causes that color to be assigned to the highlighted track.

Note that this mode can also be used to set the colors of clusters, or of the entire assembly of clusters, if you have selected, respectively, the Clusterwise or Monochrome coloring scheme, rather than the Trackwise coloring scheme, in the dialog associated with the Configure displaying button.

Set IDs Mode for setting (changing) the ID numbers of items (points, tracks, or entire clusters). Any item is assigned a (unique) ID only at the time of its creation. Some operations may introduce gaps in the ID numbers (such as, for example, when a point is deleted from the middle of a track, or a track is deleted from a cluster). To manually change ID numbers (see below for automatic renumbering), move the mouse to the point (default), or track (Ctrl key down while moving), or cluster (Ctrl+Shift keys down while moving) to be renumbered, and the program will highlight that item and append its corresponding cluster ID (C), track ID (T), and point ID (P) (whichever of these are applicable) to the information in the status bar of ImageJ. In the case of points, the program will also display this information in the image, in the form C:T:P (where the C: part is suppressed if there is only one cluster), and it will move the image to the time index, and, in the case of (multispectral) 3D image sequences, also the slice and channel index, corresponding to that point. Pressing the mouse button then opens the dialog below (with the word Point replaced by Track or Cluster where applicable), which shows the current ID number and allows specifying a new number.

MTrackJ: ID

The ID number must be an integer larger than zero. If the entered number is already in use by another item, for example by another point of the same track (when setting a point ID), or by another track of the same cluster (when setting a track ID), or by another cluster of the assembly (when setting a cluster ID), the IDs of the two items are interchanged. To automatically reassign consecutive ID numbers to all items, keep the Ctrl key down while pressing this button, if this mode is already active (red label).


The following two buttons deal with measuring tracks and making movies.

Measure tracks Before you measure tracks, please make sure that the pixel calibration is properly set. This is checked by opening the Image > Properties dialog of ImageJ (you need to check and possibly update only the Unit of Length, Pixel Width, Pixel Height, Voxel Depth, and Frame Interval fields in this dialog). If necessary, intensity calibration (only for 8-bit and 16-bit images) can be set in the Analyze > Calibrate dialog of ImageJ.

Pressing the button then opens the dialog below for specifying what types of measurements are to be displayed (see the description of the MTrackJ data structure to understand the terminology used here):

MTrackJ: Measure

Pressing the OK button in the measurements dialog starts the selected measurements. The result windows are automatically put to front every time this button is pressed. At any time, the result windows (along with the main dialog and the log window) can also be put to front by pressing the F key on the keyboard (when the image window is active).

An example of a point measurement results window is given below. The listed numbers can be saved to disk using the File > Save As menu option of the window. The resulting (tab-delimited) file can then be imported in any spreadsheet program.

MTrackJ: Results

A brief description of the quantities listed:

Measurements for which no sensible value can be determined are marked by NA. For example, for D2R this is the case if the reference point has not been defined, for D2P and v this is always the case for the first point of a track (which has no previous point), and for v this is also the case if the frame interval is 0 (division by zero).

Make movie All graphical items (track points, connecting lines, numbers) are displayed in overlay mode and never become part of the original image data. Pressing the button starts the module for generating a movie (RGB-color type) containing the time frames with the tracks drawn into them. Thus the resulting movie is a "hardcopy" of what you see when moving the time index (scroll bar) of the original image window. This movie can then be saved to disk, for example using the File > Save As > AVI menu item of ImageJ (or a plugin for exporting to some other format), and used later in presentations. Note that the track displaying behavior is highly configurable (see the description of the Configure displaying button). An example of a movie generated this way is shown at the top of this page.

Note that in the case of (multispectral) 3D image sequences, it is naturally impossible to display the correct slice and channel for all track points at the same time index, if there are multiple tracks. Therefore, the slice and channel indices used for movie generation in such cases are fixed to the values of the image window at the time the button is pressed. The only exception to this rule is when there is only a single track. In that case, since there can be only one point per time index, the resulting movie will display the slice and channel corresponding to each point.

In principle, a movie generated by the module has the same duration (number of frames) as the input image sequence. However, when the Ctrl key is down while the button is pressed, the leading and trailing frames of the sequence (that is, the frames for which there are no track points) are omitted from the movie.

The movie module runs in a separate thread in order for ImageJ to remain responsive. It is, however, not possible to edit tracks or their displaying settings during movie generation.


The final four buttons allow configuring the tracking, displaying, and general program behavior, and opening this online manual.

Configure tracking Opens the dialog below for configuring the tracking behavior of the program. The selected tracking options are activated when pressing the OK button of the dialog. They are also stored in ImageJ's preferences file and loaded when restarting the program.

MTrackJ: Tracking

A brief description of the options:

Configure displaying Opens the dialog below for configuring the displaying behavior of the program. The selected displaying options are activated when pressing the OK button of the dialog. They are also stored in ImageJ's preferences file and loaded when restarting the program.

MTrackJ: Displaying

A brief description of the options:

Configure program Opens the dialog below for configuring the general program behavior. The selected program options are activated when pressing the OK button of the dialog. They are also stored in ImageJ's preferences file and loaded when restarting the program.

MTrackJ: Program

A brief description of the options:

Open manual Opens the default internet browser showing this online manual.

Copyright © 1996 - 2010 Erik Meijering