Skip to main content
Browse Subject Areas

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

PhagoSight: An Open-Source MATLAB® Package for the Analysis of Fluorescent Neutrophil and Macrophage Migration in a Zebrafish Model

  • Katherine M. Henry , (KMH); (CCRA)

    Affiliation MRC Centre for Developmental and Biomedical Genetics, University of Sheffield, Sheffield, United Kingdom

  • Luke Pase,

    Affiliations Cancer and Haematology Division, Walter and Eliza Hall Institute of Medical Research, Parkville, Australia, Institute of Toxicology and Genetics, Karlsruhe Institute of Technology (KIT), Eggenstein-Leopoldshafen, Germany

  • Carlos Fernando Ramos-Lopez,

    Affiliation Biomedical Engineering Research Group, University of Sussex, Falmer, United Kingdom

  • Graham J. Lieschke,

    Affiliations Cancer and Haematology Division, Walter and Eliza Hall Institute of Medical Research, Parkville, Australia, Department of Medical Biology, University of Melbourne, Parkville, Australia, Australian Regenerative Medicine Institute, Monash University, Clayton, Australia

  • Stephen A. Renshaw,

    Affiliation MRC Centre for Developmental and Biomedical Genetics, University of Sheffield, Sheffield, United Kingdom

  • Constantino Carlos Reyes-Aldasoro (KMH); (CCRA)

    Affiliations Biomedical Engineering Research Group, University of Sussex, Falmer, United Kingdom, Information Engineering and Medical Imaging Group, City University London, London, United Kingdom


Neutrophil migration in zebrafish larvae is increasingly used as a model to study the response of these leukocytes to different determinants of the cellular inflammatory response. However, it remains challenging to extract comprehensive information describing the behaviour of neutrophils from the multi-dimensional data sets acquired with widefield or confocal microscopes. Here, we describe PhagoSight, an open-source software package for the segmentation, tracking and visualisation of migrating phagocytes in three dimensions. The algorithms in PhagoSight extract a large number of measurements that summarise the behaviour of neutrophils, but that could potentially be applied to any moving fluorescent cells. To derive a useful panel of variables quantifying aspects of neutrophil migratory behaviour, and to demonstrate the utility of PhagoSight, we evaluated changes in the volume of migrating neutrophils. Cell volume increased as neutrophils migrated towards the wound region of injured zebrafish. PhagoSight is openly available as MATLAB® m-files under the GNU General Public License. Synthetic data sets and a comprehensive user manual are available from


Multiphoton and confocal fluorescence microscopy, which allow 3D imaging of specimens in vivo with high spatial and temporal resolution, have been widely adopted in the Life Sciences [1], [2] for varied applications including: the observation of microvascular permeability [3]; the assessment of mitochondrial function [4], [5]; examining tumour microcirculation [6] and angiogenesis [7]; and the observation of neutrophil apoptosis and migration [8]. Confocal and multiphoton microscopes capture the intensity value (i) at a specific three dimensional location (x,y,z). This intensity is related to the photons collected at the detector, which are in turn emitted by fluorescent substances in the sample, in response to excitation at specific frequencies (f). As the observation is repeated in time (t), the data become a 5-dimensional matrix i(x,y,z,f,t). Thus, a single experiment can easily generate many gigabytes of information, presenting a significant challenge for data transfer, storage and processing.

Whilst the considerable cost of modern microscopes and the availability of skilled operators has been a limitation for their use in the past, they are now common-place in academic centres, either in dedicated laboratories or as part of core facilities. However, acquisition is only the start of the process, and expertise has lagged for the processing, segmenting, quantification, analysis and interpretation of the wealth of information contained in the very large data sets produced by these microscopes. In many cases, data is acquired at a faster rate than it can be processed and many laboratories require human expert users that spend many hours examining visually the acquired images and videos. Inadvertently, technological advances have shifted the bottleneck of these biomedical experiments from the data generation to the data processing [9], [10]. This is particularly acute where biological models are amenable to manipulation and imaging.

Inflammation is a process critical to life itself, without which multicellular animals could not protect themselves against the threat of competing unicellular microorganisms or tissue injury. Zebrafish larvae have emerged as a key model organism for inflammation studies, with a unique combination of advantages over other model systems for the detailed study of inflammation biology in vivo. Understanding cell migration and interaction is an important part of understanding how immune cells behave during all phases of inflammation in vivo. The optical transparency of zebrafish allows visualisation of physiological and pathological processes in vivo. Genetic manipulations can be easily performed, both to genetically manipulate the inflammatory response and to label individual cell populations with fluorescent markers in vivo [11]. These cell populations can then be observed in high temporal and spatial resolution during inflammation, using multiphoton and confocal microscopy (Fig. 1).

Figure 1. Visualisation of neutrophils in zebrafish.

(a,b) Fluorescent neutrophils (bright uniform regions) migrate towards the site of injury (right) in the tail-fin of a zebrafish larva (differential interference contrast (DIC)) at 3 dpf. (c) One time point of 48 slices each of 1024×1024 pixels. (d) Neutrophils rendered as 3D surfaces.

Many publications related to neutrophils in zebrafish and other models rely on manual processing by an expert [12], [13], [14], [15]. Cell tracking is sometimes performed with commercial systems linked to the acquisition hardware such as Volocity® (Perkin Elmer™, USA) [16], [17] or Imaris® (Bitplane™, Switzerland) [18], [19]. Commercial software is expensive and in some cases lags behind the demands of researchers in the field, as companies develop tools that can be used for a wide variety of experiments and only develop specific algorithms when justified by a large demand from the scientific community. Some of the current limitations of the commercial packages for the analysis of neutrophils in zebrafish are related to the segmentation, which is sometimes performed with a single threshold, which introduces artefacts, or watersheds [20] that are susceptible to over-segmentation problems [21].

Alternatively, researchers often employ programming tools such as MATLAB® (Mathworks™, USA) and the similar freeware options Scilab and Octave, Mathematica® (Wolfram Research™, USA), R, Python or Java™ to develop their own algorithms for specialised analytical purposes e.g. a leukocyte tracking and statistical analysis framework developed in R and Python is presented in [22], [23] and shape-based tracking of cells is presented in [24]. A third option is specialised tracking plug-ins of ImageJ [25] like MTrackJ [26], Particle Tracker [27], TrackMATE [28] or the complete open package ICY [29]. A limitation of both commercial and specialised software is that segmentation algorithms are specific to the visual appearance of the cells and the variation of imaging protocols requires modification of the algorithms [30].

