Previous (Tracking Neutrophils with Matlab 1) / Index / Next (Tracking Neutrophils with Matlab 3)

# Tracking Neutrophils with Matlab: 2

## Contents

## Data Sets generated by the Tracking

The pre-processing read the tiff files, converted them into Matlab files that are stored in a new folder, in this case NeutropTest_mat_Or,
that is, the Original data (Or) in matlab Format (*mat*). If you need to observe this data you can load it into matlab by dragging the files and dropping them in the matlab workspace
(in Macs at least, not sure in windows) or by loading them with the following command:

```
load NeutropTest_mat_Or/T00001.mat
```

The previous line will load the file T00001.mat that is inside the folder NeutropTest_mat_Or. To load any other file, just change the file/folder names. Once loaded, the data will have the name dataIn, and in this case will be a 3D matrix with dimensions [1000 x 1000 x 24] that is 24 images of 1000 x 1000 pixels. You can visualise the data per slices with the command "imagesc":

imagesc (dataIn(:,:,10))

This displays the 10th slice of dataIn. In the same way other slices can be displayed. The folder NeutropTest_mat_Re contains the data that has been reduced in size:

```
load NeutropTest_mat_Re/T00001.mat
imagesc (dataR(:,:,10))
```

Notice that the image is exactly the same, except for the reduced dimensions. NeutropTest_mat_La contains the labelled (an individual label or class assigned to each group of connected pixels)

```
load NeutropTest_mat_La/T00001.mat
imagesc (dataL(:,:,10))
```

## Handles Structure

All the measurements describing the original data and the tracking data is contained in the variable "handles". Again, you can drag and drop from the finder to the workspace of matlab

or you can load it using matlab code:

```
load NeutropTest_mat_Ha/handles.mat
disp (handles)
```

numFrames: 9 rows: 250 cols: 250 levs: 24 minBlob: 10 thresLevel: [2.1054e+03 3.1856e+03] nodeNetwork: [132x31 double] neighNetwork: [9x15 double] reducedNetwork: [9x15 double] linkedNetwork: [9x15 double] finalNetwork: [9x15 double] distanceNetwork: [1x1 struct] finalLabel: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]

The most important fields of handles are "handles.finalNetwork" and "handles.nodeNetwork". finalNetwork is a matrix of dimensions
[length of longest track x number of tracks]. For the example, there are 15 tracks and the longest track spanns 9 time frames,
that is, all the input frames. Each **column** will correspond to one track and the values that are different from zero correspond to the neutrophils at each time frame:

disp (handles.finalNetwork)

Columns 1 through 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 18 16 17 19 20 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 41 40 42 43 44 45 46 47 48 49 50 51 52 53 55 54 56 57 58 61 59 60 62 63 64 65 66 67 69 68 70 71 72 75 73 74 76 77 78 79 80 81 83 82 84 86 87 90 88 89 91 92 93 94 96 95 98 97 99 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 118 121 117 119 122 123 124 125 126 127 128 129 130 132 Column 15 85 100 114 131 0 0 0 0 0

## FinalNetwork

The first track is formed by neutrophils 1, 15, 29, ... That means that the first track is linking, neutrophil 1 at time t=1, neutrophil 15 at time 2 and so on. Track 2 consists of 2, 18, 31, etc. When the matrices are bigger than this example, the way to view the data is to double click on the name of the variable on the workspace, this will open a new window where the data is displayed. This window opens when you double-click on "handles":

You can also double click to open the different fields of handles, this window will open if you click "finalNetwork", and "nodeNetwork":

## NodeNetwork

nodeNetwork is a matrix of dimensions [number of segmented neutrophils x 31]. Each **row** handles.nodeNetwork corresponds to a single neutrophil at a time t. Each row will contain many metrics related to the neutrophil.
The most important ones are:

% Columns [1 - 3] - Position of the centroid [ X Y Z] For example [436.5 77.5 6] % Columns [ 4 ] - Distance to closest neutrophil % Columns [ 5 ] - Time Frame % Columns [ 6 ] - Unique ID of neutrophil % Columns [ 7 ] - * Parent The number here designates which node (above) is part of this track, Parent = 0 no parent, this is the initial node of a track. % Columns [ 8 ] - * Child The number here designates which node (below) is part of this track, Child = 0 no children. % Columns [ 9 ] - Velocity between present and previous frame % Columns [ 10 ] - Volume of Neutrophil % Columns [ 11 ] - Label at time frame as assigned by segmentation This will be used to concatenate tracks but is not the definitive label of the track. % Columns [ 12 ] - Keyhole Region Which region of the keyhole was used to link nodes (1 - circle, 2 - wedge). % Columns [ 13 ] - Track Number of the track to which it belongs. % Columns [ 14 ] - FinalLabel This is the label of the track as assigned after mergers/splits/collisions were detected % Columns [15-20] - BoundingBox [15 - X_init, 16 - Y_init, 17 - Z_init, 18 - size in X, 19 - size in Y, 20 - size in Z ] % Columns [ 26 ] - Volume to surface ratio % Columns [ 27 ] - Sphericity ((pi * 36* Volume^2)^(1/3))/Area as defined in wikipedia. % Columns [ 28 ] - Number of neighbours at different distance brackets (0-10,10-20,20-30,30-40,40-50,50-100, 100-...) arranged as 0*num_0_10 + 10*num_10_20 + 100*num_20_30, ... For example: if a neutrophil has one neutrophil at d=5, 2 neutrophil at d=15 and 3 neutrophil at d=25, and 6 neutrophils at more than 100 pixels then this column value will be 6000321. % Columns [ 30 ] - Distance to disappearing track This column calculates the distance to a track that finished in the previous time frame. If there are no tracks that disappeared in the previous frame, the distance is Inf. % Columns [ 31 ] - Distance to appearing track This column calculates the distance to a track that started in the next time frame. If there are no tracks that appeared in the next frame, the distance is Inf. These two last tracks are used to detect neutrophil collisions. % Columns [ 33 ] - Absolute Distance Per Hop This column calculates the absolute distance that is traversed by a neutrophil per hop between time points. % Columns [ 34 ] - Number of Hops This column calculates the number of hops of the track, i.e. the number of time points it spans. % Columns [ 35 ] - Angle Per Hop This column calculates the orientation angle of each hop that is done by the neutrophils. % Columns [ 36 ] - Lateral Distance Per Hop This column calculates the lateral distance (parallel to the wound) that is traversed by a neutrophil per hop between time points. % Columns [ 37 ] - Effective Distance Per Hop This column calculates the effective distance (perpendicular to the wound) that is traversed by a neutrophil per hop between time points.

The other columns contain data that is used for intermediate functions.

Previous (Tracking Neutrophils with Matlab 1) / Index / Next (Tracking Neutrophils with Matlab 3)