Skip to content

getting started

Jian Tay edited this page Jun 15, 2021 · 7 revisions

Getting Started

This document will help you get up to speed on installing and running the toolbox.

[[TOC]]

Installation

  1. Download the latest version of the toolbox from the Releases page.
  2. Open the toolbox files (*.mltbx). Your system should prompt you to open the files with MATLAB. Select Install.

(Optional) If MATLAB did not launch automatically, try the following steps:

  1. Launch MATLAB
  2. In MATLAB, navigate to the folder where the downloaded toolbox is saved
  3. Open the toolbox by double-clicking the file in the Current Folder panel then select Install.

Checking if toolbox is installed

You can check that the toolbox was correctly installed by clicking on Add-Ons > Manage Add-Ons in the Home tab. The Linear Assignment Tracking toolbox should appear on the list.

Uninstalling

To uninstall the toolbox:

  1. Open the Add-Ons manager by clicking on Add-Ons > Manage Add-Ons in the Home tab
  2. Find the toolbox, and click on ⋮ (vertical ellipsis) to show more options. Select open folder and note the folder location.
  3. Again, click on ⋮ (vertical ellipsis) to show more options and select uninstall.

If you encounter a message saying the some files remain after uninstalling, remove the remaining files by:

  1. Closing MATLAB
  2. Navigate to the Add-Ons/Toolboxes folder (the parent folder from step 2 above) and delete the folder containing the remaining files. The folder should be named after the toolbox.

The default location of the Add-Ons directory is listed here. Alternatively, you can look up the location by clicking on Preferences in the home tab, and then selecting MATLAB > Add-Ons.

Basic Usage

Overview of image analysis pipeline

A typical image analysis pipeline has the following steps:

graph LR
  A[Read image] --> B[Segment objects] --> C[Track objects] --> D[Analyze data]

The code in this toolbox helps with the last two steps (tracking objects and analyzing data). In code, the process would look something like:

%Initialize the LAPLinker object
linker = LAPLinker;

%Adjust properties as necessary
linker.LinkedBy = 'Centroid';  %Link objects by position
linker.LinkCostMetric = 'euclidean'  %Compute straight-line distance 
linker.LinkScoreRange = [0, 50]; %Link objects within 0 - 50 pxs

for frame = 1:numFrames

    %Read in current frame
    I = imread('timelapse.tif', frame);

    %Generate a mask of bright objects
    mask = imbinarize(I);

    %Measure data using regionprops
    data = regionprops(mask, 'Centroid', 'Area');

    %Link objects
    linker = assignToTrack(linker, frame, data);

end

%Get the TrackArray for data analysis
trackData = linker.tracks;

Note: LAPLinker was written to be compatible with the output of MATLAB's built-in regionprops function, i.e. data to be tracked should be a structure array (struct).

Next steps

Help

If you need additional help using the toolbox, please contact us at biof-imaging@colorado.edu.