The segmentation of fluorescent phagocytes is complicated due to the complex variations of the shape: a single cell that is active and has expanded pseudopods can have a range of intensities and may be artificially segmented into several unconnected objects. When two cells are close to each other, the gap between can be too small to be distinguished and then two cells can be considered to be a single cell.

To address the challenging task of analysing the motion and shape tracking of neutrophils in zebrafish, we have developed PhagoSight, a series of algorithms in the MATLAB® programming environment. The package provides semi-automated algorithms that read and transform large data sets into MATLAB® format, segment and track phagocytes, and provide a large number of quantitative measurements from which users are able to analyse the behaviour of their data sets. The package performs many pre- and post-processing steps: intensity thresholds are pre-selected based on Otsu’s algorithm [31] which the user then can verify manually if desired. Temporal variation of intensity is analysed as cells that disappear from their tracks and then re-appear a few points later. Collisions of cells are analysed by measuring the volume of cells in time and splitting cells whose volume increases considerably. Finally, as the lack of proofreading and editing tools has been one of the main barriers in adopting automated and semi-automated methods [32] we provide such tools, through which users can evaluate the output of algorithms and correct mistakes that can be visually detected.

A series of synthetic data sets are also provided as a means to evaluate the robustness of the algorithms under different conditions. All the algorithms are released in an open policy under the GNU General Public License, with three main objectives. Firstly, it allows other researchers to use the algorithms and advance their research on neutrophils in zebrafish. Secondly, it allows other researchers to adapt and modify the software to suit their experiments. In turn, this may produce refined algorithms and routines that will be incorporated to the software package that will be improved iteratively. Thirdly, open access software allows independent replication and verification. As experiments become more complex, produce larger volumes of data and rely on proprietary software or code, the replication and verification becomes increasingly difficult [33]. It should be noted that the tracking algorithms that we present are a posteriori tools to be applied to a sequence of images or volumes, and not intended to be used as ‘on-the-fly’ tracking techniques [34].

The algorithms of PhagoSight were tested on synthetic and biological data sets in order to determine the reliability and robustness of the algorithms against noise and sensitivity to the input parameters. Moreover, we use these approaches to test the hypothesis that neutrophils increase their volume as they migrate towards the wound region in a zebrafish model of inflammation.

Experimental Procedures and Data Acquisition

a. Zebrafish

Zebrafish were maintained according to standard protocols [35]. The biological data sets were acquired from transgenic Tg(mpx:eGFP)i114 zebrafish larvae in which neutrophils specifically express Green Fluorescent Protein (GFP) [11]. Tail-fin transection was performed on zebrafish larvae at 3 days post fertilisation (dpf) as previously described [11]. Zebrafish larvae were mounted in low melting point agarose (Sigma) immediately prior to imaging. Multiple larvae were imaged simultaneously using a moving stage. Temperature was maintained by environmental air conditioning at 24°C.

b. Image Acquisition

To assess neutrophil volume, 301 time points of 1000×1000 pixels in 32 slices in the GFP channel (exposure 40 ms) at 5 µm step size and 1 brightfield reference image were captured using an UltraVIEWVoX spinning disk confocal microscope (PerkinElmer Life and Analytical Sciences), scanning once per slice, with a 20×objective NA 0.75 for six injured larvae. Data were acquired using Volocity® 6.0.1 at a rate of 120 time points per hour for 2.5 hours beginning at approximately 0.7 hours post injury. Each 3D stack took approximately 1.4 seconds to acquire. The increased resolution was used to obtain a more reliable measurement of the volume in an area directly anterior to the wound region. Multiple TIFF files were exported from Volocity® and were read and subsequently analysed using PhagoSight.

c. Statistics

Statistical analysis was performed using Prism™ 5.0 (Graphpad Software Inc., San Diego, CA). Differences were considered significant at P<0.05. Measurements obtained with PhagoSight are presented as the mean ± standard error of the mean unless otherwise stated. Linear regression analysis was performed using Prism™ 5.0.

d. Ethical Considerations

Zebrafish studies were performed in accordance with UK Home Office legislation. UK law requires that, where possible, experiments are performed on animals not protected under the Animals (Scientific Procedures) Act. All experiments were performed on unprotected embryos, <5.2 dpf.

Design and Implementation

PhagoSight has been developed taking into account that the end-users may not be expert MATLAB® programmers and therefore combines graphical user interfaces (GUI) and the use of written commands. The input data is stored in a series of folders, one for each time point of observation and it can be either of the following formats: (a) one image for every slice of a 3D stack, (b) one 3D Tiff image or (c) a MATLAB® file which contains a 3D matrix. PhagoSight stores the following intermediate results: original images in MATLAB® format, reduced images, segmented and labelled images and the final results, which are referred to by the term “handles”, in separate folders with the original name and an identifier: e.g. images_mat_Or, images_mat_Re, images_mat_La and images_mat_Ha, are created when the input data is in a folder called images.

a. Pre-processing of the Data

The first pre-processing step is a reduction of the size of data through smoothing and subsampling, which is a common technique to reduce the computational complexity (number of operations and time required to process) of the processing and to reduce the noise of the data. The reduction is obtained by averaging groups of four contiguous voxels on each z-slice; their mean value is then assigned to a voxel in a new image, which will have a reduced number of rows and columns, the number of z-slices remains unchanged. Thus the signal to noise ratio (quality of the image) is improved at the expense of a reduced spatial resolution.

The structure of the input data from microscopes can vary considerably; it is possible to acquire data in several fluorescent or differential interference contrast (DIC) channels, which are then saved at different positions of a single stack of images. In the second pre-processing step, PhagoSight analyses the intensity histograms of each slice of the data and generates an initial estimate of the distribution of the channels. This is based on the observation that fluorescent channels concentrate the majority of the pixels or voxels at low intensity levels, whilst DIC channels have a higher concentration of pixels in the middle intensities and lower numbers of pixels at either end of the intensity range. The user can verify the distribution of the channels through a GUI with the histograms and accept or modify the initial estimate.

