MTrackJ: Manual


MTrackJ


Quick Links


Launching and Quitting

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 Load Import Save Add Cluster Hide Color Delete Move Merge Split Refer ID Measure Movie Tracking Displaying Options Help

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 each of the dialog buttons. 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 set of buttons deal with the clearing, loading, and saving of tracks.

Clear 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 Opens a dialog for selecting and loading previously saved tracks. By default, files containing tracks (and 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 Options 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 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, and any other information (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 button for more information on clustering).

Save 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 settings to. If the image title permits (that is, if it does not contain 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, keep the Alt key down while pressing this button.

Coordinate offsetting: It is possible to apply an offset to the point coordinates while loading, importing, and saving tracks. This may be useful for displaying previously generated tracks in a cropped version of the original image sequence. Coordinate offsets can be specified by keeping the Ctrl key down while pressing the Load, Import, or Save button, which opens the dialog below. Notice that the specified offsets will be applied to all subsequent load, import, and save actions (offsets are remembered separately for each of these actions), until you explicitly put them back to zero again. Also, while the dialog accepts floating-point numbers for all dimensions, for loading and importing 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.

MTrackJ: Offsets


The following buttons deal with the creation and modification of tracks. Each of the buttons represents a specific mode. At most one mode can be active at any time. The currently active button has its text label shown in red. 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.

Add Mode for adding new tracks or continuing existing tracks. A new track is initiated by moving the mouse pointer to a feature of interest 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 position of the moving feature in subsequent frames. A track is terminated by double clicking the mouse button (less than 200ms between clicks) or by pressing the Esc key (when the image window is active). The next track is then initiated by moving to another feature of interest in some frame (you may want to rewind the time index first) and repeating the procedure.

To continue an existing (previously finished) track, move the mouse pointer to the track while keeping the Ctrl key down, 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 activated and the next frame (after the last time index in the track) to be shown. From here on the procedure is the same as for adding new tracks.

Important notes regarding tracking:

Cluster 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.

Hide Mode for (un)hiding tracks or clusters. Move the mouse pointer to the track (default) or cluster (Shift key down while moving) to be hidden, and the program will highlight that object and append its cluster ID (C) and track ID (T) (whichever of these are applicable) to the information in the status bar. Pressing the mouse button then causes the object to be made invisible, but not deleted. Conversely, if the Ctrl key is down while pressing the mouse button, all tracks except the highlighted one(s) will be made invisible. This allows to temporarily exclude (or keep only) specific tracks or clusters for a presentation (see the description of the Movie button on how to make movies) or in making measurements (see the description of the Measure button). Hidden tracks are all made visible again by keeping the Ctrl key down and pressing either the mouse button in an empty area (not containing tracks) in the image, or the Hide button of the dialog. If, in addition to the Ctrl key, the Alt key is also down, the visibility of all tracks is inverted (all hidden tracks are made visible again while all visible tracks are hidden).

Color Mode for 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 causes that color to be assigned to the highlighted track. 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 Per cluster or Monochrome coloring scheme, rather than the Per track coloring scheme, in the dialog associated with the Displaying button.

Delete 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 object 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 (multi-channel) 3D image sequences, also the slice and channel index, corresponding to that point. Pressing the mouse button then deletes the highlighted object.

Move Mode for moving points, tracks, or entire clusters. Move the mouse pointer to the point (default), or track (Ctrl key down while moving), or cluster (Ctrl+Shift keys down while moving) to be displaced, and the program will highlight that object 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 (multi-channel) 3D image sequences, also the slice and channel index, corresponding to that point. Dragging the mouse then moves the highlighted point, track, or cluster. 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) of the moved objects will remain untouched.

Merge 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 (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.

Since a track can have only one point per 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 (multi-channel) 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 Mode for splitting an existing track 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 (multi-channel) 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.

Refer 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 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 (multi-channel) 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 reset 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).

ID Mode for setting (changing) the ID numbers of objects (points, tracks, or entire clusters). Any object 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 object 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 (multi-channel) 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 object, 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 objects are interchanged. To automatically reassign consecutive ID numbers to all objects, keep the Ctrl key down while pressing this button. This works regardless of whether the ID mode is active.


The following buttons deal with measuring tracks and making movies.

Measure Before measuring 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 consider 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 immediately causes the program to perform prespecified measurements. To specify the type of measurements to be performed and displayed, keep the Ctrl key down while pressing the button, which opens the dialog below (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 set, and for D2P, v, α, and θ 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 zero (which would otherwise result in a division by zero in the calculations).

Movie All graphical objects (track points, connecting lines, ID 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 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. The track displaying behavior is highly configurable (see the description of the Displaying button).

Note that in the case of (multi-channel) 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.

By default, the generated movie has the same duration (number of frames) as the input image sequence. However, keeping if the Ctrl key down while pressing the button opens the dialog below, which allows to refine the movie.

MTrackJ: Movie

The movie production 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 production.


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

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:

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:

Options 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: Options

A brief description of the options:

Help Opens the default internet browser showing this online manual.

Copyright © 1996 - 2012 Erik Meijering