Since neutrophils can stretch and change their shape considerably between time points, it is very important to use a segmentation procedure that (a) does not include background as cells and (b) does not over-segment a single cell into several disjointed objects. The third pre-processing step is the definition of the intensity thresholds with double hysteresis threshold inspired by the Schmitt trigger [36]: voxels below a lower threshold are classified as background, and those above a higher threshold are classified as neutrophils. The remaining voxels between these two levels are then classified as neutrophils if they are in contact with voxels above the high threshold, or as background otherwise. Both thresholds are automatically determined using Otsu’s algorithm [31]. Fig. 2 shows the segmentation of a single neutrophil with two thresholds. Since the selection of thresholds can have an impact on the results, a GUI allows the user to verify the accuracy of these threshold levels.

Figure 2. Hysteresis thresholding segmentation of a single neutrophil at five time points.

The region described by low threshold (bright) will contain one or more regions described by the high threshold (dark); if segmented solely with a single high threshold several unconnected regions would arise. A single low threshold would in turn produce more regions of low intensity not shown here.

The final and important pre-processing step analyses the volumes of the neutrophils after the segmentation procedure is complete. The algorithm obtains the distribution of the volumes of all neutrophils at all time points and calculates mean and standard deviation with the objective of detecting outliers in the distribution. A neutrophil whose volume exceeds mean +3× standard deviation of the distribution is assumed to be formed by two neutrophils that are too close to be separated by the segmentation algorithm. Those objects are split into two disjointed objects following a sequential erosion (removal of the voxels at the surface of the object) of the object until the voxels that were bridging the two objects are removed (Fig. 3).

Figure 3. Segmentation of large objects in synthetic (top row) and real (bottom row) data sets.

(a,d) One slice of a 3D stack where one object (box) was considered as an outlier due to its volume. (b,e) A three-dimensional rendering of the object indicates that it is formed by two neutrophils that collided. (c,f) Two new objects after the segmentation.

b. Tracking Algorithm

Following segmentation, individual neutrophils are assigned unique labels. The corresponding results are stored in separate folders with the extension mat_La. The tracking process consists of linking a neutrophil at time t, with the same neutrophil at time t+1. This correlation process is trivial when only one cell is present, but it may be very complicated with more than two neutrophils. To simplify the analysis there are studies that restrict the input data to those cases that contain a single neutrophil [37], [38], [39], while others restrict the conditions of movement so that neutrophils overlap within time points [23], [40], that is, they only analyse data sets with slow movement. Other studies evaluate visually the distinguishable condition of each cell [41] and only process those that satisfy a human operator. PhagoSight does not make any assumptions on the velocities, conditions or number of neutrophils. The fluorescently-labelled neutrophils are tracked with a model-based tracking algorithm [42] adapted from the keyhole tracking algorithm presented in [43]. The algorithm links the objects in contiguous time points to form the tracks by means of a keyhole model, which predicts the most probable landing position of a neutrophil at time t+1 (which we called “child”), from the position in times t (the “parent”), and t−1 (the “grandparent”). The most probable step for a neutrophil that is moving from time t−1 to time t, is to follow the direction of the previous steps with the same velocity to time t+1. Assuming that a child (neutrophil at time t+1) would move with similar direction and velocity as its parent (neutrophil at time t), its landing position can be predicted. Of course, this would not cover changes in speed or turns or random walk-like movements. Two regions of probability where the child neutrophil is most likely to land are therefore defined: a narrow wedge (60° wide) oriented towards the predicted landing position, for straight-moving displacements, and a truncated circle (300°) that complements the wedge, for random-moving displacements, which together resemble a keyhole. The size of the keyhole at t+1 is determined by the distance between times t−1 and t. All segmented neutrophils are examined for possible parent-child relationships within keyholes; when there is more than one possible relationship, the closest to the predicted landing site is assigned.

c. Post-processing

The post­processing steps increase the reliability of the tracks produced through several steps. Firstly, the same keyhole model is used to analyse the movement backwards. That is, the same keyhole model uses child (t+1) and grandchild (t+2) to generate a keyhole at time (t). If the neutrophil of a previous time point lands inside the keyhole, it remains as part of the track, otherwise it is removed. This is especially important for the first link of a track when there is no previous history of movements. Secondly, consecutive labelled points are compared to detect cells that are present at time t−1, absent at time t, and present at t+1, within a certain small region of interest. We consider these cases to be due to cells with low intensity, which due to slight variation in fluorescence over time, are too faint to appear in all time points. For those cases of disappearing cells, an artificial cell is created at time point t as an interpolation of cells at times t−1 and t+1. A subsequent tracking procedure links the two previously disconnected tracks into a single track.

An important post-processing step is to detect collisions between neutrophils since not all cells that collide can be detected as outliers due to their volume. In some cases, when two small neutrophils collide, their volume may not be much larger than a single large neutrophil. To detect two neutrophils that travel towards each other until they are too close to be distinguished as two separate cells, we follow two rules: (a) the volume of a given neutrophil increases considerably and (b) a neighbouring track terminates in the previous time point. In the same way, after a collision, cells may seem to divide. The rules to detect these divisions are the inverse: (a) a decrease in neutrophil volume and (b) one new track starts on the current time point. Unlike in the case of pre-processing, where large volumes are split into two disjointed objects, the collision could involve more than two neutrophils that form one large fluorescent cell. The segmentation of the merged cells is performed with the watershed transformation. The watershed transformation partitions the images into catchment basins or regions of influence of the regional minima. The boundaries between the catchment regions are called watersheds, and are used to segment into the cells that collided. Once those cells are divided, new tracking is performed.

d. Directional Analysis and Measurement Generation

To analyse the directionality of the movement and its nature (fast/slow, uniform/varying velocity, direct/meandering, etc.) a series of measurements based on the tracks are calculated. As such, it is necessary to determine an orientation framework as the tail of the zebrafish can have any orientation within the acquired images. The tail-fin transection, a wound towards which the phagocytes are attracted, is performed at the opposite side of the head of the fish and a wound region is created. We identify manually a region of interest, which corresponds either to the region of the wound, or the corresponding region in an uninjured control larva. We term this the “artificial wound region”. Fig. 4a shows this artificial wound region as a black rectangle overlaid on the DIC image of the tail. This wound region is then used to generate a rotation of the axis with the movement towards the wound as one coordinate axis (c) and lateral movements as the other axis (r) (Fig. 4b). Each movement is analysed as a vectorial projection towards a line perpendicular to the wound. The components of the movement towards and parallel to the wound are considered the oriented distance and lateral distance respectively, and are used to calculate oriented and lateral velocities. The absolute velocity corresponds to the vector sum of the other two components. The oriented movements can be further analysed in terms of how effective they are in moving towards the wound: assigning +1 for movement parallel to the main orientation towards the wound, 0 for movement perpendicular to the main orientation, 1 for perpendicular moving away from the wound and between (1,+1) for any other orientation. In this way, not only the absolute velocity (how fast the cell moved), but also the oriented velocity (how fast it moved towards the wound), effective movements (ratio of displacements between points that move more than a particular threshold) are observed. In a recent publication, PhagoSight was used to compare the speeds of neutrophils in the presence or absence of Cxcl8 [44].

Figure 4. Orientation of the movement based on the artificial wound region.

(a) Three-dimensional plot of the tracks with time as the vertical axis. The DIC image of the fish is presented as a horizontal plane at time 0 and one fluorescent slice is shown at time 120. The black square over the DIC corresponds to the artificial wound region. (b) Description of the absolute, oriented and lateral neutrophil velocities with respect to the axis defined according to a manual delineation of the wound region.

It is of great biological interest to observe the motion of neutrophils towards areas of inflammation. The manually delineated artificial wound region described above allows the determination of several important behaviours, such as the number of neutrophils entering this region and the time they stay within it. It is important to notice that the wound region is manually drawn by the user and thus is subject to intra- and inter-observer variability. Therefore, the size of the wound region can influence measurements such as the arrival of a neutrophil at the wound. When comparing several experiments, we recommend either generating wound regions of the same size, say 100, 120, 150 pixels wide, or performing a sensitivity analysis with wound regions of varying sizes and observing the impact on the measurements. Of course, the size of the wound region will depend on the resolution of the camera, magnification of the microscope and the size of the tail relative to the image. Representative measurements that summarise the behaviour of each cell and/or the whole population of neutrophils in each zebrafish larva included in PhagoSight package are described in Table 1.

Table 1. Computationally derived measurements used to assess neutrophil migration following wounding.

e. Output of the Algorithms

The tracking algorithm produces a series of 4D vectors (x,y,z,t) for each neutrophil. The tracks, and many other measurements, are stored in a single MATLAB® structure called handles. Structures are records that contain several values called fields; for example (x,y,z) coordinates, time points, etc. are stored within handles. The tracks are stored in two fields: handles.nodeNetwork and handles.finalNetwork. nodeNetwork contains the information of each segmented neutrophil; its (x,y,z,t) position and its parent-child relationship with several other measurements. finalNetwork is a matrix with one column for every track, the number of the segmented objects that belong to each track is stored in the columns.

f. Proofreading and Editing Tools and user Manual

Algorithms can perform many tasks with consistency and speed above that of human observers. However, algorithms are not perfect and human observers have superb innate visual processing skills. Therefore, we provide a series of tools that allow users to evaluate the output of the segmentation and tracking process, and if necessary, to correct mistakes. We expect that these tools will lower the adoption barrier of those users who trust their own eyes more than automated solutions [32]. There are three editing functions: delete, merge and break. Delete simply removes a track from the analysis, and should be used with caution so as to not introduce unintentional bias into the analysis. Merge and break are closely related and may be necessary when either the track of a single neutrophil appears as two disjointed tracks or when a neutrophil collision occurs and the tracks follow the neutrophils incorrectly. In those cases, the tracks may be broken and merged according to the users’ visual criteria. Beltman et al. [45] suggest assigning different tracks to a single cell before and after a collision to avoid switching of tracks, and recognise that the splitting of tracks obscures the long-term behaviour of the cell. We consider that the manual breaking and merging of tracks, together with the use of cell volume when analysing the collisions will result in measurements that better reflect the long-term behaviour of cells.

The website contains a comprehensive user’s manual covering an introduction to MATLAB®, segmentation, tracking, data structure, visualisation tools and video generation. Synthetic data sets are also available.

g. Visualisation Tools

PhagoSight provides several visualisation tools. We consider that three-dimensional plots show the kinetic behaviour of the neutrophils in several ways. Firstly, they display the general direction of movement of the cells, in our examples towards the site of injury in general. Secondly, the individual velocity is related to the slope of the lines, horizontal lines correspond to fast-moving cells and vertical ones, to slow or nearly stationary cells. Thirdly, they display how some cells migrate towards the wound (black line overlaid on the DIC in Fig. 4a) and, once there, remain static.


a. Validation of the Algorithms with Synthetic and Biological Data Sets

We validated the segmentation and tracking algorithms of PhagoSight with synthetic and real data sets. The synthetic 3D data sets spanned 98 time points with 11 slices of 275×275 pixels each. Six artificial neutrophils, modelled with anisotropic Gaussian shapes of different orientations, travelled along manually drawn paths that presented different conditions of tortuosity, times to activation and proximity to other neutrophils. An original noiseless data set was corrupted by adding white Gaussian noise of increasing variance to create five noisy data sets with increasing similarity between the neutrophils and the background (Fig. 5). The similarity was reflected by the decreasing values of the Bhattacharyya Distance (BD) [46], [47] (1.61, 1.25, 1, 0.66, 0.45) between the neutrophils and the background. The BD was calculated from the means and variances of the neutrophils and background in the following way [48]:where is the BD between the intensities of neutrophils and background , and are their corresponding means and variances. The corresponding signal-to-noise ratios (SNR) were (25.2, 20.6, 17.4, 13.3, 10.7) dB. We calculated the SNR as 20 × logarithm base 10 of the ratio of root mean squared (RMS) pixel intensity of the neutrophils to the RMS pixel intensity of the background; the RMS was calculated as , where #{n} denotes the number of elements (neutrophils/background), corresponds to the intensity of a given element and corresponds to the average intensity of the set. In addition to these data sets, PhagoSight also contains a series of synthetic data sets with irregular shapes that have been corrupted with Poisson and Gaussian noise, which is a better model of the noise that is associated with multiphoton and confocal microscopy [49], [50]. The irregular shapes were formed by overlapping an isotropic Gaussian, considered as the basic shape, and six isotropic Gaussians whose centres were shifted from the basic shape’s centre by a random distance in x and y. This combination created a more realistic neutrophil gold standard. Then, a combination of Poisson and Gaussian noise was added to the gold standard to create five data sets.

Figure 5. Description of the synthetic data sets.

(a) One slice at t = 26 and the paths of six neutrophils shown as coloured lines. Vertical axis indicates time. (b) Five histograms for background (noise) and neutrophils (signal) for different levels of noise. The separability is indicated by the Bhattacharyya Distance (BD) values: highest BD corresponds to more separable classes (solid lines with no markers) and lowest BD corresponds to less separable classes (solid lines with circle markers). (c) One slice (BD = 1.61, SNR = 25.2 dB) shown as a mesh, intensity corresponds to the vertical axis. (d) One slice (BD = 0.45, SNR = 10.7 dB). The noise can be easily compared between the two data sets.

The real data sets corresponded to nine sets of fluorophore-based imaging leukocytes in zebrafish, one image in the fluorescent channel and one DIC image over 180 time points, with differences in neutrophil numbers (between 4 and 20), shapes, behaviour, and fish models (neutrophil-replete but myeloperoxidase-deficient mutant (durif) and wild-types [51]). The neutrophils were manually tracked during 180 time points to obtain a “gold standard”: each neutrophil was tracked by selecting its centroid at each time point with a custom-based MATLAB® interface.

We defined two measurements of accuracy: (a) distance from the centroids of the automatically tracked neutrophils to those of the gold standard, DAG, and (b) distance from the centroids of the gold standard neutrophils to those of the automatically tracked neutrophils, DGA. It was important to use both measurements, as there could be scenarios with good outcomes in one but not the other measurement. For instance, if the automatic tracking would detect just one very bright neutrophil and discard several faint ones due to a high threshold, DAG would be small as long as the automatic track were close to the gold standard. However, DGA would be large as there would be many tracks in the gold standard with no corresponding automatic tracks. The opposite case, a low threshold that would segment and track all neutrophils correctly, but also include noise and incorrectly track it and fail to distinguish colliding neutrophils, would result a low DGA as the gold standard tracks were close to the automatic ones, but a high DAG, due to all the incorrect tracks.

For both real and synthetic cases, we modified the thresholds from 40% to 140% from the automatically detected thresholds to test the robustness against variation of that input parameter. As expected, the errors increased toward the extreme values (Fig. 6). However, the results were fairly stable for the range of threshold values between 60% and 140%. In the synthetic sets, it was only high levels of noise that increased the distances; the errors arose from low thresholds that segmented noise as neutrophils incorrectly. For the real data sets, the thresholds between 80%140% provided stable results of DAG. DGA on the other hand, increased with the thresholds, which indicated that the manual tracking followed faint neutrophils, which were not detected by the algorithms. Fig. 7 illustrates both sets of tracks for one synthetic set with the threshold levels at 140% from the automatic levels (a), and one real set with thresholds at 60% (b) and 140% (c). Thick solid lines correspond to the automatic tracks and thin dashed lines to the gold standard. It is interesting to notice first, that the automatic tracks are very close to the manual tracks in both data sets when high thresholds were selected. Second, it can be observed that faint neutrophils were tracked manually (solid arrows) and are even difficult to see to a human observer. These neutrophils were not detected when the thresholds were raised and thus the error in DGA increased. Third, when low thresholds were selected, besides the tracks corresponding to the faint neutrophils, there were other tracks that either correspond to noise or to a neutrophil that was not captured in the manual tracking (dashed arrows). As an indication of the computational complexity, the time to process one of the real data sets, from reading the images to producing the handles was approximately 20 seconds.

Figure 6. Validation of the algorithms with synthetic and real data sets.

In all cases the sets were automatically tracked with PhagoSight; input thresholds were automatically determined and then modified from 40% to 140% of the original values to test the robustness against variation of that input parameter. (a) Distance from the automatically generated tracks to the gold standard (DAG) for the synthetic data set, BD corresponds to the Bhattacharyya distance between background and neutrophils. (b) Distance from the gold standard to the automatically generated tracks (DGA) for the synthetic data set. (c) DAG for the real data set, (d) DGA for the real data set. High distances for the synthetic sets are due to low thresholds that interpret noise as neutrophils. The increase in DGA in (d) is caused by higher levels that do not detect faint neutrophils, this in turn will reduce DAG as with the higher threshold, the neutrophils which are detected are the brightest and thus the tracking is more precise.

Figure 7. Comparison of automatic tracks against the gold standard.

A synthetic data set is shown in (a) whilst (b,c) are real data sets. In (a,c) the thresholds are 140% of the automatically detected values, while for (b) they are 60% of the detected values. The automatic tracks are displayed as thick solid lines and the gold standard as thin dashed lines, and one slice of the intensity data sets is presented with the tracks. In the real data set, the high thresholds prevented the low intensity neutrophils from being detected (solid arrows) and therefore no tracks were generated for these neutrophils with corresponding high DGA. With lower thresholds, the faint neutrophils were detected, and other neutrophils were also tracked (dashed arrow), this track could have been generated by noise or could have been missed during the manual tracking. It should be noticed that where PhagoSight detected the neutrophils, the tracks are very close to the gold standard.

We compared the tracking results of PhagoSight against the open-source software ICY [29] for one synthetic data set (highest noise) (Fig. 8a,b) and one real data set (set number 6), (Fig. 8c,d). In ICY we used the plug-in “Spot Detector”, with “Bright spots over dark background” and filtering with “Size Filtering” with increasing sizes as noise had a very strong impact on the detection and subsequent tracking. Then we used the “Probabilistic Particle Tracker” plug-in with “Single motion model”, “Brownian motion” and “Maximum likelihood association”. We observed similar behaviours when modifying the size of the filter as the variation of the thresholds. A small filter that allows small objects to be segmented and tracked generated a large number of tracks; some of these tracks were close to the gold standard and thus DGA was low but DAG was high. As the size of the filter increased, the number of objects decreased; DAG also decreased as DGA increased. These trends were present in both synthetic and real data sets and the errors were comparable in both cases.

Figure 8. Comparison of the segmentation and tracking results against ICY for one synthetic and one real data set.

In ICY, “size filter” was used with increasing values of size; PhagoSight input thresholds were automatically determined and then modified from 40% to 140% of the original. (a) Synthetic data set tracked with ICY, (b) Synthetic data set tracked with PhagoSight, (c) Real data set tracked with ICY, (d) Real data set tracked with PhagoSight. Solid line and circle markers corresponds to distance from the automatically generated tracks to the gold standard (DAG) and dotted line with square markers corresponds to the distance from the gold standard to the automatically generated tracks (DGA).

b. Relationship between Neutrophil Volume and Recruitment to Sites of Tissue Injury

Cell volume has been suggested to be a measure of neutrophil activation [52] but it is difficult to assess changes in neutrophil volume during cell recruitment in vivo. Long unbroken tracks are required to relate the volume of individual cells to their longitudinal position. The advantages of using PhagoSight for volume analysis are (a) the hysteresis segmentation with post-processing to split large volumes formed by several cells either as static clumps of cells at the site of injury or due to a collision during migration, (b) the keyhole model of movement used for tracking instead of a nearest cell which is commonly used [22], together with the collision analysis that rendered more reliable tracks, (c) the proofreading tools which allow the manual correction of errors in tracking, and finally, (d) the removal of single random cells not part of any track, which would bias the measurements, i.e. a single object that appears at only one frame and then disappears is not taken into account for future calculations. We therefore measured the volume of migratory neutrophils whose tracks spanned more than 15 minutes (30 time points) and had an absolute velocity ≥ 0.68 µm/min (2 pixels/time point) using PhagoSight. These criteria allowed us to analyse neutrophils migrating towards the site of injury with long enough tracks to characterise the relationship between volume and proximity to the site of injury, and to exclude a confounding effect of groups of cells at the wound edge. The data were expressed as volume against relative position in the field of view. The field of view was split into 25 adjacent regions each containing 20 MATLAB® columns, with higher numbers denoting neutrophils closer to the wound region. The volume was averaged in each band and normalised to the mean of the data set for each larva, which were then pooled in the final analysis.

Neutrophil volume increased as neutrophils travelled towards the site of injury (Fig. 9). The increase was confirmed by linear regression analysis that showed the slope is significantly non-zero (n = 6, P<0.0001, r2 = 0.21). This strongly supports the hypothesis that neutrophil volume increases as neutrophils are recruited to the wound, and suggests that dynamic changes in volume analysed in this way might be a reliable measure of neutrophil activation. To investigate the sensitivity of the volume/position relationship to threshold levels, we ran the analysis with two sets of thresholds: a higher set (analysis A) and a lower set (analysis B). In both analyses, the volume of the neutrophils increased as they migrated towards the wound region (Fig. 9). Linear regression analysis showed that the slope for both analyses was significantly non-zero (n = 6, P<0.0001, r2 = 0.21).

Figure 9. Mean neutrophil volume relative to its position in an area anterior to the wound region.

The field of view was split into 25 adjacent regions each containing 20 MATLAB® columns, with higher numbers denoting neutrophils closer to the wound region. The volume was averaged in each band and normalised to the mean of the data set for each larva, which were then pooled in the final analysis. Two sets of thresholds were used. Analysis A uses higher thresholds than analysis B.


Here we present PhagoSight, an open-source MATLAB® package of algorithms written for the analysis of immune cells as observed with confocal or multiphoton microscopes.

We used PhagoSight to demonstrate an increase in neutrophil volume when migrating towards a wound region in vivo. To our knowledge, this phenomenon has not previously been demonstrated from observations made directly in vivo, thus simultaneously demonstrating both the power of our zebrafish model and of PhagoSight to detect biological phenomena. The change in cell shape as neutrophils migrate towards the wound would only affect the volume measurement if there was a significant change in fluorescent intensity over time. This does not appear to be an issue in our data set, as if this were the case, cell volume would decrease towards the wound, in contrast to the increase in neutrophil volume that we observe. Previously, the volume of neutrophils has been measured using the mass of cells established by transmission electron microscopy [53] or using the diameter of neutrophils measured using a micropipette of known size [54]. Reconstruction of confocal sections of images of human neutrophils migrating through a collagen gel matrix have also been used to measure volume in vitro [55]. Despite being unable to calculate neutrophil volume accurately in vivo in the past, several studies in vitro have highlighted the importance of changes in volume for the migratory capacity of neutrophils [55], [56], [57].

Neutrophil volume increases due to an influx of water as the cell membranes extend to form pseudopods, which allow the neutrophil to migrate towards a site of injury or infection [55]. Rosengren et al. [55] demonstrated that human neutrophils increase in volume when exposed to a concentration gradient of a stimulating substance, but did not significantly increase in volume when stimulated by a single concentration of the same substance. Aquaporins have been shown to play a crucial role in this process. Karlsson et al. [57] demonstrated that phosphorylation of aquaporin 9 and its translocation to the cell membrane was necessary for the activation and migration of primary human neutrophils.

PhagoSight, like other algorithms, has limitations, for example: when a collision is detected between two neutrophils, the segmentation performed by PhagoSight is rather good as judged by a visual observation. However, when neutrophils start to accumulate at the wound, the collision may involve three or more neutrophils, and the higher the number of neutrophils, the higher the likelihood of performing an incorrect segmentation. A second limitation is related to the speed at which the cells move from time point to time point. When a cell jumps a distance several times its size, and, very importantly, there are other cells in the vicinity, it can also create errors in the tracks. For those cases, the possibility of manual intervention is useful as a user can perform track corrections. However, in most of the data sets that we tracked for this paper, both synthetic and biological, and other published results [44], [51], [58], PhagoSight provided satisfactory results with minimum human intervention. Another important issue to note, is that some of the measurements derived from the data sets are dependent on an arbitrarily defined “wound region”, a wider wound region could imply that more neutrophils enter the wound and the reverse would happen with a narrower region.


We have developed PhagoSight for the tracking of immune cells in a zebrafish model, although there is broad applicability of these approaches. We have demonstrated the potential of our algorithm to detect parameters of biological significance and have described the additional parameters available in PhagoSight which may be of value in understanding the complex behaviour of immune cells in future studies.

Author Contributions

Conceived and designed the experiments: KMH LP GJL SAR CCRA. Performed the experiments: KMH LP CCRA. Analyzed the data: KMH CCRA. Wrote the paper: KMH CCRA. Wrote the software, website, user manual and version control: CCRA CFRL. Critical reading of the manuscript: LP GJL SAR.


  1. 1. Masters BR, So PTC (2004) Antecedents of two-photon excitation laser scanning microscopy. Micros Res Tech 63: 3–11.
  2. 2. König K (2000) Multiphoton microscopy in life sciences. J Microsc 200: 83–104.
  3. 3. Reyes-Aldasoro CC, Wilson I, Prise VE, Barber PR, Ameer-Beg SM, et al. (2008) Estimation of apparent tumor vascular permeability from multiphoton fluorescence microscopic images of P22 rat sarcomas in vivo. Microcirculation 15: 65–79.
  4. 4. Theruvath TP, Zhong Z, Pediaditakis P, Ramshesh VK, Currin RT, et al. (2008) Minocycline and N-methyl-4-isoleucine cyclosporin (NIM811) mitigate storage/reperfusion injury after rat liver transplantation through suppression of the mitochondrial permeability transition. Hepatology 47: 236–246.
  5. 5. Zhong Z, Theruvath TP, Currin RT, Waldmeier PC, Lemasters JJ (2007) NIM811, a mitochondrial permeability transition inhibitor, prevents mitochondrial depolarization in small-for-size rat liver grafts. Am J Transplantation 7: 1103–1111.
  6. 6. Lunt SJ, Gray C, Reyes-Aldasoro CC, Matcher S, Tozer GM (2010) Application of Intravital Microscopy in Studies of Tumour Microcirculation. J Biomed Optics 15: 11113.
  7. 7. Tozer GM, Akerman S, Cross N, Barber PR, Bjorndahl M, et al. (2008) Blood Vessel Maturation and Response to Vascular-Disrupting Therapy in Single Vascular Endothelial Growth Factor-A Isoform–Producing Tumors. Cancer Res 68: 2301–2311.
  8. 8. Elks PM, van Eeden FJ, Dixon G, Wang X, Reyes-Aldasoro CC, et al. (2011) Activation of Hif-1alpha delays inflammation resolution by promoting neutrophil persistence in a zebrafish inflammation model. Blood 118: 712–722.
  9. 9. Halbritter F, Vaidya HJ, Tomlinson SR (2012) GeneProf: analysis of high-throughput sequencing experiments. Nat Methods 9: 7–8.
  10. 10. Domon B, Aebersold R (2006) Challenges and opportunities in proteomics data analysis. Mol Cell Proteomics 5: 1921–1926.
  11. 11. Renshaw SA, Loynes CA, Trushell DM, Elworthy S, Ingham PW, et al. (2006) A transgenic zebrafish model of neutrophilic inflammation. Blood 108: 3976–3978.
  12. 12. Xu N, Lei X, Liu L (2011) Tracking neutrophil intraluminal crawling, transendothelial migration and chemotaxis in tissue by intravital video microscopy. J Vis Exp.
  13. 13. Kreisel D, Nava RG, Li W, Zinselmeyer BH, Wang B, et al. (2010) In vivo two-photon imaging reveals monocyte-dependent neutrophil extravasation during pulmonary inflammation. Proc Natl Acad Sci USA 107: 18073–18078.
  14. 14. Murphy CT, Moloney G, Hall LJ, Quinlan A, Faivre E, et al. (2010) Use of bioluminescence imaging to track neutrophil migration and its inhibition in experimental colitis. Clin Exp Immunol 162: 188–196.
  15. 15. Yoo SK, Starnes TW, Deng Q, Huttenlocher A (2011) Lyn is a redox sensor that mediates leukocyte wound attraction in vivo. Nature 480: 109–112.
  16. 16. Henrickson SE, Mempel TR, Mazo IB, Liu B, Artyomov MN, et al. (2008) T cell sensing of antigen dose governs interactive behavior with dendritic cells and sets a threshold for T cell activation. Nat Immunology 9: 282–291.
  17. 17. Textor J, Peixoto A, Henrickson SE, Sinn M, von Andrian UH, et al. (2011) Defining the quantitative limits of intravital two-photon lymphocyte tracking. Proc Natl Acad Sci USA 108: 12401–12406.
  18. 18. Moreau HD, Lemaitre F, Terriac E, Azar G, Piel M, et al. (2012) Dynamic in situ cytometry uncovers T cell receptor signaling during immunological synapses and kinapses in vivo. Immunity 37: 351–363.
  19. 19. Mandl JN, Liou R, Klauschen F, Vrisekoop N, Monteiro JP, et al. (2012) Quantification of lymph node transit times reveals differences in antigen surveillance strategies of naive CD4+ and CD8+ T cells. Proc Natl Acad Sci USA 109: 18036–18041.
  20. 20. Calvo CF, Fontaine RH, Soueid J, Tammela T, Makinen T, et al. (2011) Vascular endothelial growth factor receptor 3 directly regulates murine neurogenesis. Gen Develop 25: 831–844.
  21. 21. Grau V, Mewes AU, Alcaniz M, Kikinis R, Warfield SK (2004) Improved watershed transform for medical image segmentation using prior information. IEEE Trans Med Imaging 23: 447–458.
  22. 22. Liepe J, Taylor H, Barnes CP, Huvet M, Bugeon L, et al. (2012) Calibrating spatio-temporal models of leukocyte dynamics against in vivo live-imaging data using approximate Bayesian computation. Integrat Biol 4: 335–345.
  23. 23. Taylor HB, Liepe J, Barthen C, Bugeon L, Huvet M, et al.. (2012) P38 and JNK have opposing effects on persistence of in vivo leukocyte migration in zebrafish. Immunol Cell Biol.
  24. 24. Fiole D, Touvrey C, Quesnel-Hellmann A, Douady J, Tournier JN (2012) Shape-based tracking allows functional discrimination of two immune cell subsets expressing the same fluorescent tag in mouse lung explant. PLoS One 7: e39831.
  25. 25. Collins TJ (2007) ImageJ for microscopy. Biotechniques 43: 25–30.
  26. 26. Meijering E, Dzyubachyk O, Smal I (2012) Methods for cell and particle tracking. Meth Enzymology 504: 183–200.
  27. 27. Sbalzarini IF, Koumoutsakos P (2005) Feature point tracking and trajectory analysis for video imaging in cell biology. J Struct Biology 151: 182–195.
  28. 28. Schindelin J, Arganda-Carreras I, Frise E, Kaynig V, Longair M, et al. (2012) Fiji: an open-source platform for biological-image analysis. Nat Methods 9: 676–682.
  29. 29. de Chaumont F, Dallongeville S, Chenouard N, Herve N, Pop S, et al. (2012) Icy: an open bioimage informatics platform for extended reproducible research. Nat Methods 9: 690–696.
  30. 30. Winter M, Wait E, Roysam B, Goderie SK, Ali RA, et al. (2011) Vertebrate neural stem cell segmentation, tracking and lineaging with validation and editing. Nat Protocols 6: 1942–1952.
  31. 31. Otsu N (1979) A Threshold selection method from gray level histograms. IEEE Trans Syst Man Cybern 9: 62–66.
  32. 32. Ground-truth data cannot do it alone. Nat Methods 8: 885–885.
  33. 33. Nielsen TA, Nilsson H, Matheson T (2012) A formal mathematical framework for physiological observations, experiments and analyses. J R Soc Interface 9: 1040–1050.
  34. 34. Hellriegel C, Gratton E (2009) Real-time multi-parameter spectroscopy and localization in three-dimensional single-particle tracking. J R Soc Interface 6: S3–S14.
  35. 35. Nusslein-Volhard C, Dahm R (2002) Zebrafish: A Practical Approach. New York: Oxford University Press.
  36. 36. Schmitt OH (1938) A thermionic trigger. J Scientific Instrum 15: 24–26.
  37. 37. Cui J, Acton ST, Lin Z (2006) A Monte Carlo approach to rolling leukocyte tracking in vivo. Med Image Anal 10: 598–610.
  38. 38. Tam J, Roorda A (2011) Speed quantification and tracking of moving objects in adaptive optics scanning laser ophthalmoscopy. J Biomed Opt 16: 036002.
  39. 39. Walters KB, Dodd ME, Mathias JR, Gallagher AJ, Bennin DA, et al. (2009) Muscle degeneration and leukocyte infiltration caused by mutation of zebrafish Fad24. Dev Dyn 238: 86–99.
  40. 40. Sirakov NM, Kojouharov H, Sirakova NN (2010) Tracking neutrophil cells by active contours with coherence and boundary improvement filter. In IEEE Image Analysis & Interpretation (SSIAI), 2010 IEEE Southwest Symposium on, Texas, USA. Accessed 23 July 2013.
  41. 41. Mathias JR, Perrin BJ, Liu TX, Kanki J, Look AT, et al. (2006) Resolution of inflammation by retrograde chemotaxis of neutrophils in transgenic zebrafish. J Leukoc Biol 80: 1281–1288.
  42. 42. Reyes-Aldasoro CC, Zhao Y, Coca D, Billings SA, Kadirkamanathan V, et al. Analysis of immune cell function using in vivo cell shape analysis and tracking. In: 4th IAPR Int Conf Patt Recog Bioinformatics 2009 7–9 September; Shef, UK. Available Accessed 23July 2013.
  43. 43. Reyes-Aldasoro CC, Akerman S, Tozer GM (2008) Measuring the velocity of fluorescently labelled red blood cells with a keyhole tracking algorithm. J Microsc 229: 162–173.
  44. 44. de Oliveira S, Reyes-Aldasoro CC, Candel S, Renshaw SA, Mulero V, et al. (2013) Cxcl8 (IL-8) Mediates Neutrophil Recruitment and Behavior in the Zebrafish Inflammatory Response. J Immunol 190: 4349–59.
  45. 45. Beltman JB, Maree AF, de Boer RJ (2009) Analysing immune cell migration. Nat Rev Immunology 9: 789–798.
  46. 46. Kailath T (1967) The Divergence and Bhattacharyya Distance Measures in Signal Selection. IEEE Trans Commun Tech 15: 52–60.
  47. 47. Reyes-Aldasoro CC, Bhalerao A (2006) The Bhattacharyya space for feature selection and its application to texture segmentation. Patt Recognit 39: 812–826.
  48. 48. Coleman GB, Andrews HC (1979) Image Segmentation by Clustering. Proc IEEE 67: 773–785.
  49. 49. Zhang B (2007) Contributions à la microscopie à fluorescence en imagerie biologique : modélisation de la PSF, restauration d’images et détection super-résolutive. PhD Thesis, Paris: École Nationale Supérieure des Télécommunications.
  50. 50. Luisier F (2010) The SURE-LET Approach to Image Denoising. PhD Thesis, Lausanne: École Polytechnique Fédérale de Lausanne.
  51. 51. Pase L, Layton JE, Wittmann C, Ellett F, Nowell CJ, et al. (2012) Neutrophil-delivered myeloperoxidase dampens the hydrogen peroxide burst after tissue wounding in zebrafish. Curr Biology : CB 22: 1818–1824.
  52. 52. Loitto VM, Forslund T, Sundqvist T, Magnusson KE, Gustafsson M (2002) Neutrophil leukocyte motility requires directed water influx. J Leukoc Biol 71: 212–222.
  53. 53. Schmidschonbein GW, Shih YY, Chien S (1980) Morphometry of Human-Leukocytes. Blood 56: 866–875.
  54. 54. Tingbeall HP, Needham D, Hochmuth RM (1993) Volume and Osmotic Properties of Human Neutrophils. Blood 81: 2774–2780.
  55. 55. Rosengren S, Henson PM, Worthen GS (1994) Migration-Associated Volume Changes in Neutrophils Facilitate the Migratory Process in-Vitro. Am J Physiology-Cell Physiology 267: C1623–C1632.
  56. 56. Ritter M, Schratzberger P, Rossmann H, Woll E, Seiler K, et al. (1998) Effect of inhibitors of Na+/H+-exchange and gastric H+/K+ ATPase on cell volume, intracellular pH and migration of human polymorphonuclear leucocytes. B J Pharmacol 124: 627–638.
  57. 57. Karlsson T, Glogauer M, Ellen RP, Loitto VM, Magnusson KE, et al. (2011) Aquaporin 9 phosphorylation mediates membrane localization and neutrophil polarization. J Leukoc Biol 90: 963–973.
  58. 58. Kadirkamanathan V, Anderson SR, Billings SA, Zhang XL, Holmes GR, et al.. (2012) The Neutrophil’s Eye-View: Inference and Visualisation of the Chemoattractant Field Driving Cell Chemotaxis In Vivo. PLoS One 7 e35182. doi:10.1371/journal.pone.0035182.