<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1d3 20150301//EN" "http://jats.nlm.nih.gov/publishing/1.1d3/JATS-journalpublishing1.dtd">
<article article-type="research-article" dtd-version="1.1d3" xml:lang="en" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="nlm-ta">PLoS Comput Biol</journal-id>
<journal-id journal-id-type="publisher-id">plos</journal-id>
<journal-id journal-id-type="pmc">ploscomp</journal-id>
<journal-title-group>
<journal-title>PLOS Computational Biology</journal-title>
</journal-title-group>
<issn pub-type="ppub">1553-734X</issn>
<issn pub-type="epub">1553-7358</issn>
<publisher>
<publisher-name>Public Library of Science</publisher-name>
<publisher-loc>San Francisco, CA USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">PCOMPBIOL-D-17-00099</article-id>
<article-id pub-id-type="doi">10.1371/journal.pcbi.1005530</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Research Article</subject>
</subj-group>
<subj-group subj-group-type="Discipline-v3"><subject>Biology and life sciences</subject><subj-group><subject>Developmental biology</subject><subj-group><subject>Life cycles</subject><subj-group><subject>Larvae</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Biology and life sciences</subject><subj-group><subject>Physiology</subject><subj-group><subject>Biological locomotion</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Medicine and health sciences</subject><subj-group><subject>Physiology</subject><subj-group><subject>Biological locomotion</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Experimental organism systems</subject><subj-group><subject>Model organisms</subject><subj-group><subject>Caenorhabditis elegans</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Model organisms</subject><subj-group><subject>Caenorhabditis elegans</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Experimental organism systems</subject><subj-group><subject>Animal models</subject><subj-group><subject>Caenorhabditis elegans</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Biology and life sciences</subject><subj-group><subject>Organisms</subject><subj-group><subject>Animals</subject><subj-group><subject>Invertebrates</subject><subj-group><subject>Nematoda</subject><subj-group><subject>Caenorhabditis</subject><subj-group><subject>Caenorhabditis elegans</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Experimental organism systems</subject><subj-group><subject>Model organisms</subject><subj-group><subject>Drosophila melanogaster</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Model organisms</subject><subj-group><subject>Drosophila melanogaster</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Experimental organism systems</subject><subj-group><subject>Animal models</subject><subj-group><subject>Drosophila melanogaster</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Biology and life sciences</subject><subj-group><subject>Organisms</subject><subj-group><subject>Animals</subject><subj-group><subject>Invertebrates</subject><subj-group><subject>Arthropoda</subject><subj-group><subject>Insects</subject><subj-group><subject>Drosophila</subject><subj-group><subject>Drosophila melanogaster</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Experimental organism systems</subject><subj-group><subject>Model organisms</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Model organisms</subject></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Engineering and technology</subject><subj-group><subject>Signal processing</subject><subj-group><subject>Image processing</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Computer and information sciences</subject><subj-group><subject>Computer software</subject></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Physical sciences</subject><subj-group><subject>Mathematics</subject><subj-group><subject>Applied mathematics</subject><subj-group><subject>Algorithms</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3"><subject>Research and analysis methods</subject><subj-group><subject>Simulation and modeling</subject><subj-group><subject>Algorithms</subject></subj-group></subj-group></subj-group></article-categories>
<title-group>
<article-title>FIMTrack: An open source tracking and locomotion analysis software for small animals</article-title>
<alt-title alt-title-type="running-head">FIMTrack: Tracking and locomotion analysis software for small animals</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" equal-contrib="yes" xlink:type="simple">
<contrib-id authenticated="true" contrib-id-type="orcid">http://orcid.org/0000-0001-5691-4029</contrib-id>
<name name-style="western">
<surname>Risse</surname> <given-names>Benjamin</given-names></name>
<xref ref-type="aff" rid="aff001"><sup>1</sup></xref>
</contrib>
<contrib contrib-type="author" equal-contrib="yes" xlink:type="simple">
<name name-style="western">
<surname>Berh</surname> <given-names>Dimitri</given-names></name>
<xref ref-type="aff" rid="aff002"><sup>2</sup></xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<name name-style="western">
<surname>Otto</surname> <given-names>Nils</given-names></name>
<xref ref-type="aff" rid="aff003"><sup>3</sup></xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<contrib-id authenticated="true" contrib-id-type="orcid">http://orcid.org/0000-0002-6349-5800</contrib-id>
<name name-style="western">
<surname>Klämbt</surname> <given-names>Christian</given-names></name>
<xref ref-type="aff" rid="aff003"><sup>3</sup></xref>
</contrib>
<contrib contrib-type="author" corresp="yes" xlink:type="simple">
<contrib-id authenticated="true" contrib-id-type="orcid">http://orcid.org/0000-0001-7678-9528</contrib-id>
<name name-style="western">
<surname>Jiang</surname> <given-names>Xiaoyi</given-names></name>
<xref ref-type="aff" rid="aff002"><sup>2</sup></xref>
<xref ref-type="corresp" rid="cor001">*</xref>
</contrib>
</contrib-group>
<aff id="aff001">
<label>1</label>
<addr-line>School of Informatics, University of Edinburgh, Edinburgh, Scotland, United Kingdom</addr-line>
</aff>
<aff id="aff002">
<label>2</label>
<addr-line>Faculty of Mathematics and Computer Science, University of Münster, Münster, Germany</addr-line>
</aff>
<aff id="aff003">
<label>3</label>
<addr-line>Department of Behaviour and Neuronal Biology, University of Münster, Münster, Germany</addr-line>
</aff>
<contrib-group>
<contrib contrib-type="editor" xlink:type="simple">
<name name-style="western">
<surname>Poisot</surname> <given-names>Timothée</given-names></name>
<role>Editor</role>
<xref ref-type="aff" rid="edit1"/>
</contrib>
</contrib-group>
<aff id="edit1">
<addr-line>Universite de Montreal, CANADA</addr-line>
</aff>
<author-notes>
<fn fn-type="conflict" id="coi001">
<p>The authors have declared that no competing interests exist.</p>
</fn>
<fn fn-type="con">
<p>
<list list-type="simple">
<list-item>
<p><bold>Conceptualization:</bold> BR DB NO CK XJ.</p>
</list-item>
<list-item>
<p><bold>Data curation:</bold> BR DB NO CK XJ.</p>
</list-item>
<list-item>
<p><bold>Resources:</bold> CK XJ.</p>
</list-item>
<list-item>
<p><bold>Software:</bold> BR DB.</p>
</list-item>
<list-item>
<p><bold>Validation:</bold> BR DB NO.</p>
</list-item>
<list-item>
<p><bold>Writing – original draft:</bold> BR DB NO CK XJ.</p>
</list-item>
</list>
</p>
</fn>
<corresp id="cor001">* E-mail: <email xlink:type="simple">xjiang@uni-muenster.de</email></corresp>
</author-notes>
<pub-date pub-type="collection">
<month>5</month>
<year>2017</year>
</pub-date>
<pub-date pub-type="epub">
<day>11</day>
<month>5</month>
<year>2017</year>
</pub-date>
<volume>13</volume>
<issue>5</issue>
<elocation-id>e1005530</elocation-id>
<history>
<date date-type="received">
<day>18</day>
<month>1</month>
<year>2017</year>
</date>
<date date-type="accepted">
<day>20</day>
<month>4</month>
<year>2017</year>
</date>
</history>
<permissions>
<copyright-year>2017</copyright-year>
<copyright-holder>Risse et al</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">
<license-p>This is an open access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">Creative Commons Attribution License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="info:doi/10.1371/journal.pcbi.1005530"/>
<abstract>
<p>Imaging and analyzing the locomotion behavior of small animals such as Drosophila larvae or C. elegans worms has become an integral subject of biological research. In the past we have introduced FIM, a novel imaging system feasible to extract high contrast images. This system in combination with the associated tracking software FIMTrack is already used by many groups all over the world. However, so far there has not been an in-depth discussion of the technical aspects. Here we elaborate on the implementation details of FIMTrack and give an in-depth explanation of the used algorithms. Among others, the software offers several tracking strategies to cover a wide range of different model organisms, locomotion types, and camera properties. Furthermore, the software facilitates stimuli-based analysis in combination with built-in manual tracking and correction functionalities. All features are integrated in an easy-to-use graphical user interface. To demonstrate the potential of FIMTrack we provide an evaluation of its accuracy using manually labeled data. The source code is available under the GNU GPLv3 at <ext-link ext-link-type="uri" xlink:href="https://github.com/i-git/FIMTrack" xlink:type="simple">https://github.com/i-git/FIMTrack</ext-link> and pre-compiled binaries for Windows and Mac are available at <ext-link ext-link-type="uri" xlink:href="http://fim.uni-muenster.de" xlink:type="simple">http://fim.uni-muenster.de</ext-link>.</p>
</abstract>
<funding-group>
<funding-statement>This work has been partially supported by the Deutsche Forschungsgemeinschaft, Cluster of Excellence EXC 1003, Cells in Motion, CiM, Münster, Germany (PP-2014-05, FF-2016-06, CIM-IMPRS fellowship to NO). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</funding-statement>
</funding-group>
<counts>
<fig-count count="9"/>
<table-count count="1"/>
<page-count count="15"/>
</counts>
<custom-meta-group>
<custom-meta>
<meta-name>PLOS Publication Stage</meta-name>
<meta-value>vor-update-to-uncorrected-proof</meta-value>
</custom-meta>
<custom-meta>
<meta-name>Publication Update</meta-name>
<meta-value>2017-05-25</meta-value>
</custom-meta>
<custom-meta id="data-availability">
<meta-name>Data Availability</meta-name>
<meta-value>The source code is available under the GNU GPLv3 at <ext-link ext-link-type="uri" xlink:href="https://github.com/i-git/FIMTrack" xlink:type="simple">https://github.com/i-git/FIMTrack</ext-link> and pre-compiled binaries for Windows and Mac are available at <ext-link ext-link-type="uri" xlink:href="http://fim.uni-muenster.de" xlink:type="simple">http://fim.uni-muenster.de</ext-link>. The ground truth dataset can be downloaded at <ext-link ext-link-type="uri" xlink:href="http://fim.uni-muenster.de" xlink:type="simple">http://fim.uni-muenster.de</ext-link>.</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<disp-quote>
<p>This is a <italic>PLOS Computational Biology</italic> Software paper.</p>
</disp-quote>
<sec id="sec001" sec-type="intro">
<title>Introduction</title>
<p>For most animals the ability to move is essential to survive. A complex nervous system, built-up by neurons and glial cells, allows sophisticated locomotion control. The analysis of locomotion of freely moving animals is crucial to gather insights into the nervous system functionality. Especially <italic>Drosophila melanogaster</italic> larvae and <italic>Caenorhabditis elegans</italic> worms are popular model organisms in neuro- and behavioral biology since sophisticated genetic tools and a well-established knowledge base provide advantages like cell specific manipulations and ease behavioral inferences [<xref ref-type="bibr" rid="pcbi.1005530.ref001">1</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref002">2</xref>]. Different tracking and locomotion analysis tools have been proposed including commercially available (e.g. EthoVision [<xref ref-type="bibr" rid="pcbi.1005530.ref003">3</xref>]) and custom solutions (e.g. MWT [<xref ref-type="bibr" rid="pcbi.1005530.ref004">4</xref>], MAGAT [<xref ref-type="bibr" rid="pcbi.1005530.ref005">5</xref>], SOS [<xref ref-type="bibr" rid="pcbi.1005530.ref006">6</xref>]). In the past we have introduced a novel imaging technique called FIM [<xref ref-type="bibr" rid="pcbi.1005530.ref007">7</xref>] to gather high-contrast recordings of the aforementioned model organisms. The associated open-source tracking software FIMTrack has already been used in a variety of studies [<xref ref-type="bibr" rid="pcbi.1005530.ref007">7</xref>–<xref ref-type="bibr" rid="pcbi.1005530.ref011">11</xref>] and a video tutorial has been published in [<xref ref-type="bibr" rid="pcbi.1005530.ref012">12</xref>] to demonstrate its biological usability. For example, FIMTrack has successfully been used to identify a central neural pathway for odor tracking in Drosophila [<xref ref-type="bibr" rid="pcbi.1005530.ref009">9</xref>] and to study the behavioral changes of <italic>uba-5</italic> knockout C. elegans worms [<xref ref-type="bibr" rid="pcbi.1005530.ref013">13</xref>].</p>
<p>Here we elaborate on the technical aspects and algorithms implemented in FIMTrack for a better understanding of the resultant quantities. Additionally, we provide an accuracy quantification using manually labeled data.</p>
<p>FIMTrack offers several advantages compared to state-of-the-art tracking tools:</p>
<list list-type="bullet">
<list-item>
<p>The assignment of animals across frames is implemented in a modular fashion, offering different combinations of assignment strategies and cost functions, making FIMTrack more flexible for a wider range of model organisms, locomotion types, and camera properties.</p>
</list-item>
<list-item>
<p>FIMTrack extracts a huge variety of posture and motion-related features with a very high tracking accuracy which is evaluated using labeled data.</p>
</list-item>
<list-item>
<p>Our tracking program has an intuitive graphical user interface allowing the inspection of most of the calculated features, an option for manual tracking, and an easy integration of stimulus regions.</p>
</list-item>
<list-item>
<p>FIMTrack does not rely on commercial packages and is available in source code and as pre-compiled binaries for Windows and Mac.</p>
</list-item>
<list-item>
<p>The software is implemented in an object-oriented fashion to improve re-usability and enable extensibility.</p>
</list-item>
</list>
<p>The main purposes of this paper are:</p>
<list list-type="bullet">
<list-item>
<p>Elaborate the algorithmic insights of the widely used FIMTrack software to enable easier usage and extensibility.</p>
</list-item>
<list-item>
<p>Provide a ground truth-based evaluation of the tracking performance.</p>
</list-item>
<list-item>
<p>Give an update on the current state of the program featuring a variety of novel functionality compared to its first usage in 2013 [<xref ref-type="bibr" rid="pcbi.1005530.ref007">7</xref>].</p>
</list-item>
<list-item>
<p>Introduce FIMTrack as a tool for other communities dealing with other model organisms.</p>
</list-item>
</list>
</sec>
<sec id="sec002" sec-type="materials|methods">
<title>Design and implementation</title>
<p>FIMTrack is written in C++ and is easily extendable since the object-oriented programming paradigm is used. We utilize the OpenCV library and the Qt framework in combination with QCustomPlot (<ext-link ext-link-type="uri" xlink:href="http://qcustomplot.com/" xlink:type="simple">http://qcustomplot.com/</ext-link>) for image processing and the graphical user interface. Generally, FIMTrack consists of three main modules, namely the <italic>tracker</italic>, the <italic>results viewer</italic>, and the <italic>input-output (IO)</italic> module.</p>
<sec id="sec003">
<title>Tracker module</title>
<p>The main flow of the tracking module is given in <xref ref-type="fig" rid="pcbi.1005530.g001">Fig 1</xref> and can be separated into <italic>image processing</italic>, <italic>model extraction</italic>, and <italic>tracking</italic>.</p>
<fig id="pcbi.1005530.g001" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g001</object-id>
<label>Fig 1</label>
<caption>
<title>Flow chart of the tracking module.</title>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g001" xlink:type="simple"/>
</fig>
<sec id="sec004">
<title>Image processing</title>
<p>Let <inline-formula id="pcbi.1005530.e001"><alternatives><graphic id="pcbi.1005530.e001g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e001" xlink:type="simple"/><mml:math display="inline" id="M1"><mml:msub><mml:mi mathvariant="script">I</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> be the gray scale image at time <italic>t</italic> and assume that <italic>N</italic> animals in total need to be tracked. Prior to further image analysis we compute a static background image which includes almost all immovable artifacts. Since images produced by FIM have a black background with bright foreground pixels and since we assume that an animal moves more than its own body length during the recording, the calculation of the background image <inline-formula id="pcbi.1005530.e002"><alternatives><graphic id="pcbi.1005530.e002g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e002" xlink:type="simple"/><mml:math display="inline" id="M2"><mml:mi mathvariant="script">B</mml:mi></mml:math></alternatives></inline-formula> can be done using the minimal pixel intensity value over time, resulting in
<disp-formula id="pcbi.1005530.e003"><alternatives><graphic id="pcbi.1005530.e003g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e003" xlink:type="simple"/><mml:math display="block" id="M3"><mml:mrow><mml:mi mathvariant="script">B</mml:mi> <mml:mfenced close=")" open="(" separators=""><mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi></mml:mfenced> <mml:mo>=</mml:mo> <mml:munder><mml:mo form="prefix" movablelimits="true">min</mml:mo> <mml:mi>t</mml:mi></mml:munder> <mml:mfenced close=")" open="(" separators=""><mml:msub><mml:mi mathvariant="script">I</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></alternatives></disp-formula>
where <inline-formula id="pcbi.1005530.e004"><alternatives><graphic id="pcbi.1005530.e004g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e004" xlink:type="simple"/><mml:math display="inline" id="M4"><mml:mrow><mml:msub><mml:mi mathvariant="script">I</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula> is the pixel intensity at row <italic>r</italic> and column <italic>c</italic> at time <italic>t</italic>.</p>
<p>Subsequently, the foreground image <inline-formula id="pcbi.1005530.e005"><alternatives><graphic id="pcbi.1005530.e005g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e005" xlink:type="simple"/><mml:math display="inline" id="M5"><mml:msub><mml:mi mathvariant="script">F</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> containing almost all objects of interest without the artifacts present in the background image <inline-formula id="pcbi.1005530.e006"><alternatives><graphic id="pcbi.1005530.e006g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e006" xlink:type="simple"/><mml:math display="inline" id="M6"><mml:mi mathvariant="script">B</mml:mi></mml:math></alternatives></inline-formula> is obtained by
<disp-formula id="pcbi.1005530.e007"><alternatives><graphic id="pcbi.1005530.e007g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e007" xlink:type="simple"/><mml:math display="block" id="M7"><mml:mrow><mml:msub><mml:mi mathvariant="script">F</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>=</mml:mo> <mml:mfenced close="" open="{" separators=""><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi mathvariant="script">I</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:mrow><mml:mtext>if</mml:mtext> <mml:mspace width="4.pt"/><mml:mo>|</mml:mo></mml:mrow> <mml:msub><mml:mi mathvariant="script">I</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mrow><mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>-</mml:mo> <mml:mi mathvariant="script">B</mml:mi> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>|</mml:mo> <mml:mo>≥</mml:mo></mml:mrow> <mml:msub><mml:mi>τ</mml:mi> <mml:mi mathvariant="script">B</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mtd></mml:mtr> <mml:mtr><mml:mtd columnalign="left"><mml:mn>0</mml:mn></mml:mtd> <mml:mtd columnalign="left"><mml:mtext>otherwise</mml:mtext></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:math></alternatives></disp-formula>
with <inline-formula id="pcbi.1005530.e008"><alternatives><graphic id="pcbi.1005530.e008g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e008" xlink:type="simple"/><mml:math display="inline" id="M8"><mml:mrow><mml:msub><mml:mi>τ</mml:mi> <mml:mi mathvariant="script">B</mml:mi></mml:msub> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>=</mml:mo> <mml:mi>τ</mml:mi> <mml:mo>+</mml:mo> <mml:mi mathvariant="script">B</mml:mi> <mml:mrow><mml:mo>(</mml:mo> <mml:mi>r</mml:mi> <mml:mo>,</mml:mo> <mml:mi>c</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula> where <italic>τ</italic> is a user set gray value threshold. Given <inline-formula id="pcbi.1005530.e009"><alternatives><graphic id="pcbi.1005530.e009g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e009" xlink:type="simple"/><mml:math display="inline" id="M9"><mml:msub><mml:mi mathvariant="script">F</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> the contours <inline-formula id="pcbi.1005530.e010"><alternatives><graphic id="pcbi.1005530.e010g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e010" xlink:type="simple"/><mml:math display="inline" id="M10"><mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> of the animals are calculated by using the algorithm proposed in [<xref ref-type="bibr" rid="pcbi.1005530.ref014">14</xref>] resulting in a set of contours <inline-formula id="pcbi.1005530.e011"><alternatives><graphic id="pcbi.1005530.e011g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e011" xlink:type="simple"/><mml:math display="inline" id="M11"><mml:mrow><mml:msub><mml:mi>C</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mrow><mml:mo>{</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mn>1</mml:mn></mml:msubsup> <mml:mo>,</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mn>2</mml:mn></mml:msubsup> <mml:mo>,</mml:mo> <mml:mo>.</mml:mo> <mml:mo>.</mml:mo> <mml:mo>.</mml:mo> <mml:mo>,</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:msubsup> <mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula>. <italic>N</italic><sub><italic>t</italic></sub> might differ from <italic>N</italic> since animals can be in contact with each other (leading to merged contours) or impurities on the substrate which are not included in the background image lead to artifacts. However, the contours in <italic>C</italic><sub><italic>t</italic></sub> can be filtered to identify single animals by assuming that all imaged animals cover approximately the same area. The filtered set <inline-formula id="pcbi.1005530.e012"><alternatives><graphic id="pcbi.1005530.e012g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e012" xlink:type="simple"/><mml:math display="inline" id="M12"><mml:msub><mml:mover accent="true"><mml:mi>C</mml:mi> <mml:mo>˜</mml:mo></mml:mover> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> of contours is given by
<disp-formula id="pcbi.1005530.e013"><alternatives><graphic id="pcbi.1005530.e013g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e013" xlink:type="simple"/><mml:math display="block" id="M13"><mml:mrow><mml:msub><mml:mover accent="true"><mml:mi>C</mml:mi> <mml:mo>˜</mml:mo></mml:mover> <mml:mi>t</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mfenced close="}" open="{" separators=""><mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mrow><mml:mspace width="4.pt"/><mml:mo>|</mml:mo> <mml:mspace width="4.pt"/></mml:mrow> <mml:msub><mml:mi>λ</mml:mi> <mml:mtext>min</mml:mtext></mml:msub> <mml:mo>≤</mml:mo> <mml:mi>A</mml:mi> <mml:mrow><mml:mo>(</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>≤</mml:mo> <mml:msub><mml:mi>λ</mml:mi> <mml:mtext>max</mml:mtext></mml:msub> <mml:mtext>,</mml:mtext> <mml:mspace width="4.pt"/><mml:mi>i</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:mfenced></mml:mrow></mml:math></alternatives></disp-formula>
where <italic>λ</italic><sub>min</sub> &lt; <italic>λ</italic><sub>max</sub> are two user defined thresholds and <inline-formula id="pcbi.1005530.e014"><alternatives><graphic id="pcbi.1005530.e014g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e014" xlink:type="simple"/><mml:math display="inline" id="M14"><mml:mrow><mml:mi>A</mml:mi> <mml:mo>(</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:mrow></mml:math></alternatives></inline-formula> is the contour area given by the number of pixels enclosed by <inline-formula id="pcbi.1005530.e015"><alternatives><graphic id="pcbi.1005530.e015g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e015" xlink:type="simple"/><mml:math display="inline" id="M15"><mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula>. Both the contours that fulfill <inline-formula id="pcbi.1005530.e016"><alternatives><graphic id="pcbi.1005530.e016g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e016" xlink:type="simple"/><mml:math display="inline" id="M16"><mml:mrow><mml:mi>A</mml:mi> <mml:mrow><mml:mo>(</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>&gt;</mml:mo> <mml:msub><mml:mi>λ</mml:mi> <mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> which are assumed to represent colliding animals and contours with <inline-formula id="pcbi.1005530.e017"><alternatives><graphic id="pcbi.1005530.e017g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e017" xlink:type="simple"/><mml:math display="inline" id="M17"><mml:mrow><mml:mi>A</mml:mi> <mml:mrow><mml:mo>(</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>&lt;</mml:mo> <mml:msub><mml:mi>λ</mml:mi> <mml:mtext>min</mml:mtext></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> which are assumed to be artifacts are ignored in further calculations.</p>
</sec>
<sec id="sec005">
<title>Model extraction</title>
<p>For each contour <inline-formula id="pcbi.1005530.e018"><alternatives><graphic id="pcbi.1005530.e018g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e018" xlink:type="simple"/><mml:math display="inline" id="M18"><mml:mrow><mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:msub><mml:mover accent="true"><mml:mi>C</mml:mi> <mml:mo>˜</mml:mo></mml:mover> <mml:mi>t</mml:mi></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> we compute a model representation of the associated animal. First, the spine is calculated based on curvature values which are obtained for each point <bold>p</bold> on the contour using the first pass of the IPAN algorithm [<xref ref-type="bibr" rid="pcbi.1005530.ref015">15</xref>]. Given all curvatures ∠<sub><bold>p</bold></sub> the two regions with sharpest acute angle are located using a sliding window approach as illustrated in <xref ref-type="fig" rid="pcbi.1005530.g002">Fig 2a</xref>. The point with the sharpest overall mean angle is identified as head <bold>h</bold> and the point with the second sharpest mean angle (with an appropriate distance <italic>δ</italic><sub><italic>h</italic> ↔ <italic>t</italic></sub> to <bold>h</bold>) is identified as tail <bold>t</bold>. This assignment is done during the model extraction for each frame individually. In order to avoid head and tail switches and to ensure a reliable identification of these points for different organisms like larvae or C. elegans, the positions of the head and tail are refined in a post processing step using posture and motion features over time (see Post processing section).</p>
<fig id="pcbi.1005530.g002" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g002</object-id>
<label>Fig 2</label>
<caption>
<title>Calculation of the animal representation.</title>
<p>(<bold>A</bold>) Example of the sliding window algorithm for points <inline-formula id="pcbi.1005530.e019"><alternatives><graphic id="pcbi.1005530.e019g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e019" xlink:type="simple"/><mml:math display="inline" id="M19"><mml:mover accent="true"><mml:mi mathvariant="bold">p</mml:mi> <mml:mo>¯</mml:mo></mml:mover></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e020"><alternatives><graphic id="pcbi.1005530.e020g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e020" xlink:type="simple"/><mml:math display="inline" id="M20"><mml:mover accent="true"><mml:mi mathvariant="bold">q</mml:mi> <mml:mo>¯</mml:mo></mml:mover></mml:math></alternatives></inline-formula> with a window size of 5. Contour points with sharp angles are given in red. (<bold>B</bold>) Animal representation including the notation given in the text. (<bold>C</bold>) Body bending is calculated based on <xref ref-type="disp-formula" rid="pcbi.1005530.e056">Eq (3)</xref>. An animal is not bended if <italic>γ</italic> = 180°, bended to the left if <italic>γ</italic> &gt; 180° and bended to the right if <italic>γ</italic> &lt; 180°.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g002" xlink:type="simple"/>
</fig>
<p>The initial <bold>h</bold> and <bold>t</bold> identification is used to split the contour into two halves <inline-formula id="pcbi.1005530.e021"><alternatives><graphic id="pcbi.1005530.e021g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e021" xlink:type="simple"/><mml:math display="inline" id="M21"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e022"><alternatives><graphic id="pcbi.1005530.e022g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e022" xlink:type="simple"/><mml:math display="inline" id="M22"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula>. Without loss of generality, let <inline-formula id="pcbi.1005530.e023"><alternatives><graphic id="pcbi.1005530.e023g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e023" xlink:type="simple"/><mml:math display="inline" id="M23"><mml:mrow><mml:mrow><mml:mo>|</mml:mo></mml:mrow> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mrow><mml:mo>|</mml:mo> <mml:mo>&lt;</mml:mo> <mml:mo>|</mml:mo></mml:mrow> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula>. Then <inline-formula id="pcbi.1005530.e024"><alternatives><graphic id="pcbi.1005530.e024g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e024" xlink:type="simple"/><mml:math display="inline" id="M24"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> is re-sampled, so that <inline-formula id="pcbi.1005530.e025"><alternatives><graphic id="pcbi.1005530.e025g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e025" xlink:type="simple"/><mml:math display="inline" id="M25"><mml:mrow><mml:mrow><mml:mo>|</mml:mo></mml:mrow> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mrow><mml:mo>|</mml:mo> <mml:mo>=</mml:mo> <mml:mo>|</mml:mo></mml:mrow> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula> by utilizing linear interpolation between points in <inline-formula id="pcbi.1005530.e026"><alternatives><graphic id="pcbi.1005530.e026g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e026" xlink:type="simple"/><mml:math display="inline" id="M26"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula>. Now each point <inline-formula id="pcbi.1005530.e027"><alternatives><graphic id="pcbi.1005530.e027g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e027" xlink:type="simple"/><mml:math display="inline" id="M27"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>1</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:mrow></mml:math></alternatives></inline-formula> corresponds to a unique point <inline-formula id="pcbi.1005530.e028"><alternatives><graphic id="pcbi.1005530.e028g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e028" xlink:type="simple"/><mml:math display="inline" id="M28"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>2</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:mrow></mml:math></alternatives></inline-formula>. The spine points <bold>s</bold><sub>1</sub>, …,<bold>s</bold><sub><italic>L</italic> − 2</sub> are calculated by determining <italic>L</italic> − 2 equidistant pairs <inline-formula id="pcbi.1005530.e029"><alternatives><graphic id="pcbi.1005530.e029g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e029" xlink:type="simple"/><mml:math display="inline" id="M29"><mml:mo>(</mml:mo> <mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>1</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>,</mml:mo> <mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>2</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:math></alternatives></inline-formula> along <inline-formula id="pcbi.1005530.e030"><alternatives><graphic id="pcbi.1005530.e030g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e030" xlink:type="simple"/><mml:math display="inline" id="M30"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e031"><alternatives><graphic id="pcbi.1005530.e031g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e031" xlink:type="simple"/><mml:math display="inline" id="M31"><mml:msubsup><mml:mi>c</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>,</mml:mo> <mml:mn>2</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> and by setting <inline-formula id="pcbi.1005530.e032"><alternatives><graphic id="pcbi.1005530.e032g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e032" xlink:type="simple"/><mml:math display="inline" id="M32"><mml:mrow><mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mi>j</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mfrac><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>2</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>+</mml:mo> <mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>1</mml:mn> <mml:mi>j</mml:mi></mml:msubsup></mml:mrow> <mml:mn>2</mml:mn></mml:mfrac></mml:mrow></mml:math></alternatives></inline-formula>. The radii <italic>r</italic><sub><italic>j</italic></sub> are calculated similarly by <inline-formula id="pcbi.1005530.e033"><alternatives><graphic id="pcbi.1005530.e033g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e033" xlink:type="simple"/><mml:math display="inline" id="M33"><mml:mrow><mml:msub><mml:mi>r</mml:mi> <mml:mi>j</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mfrac><mml:mrow><mml:mrow><mml:mo>∥</mml:mo></mml:mrow> <mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>2</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>-</mml:mo> <mml:msubsup><mml:mi mathvariant="bold">p</mml:mi> <mml:mn>1</mml:mn> <mml:mi>j</mml:mi></mml:msubsup> <mml:mrow><mml:mo>∥</mml:mo></mml:mrow></mml:mrow> <mml:mn>2</mml:mn></mml:mfrac></mml:mrow></mml:math></alternatives></inline-formula>. In addition, the center of mass <bold>m</bold> is calculated based on <inline-formula id="pcbi.1005530.e034"><alternatives><graphic id="pcbi.1005530.e034g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e034" xlink:type="simple"/><mml:math display="inline" id="M34"><mml:msubsup><mml:mi>c</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula>. As a result, each animal <italic>i</italic> at time <italic>t</italic> is defined by a model
<disp-formula id="pcbi.1005530.e035"><alternatives><graphic id="pcbi.1005530.e035g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e035" xlink:type="simple"/><mml:math display="block" id="M35"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>=</mml:mo> <mml:mrow><mml:mo>(</mml:mo> <mml:mi mathvariant="bold">h</mml:mi> <mml:mo>,</mml:mo> <mml:mrow><mml:mo>(</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mn>1</mml:mn></mml:msub> <mml:mo>,</mml:mo> <mml:msub><mml:mi>r</mml:mi> <mml:mn>1</mml:mn></mml:msub> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:mrow><mml:mo>(</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mrow><mml:mi>L</mml:mi> <mml:mo>-</mml:mo> <mml:mn>2</mml:mn></mml:mrow></mml:msub> <mml:mo>,</mml:mo> <mml:msub><mml:mi>r</mml:mi> <mml:mrow><mml:mi>L</mml:mi> <mml:mo>-</mml:mo> <mml:mn>2</mml:mn></mml:mrow></mml:msub> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>,</mml:mo> <mml:mi mathvariant="bold">t</mml:mi> <mml:mo>,</mml:mo> <mml:mi mathvariant="bold">m</mml:mi> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives> <label>(1)</label></disp-formula>
which is depicted in <xref ref-type="fig" rid="pcbi.1005530.g002">Fig 2b</xref>.</p>
</sec>
<sec id="sec006">
<title>Tracking</title>
<p>Considering a sufficient spatio-temporal resolution tracking can be done by assigning animals between consecutive frames: all active animals <inline-formula id="pcbi.1005530.e036"><alternatives><graphic id="pcbi.1005530.e036g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e036" xlink:type="simple"/><mml:math display="inline" id="M36"><mml:mrow><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mrow><mml:mo>{</mml:mo> <mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>|</mml:mo> <mml:mi>i</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula> at time <italic>t</italic> need to be associated with either one detected animal from the set <inline-formula id="pcbi.1005530.e037"><alternatives><graphic id="pcbi.1005530.e037g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e037" xlink:type="simple"/><mml:math display="inline" id="M37"><mml:mrow><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub> <mml:mo>=</mml:mo> <mml:mrow><mml:mo>{</mml:mo> <mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>|</mml:mo> <mml:mi>j</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub> <mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives></inline-formula> at time <italic>t</italic> + 1 or removed from the set of active animals. Mathematically this assignment is known as a bipartite matching between <inline-formula id="pcbi.1005530.e038"><alternatives><graphic id="pcbi.1005530.e038g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e038" xlink:type="simple"/><mml:math display="inline" id="M38"><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e039"><alternatives><graphic id="pcbi.1005530.e039g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e039" xlink:type="simple"/><mml:math display="inline" id="M39"><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></alternatives></inline-formula>. Let the costs for an assignment between an animal <italic>i</italic> at time <italic>t</italic> and an animal <italic>j</italic> at time <italic>t</italic> + 1 be <italic>κ</italic><sub><italic>ij</italic></sub>. This leads to the following cost matrix:
<disp-formula id="pcbi.1005530.e040"><alternatives><graphic id="pcbi.1005530.e040g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e040" xlink:type="simple"/><mml:math display="block" id="M40"><mml:mrow><mml:msub><mml:mi mathvariant="script">C</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mtable columnalign="left"><mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mn>1</mml:mn></mml:msubsup></mml:mrow></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mn>2</mml:mn></mml:msubsup></mml:mrow></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mo>⋮</mml:mo></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:mrow></mml:msubsup></mml:mrow></mml:mtd></mml:mtr></mml:mtable> <mml:mrow><mml:mo>(</mml:mo> <mml:mrow><mml:mtable columnalign="left"><mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mn>1</mml:mn></mml:msubsup></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mn>2</mml:mn></mml:msubsup></mml:mrow></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋯</mml:mo></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msubsup></mml:mrow></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>11</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>12</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋯</mml:mo></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>1</mml:mn> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>21</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>22</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="center"><mml:mrow><mml:mo> </mml:mo> <mml:mo>⋯</mml:mo></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:mn>2</mml:mn> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="center"><mml:mo>⋮</mml:mo></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋮</mml:mo></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋱</mml:mo></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋮</mml:mo></mml:mtd></mml:mtr> <mml:mtr columnalign="left"><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd> <mml:mtd columnalign="center"><mml:mo>⋯</mml:mo></mml:mtd> <mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>κ</mml:mi> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow> <mml:mo>)</mml:mo></mml:mrow> <mml:mo>∈</mml:mo> <mml:msup><mml:mi>ℝ</mml:mi> <mml:mrow><mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>×</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:math></alternatives></disp-formula></p>
<p>The following three cost measurements are implemented in FIMTrack:</p>
<list list-type="order">
<list-item>
<p>Euclidean distance between the center of masses (<xref ref-type="fig" rid="pcbi.1005530.g003">Fig 3a</xref>): <inline-formula id="pcbi.1005530.e041">
<alternatives>
<graphic id="pcbi.1005530.e041g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e041" xlink:type="simple"/>
<mml:math display="inline" id="M41">
<mml:mrow> <mml:msub> <mml:mi>κ</mml:mi> <mml:mrow> <mml:mi>i</mml:mi> <mml:mi>j</mml:mi>
</mml:mrow></mml:msub> <mml:mo>=</mml:mo> <mml:mrow> <mml:mo>|</mml:mo> <mml:mo>|</mml:mo>
</mml:mrow> <mml:msubsup> <mml:mi mathvariant="bold">m</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi>
</mml:msubsup> <mml:mo>-</mml:mo> <mml:msubsup> <mml:mi mathvariant="bold">m</mml:mi> <mml:mrow> <mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn>
</mml:mrow> <mml:mi>j</mml:mi>
</mml:msubsup> <mml:msub> <mml:mrow> <mml:mo>|</mml:mo> <mml:mo>|</mml:mo>
</mml:mrow> <mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</alternatives>
</inline-formula>
</p>
</list-item>
<list-item>
<p>Euclidean distance between the mid-points (<xref ref-type="fig" rid="pcbi.1005530.g003">Fig 3b</xref>):<inline-formula id="pcbi.1005530.e042">
<alternatives>
<graphic id="pcbi.1005530.e042g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e042" xlink:type="simple"/> <mml:math display="inline" id="M42"><mml:mrow> <mml:msub> <mml:mi>κ</mml:mi> <mml:mrow> <mml:mi>i</mml:mi> <mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub> <mml:mo>=</mml:mo> <mml:mrow> <mml:mo>|</mml:mo> <mml:mo>|</mml:mo>
</mml:mrow> <mml:msubsup> <mml:mi mathvariant="bold">s</mml:mi> <mml:mrow> <mml:mfrac> <mml:mi>L</mml:mi> <mml:mn>2</mml:mn>
</mml:mfrac> <mml:mo>,</mml:mo> <mml:mi>t</mml:mi>
</mml:mrow> <mml:mi>i</mml:mi>
</mml:msubsup> <mml:mo>-</mml:mo> <mml:msubsup> <mml:mi mathvariant="bold">s</mml:mi> <mml:mrow> <mml:mfrac> <mml:mi>L</mml:mi> <mml:mn>2</mml:mn>
</mml:mfrac> <mml:mo>,</mml:mo> <mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn>
</mml:mrow> <mml:mi>j</mml:mi>
</mml:msubsup> <mml:msub> <mml:mrow> <mml:mo>|</mml:mo> <mml:mo>|</mml:mo>
</mml:mrow> <mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</alternatives>
</inline-formula>
</p>
</list-item>
<list-item>
<p>The intersecting area in pixels given two consecutive contours (<xref ref-type="fig" rid="pcbi.1005530.g003">Fig 3c</xref>)</p>
</list-item>
</list>
<p specific-use="continuation">Since the center of mass is extracted from the contour, the translation between consecutive frames is very smooth. In contrast, the middle spine point contains more jitter, but is forced to be inside the contour. Costs derived from the overlap of two consecutive contours fulfill both criteria as they are smooth and based on pixels within the contours.</p>
<fig id="pcbi.1005530.g003" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g003</object-id>
<label>Fig 3</label>
<caption>
<title>Different cost measurements.</title>
<p>(<bold>A</bold>) Center of mass-based cost. (<bold>B</bold>) Spine-based cost. (<bold>C</bold>) Contour-based cost.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g003" xlink:type="simple"/>
</fig>
<p>To solve the aforementioned assignment problem two algorithms are implemented in FIMTrack. One is the Hungarian algorithm [<xref ref-type="bibr" rid="pcbi.1005530.ref016">16</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref017">17</xref>] which has one drawback: Given distance-based costs, the algorithm will find assignments for all <inline-formula id="pcbi.1005530.e043"><alternatives><graphic id="pcbi.1005530.e043g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e043" xlink:type="simple"/><mml:math display="inline" id="M43"><mml:mrow><mml:mover accent="true"><mml:mi>n</mml:mi> <mml:mo>˜</mml:mo></mml:mover> <mml:mo>=</mml:mo> <mml:mo form="prefix" movablelimits="true">min</mml:mo> <mml:mo>(</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mi>t</mml:mi></mml:msub> <mml:mo>,</mml:mo> <mml:msub><mml:mi>N</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub> <mml:mo>)</mml:mo></mml:mrow></mml:math></alternatives></inline-formula> animals. For example, if animal <italic>i</italic> disappears at time <italic>t</italic> while another animal <italic>j</italic> appears at time <italic>t</italic> + 1, the algorithm will assign these two animals even if the Euclidean distance between them is very large. Thus, we check each assignment if at least one point of the model of animal <italic>i</italic> is inside the contour of animal <italic>j</italic>. Otherwise animal <italic>i</italic> is considered to be inactive, the associated trajectory is terminated, and animal <italic>j</italic> is initialized as a new animal.</p>
<p>The second algorithm follows the greedy pattern. Given <inline-formula id="pcbi.1005530.e044"><alternatives><graphic id="pcbi.1005530.e044g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e044" xlink:type="simple"/><mml:math display="inline" id="M44"><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e045"><alternatives><graphic id="pcbi.1005530.e045g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e045" xlink:type="simple"/><mml:math display="inline" id="M45"><mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></alternatives></inline-formula> the algorithm determines sequentially for each animal <inline-formula id="pcbi.1005530.e046"><alternatives><graphic id="pcbi.1005530.e046g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e046" xlink:type="simple"/><mml:math display="inline" id="M46"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mi>t</mml:mi></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> the best matching animal <inline-formula id="pcbi.1005530.e047"><alternatives><graphic id="pcbi.1005530.e047g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e047" xlink:type="simple"/><mml:math display="inline" id="M47"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>j</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:msub><mml:mi mathvariant="script">L</mml:mi> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> given one cost measurement (note that each match has to be unique). To exclude irrational assignments this algorithm requires an additional threshold <italic>τ</italic><sub>greedy</sub> specifying the maximal distance between two consecutive points if distance-based costs are used or the minimal amount of overlap in case of contour-based costs.</p>
<p>The possibility to choose between multiple costs and optimization algorithms extends the range of organisms which can be analyzed even at various spatial and temporal resolutions. For example, during peristaltic forward locomotion of Drosophila larvae, the Hungarian algorithm in combination with overlap-based costs is feasible to associate the larvae over time (<xref ref-type="fig" rid="pcbi.1005530.g004">Fig 4a</xref>). In contrast, rolling larvae with unsuitable temporal resolution lead to false assignments using the Hungarian algorithm with overlapping contour costs: due to strong changes in the body bending and the relatively fast lateral locomotion no overlaps can be detected within contours of consecutive frames (<xref ref-type="fig" rid="pcbi.1005530.g004">Fig 4b</xref>). Similarly, C. elegans moves in a snake like motion so that contour-overlap-based assignments may fail (<xref ref-type="fig" rid="pcbi.1005530.g004">Fig 4c</xref>).</p>
<fig id="pcbi.1005530.g004" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g004</object-id>
<label>Fig 4</label>
<caption>
<title>Examples of different assignment strategies.</title>
<p>Overlapping regions are given in red and locomotion is indicated by arrows. (<bold>A</bold>) During forward locomotion of Drosophila larvae the association can be done using overlap-based costs and the Hungarian algorithm. (<bold>B</bold>) Given rolling behavior of Drosophila larvae, an assignment using contour overlaps as costs for the Hungarian algorithm might fail due to inappropriate frame rates. (<bold>C</bold>) For tracking the snake-like motion of C. elegans, contour-based assignments might be insufficient.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g004" xlink:type="simple"/>
</fig>
<p>After processing all frames, the overall path of an animal <italic>i</italic> is given by
<disp-formula id="pcbi.1005530.e048"><alternatives><graphic id="pcbi.1005530.e048g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e048" xlink:type="simple"/><mml:math display="block" id="M48"><mml:mrow><mml:msup><mml:mi mathvariant="double-struck">L</mml:mi> <mml:mi>i</mml:mi></mml:msup> <mml:mo>=</mml:mo> <mml:mrow><mml:mo>(</mml:mo> <mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:msub><mml:mi>t</mml:mi> <mml:mn>1</mml:mn></mml:msub></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>,</mml:mo> <mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:msub><mml:mi>t</mml:mi> <mml:mn>1</mml:mn></mml:msub> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>,</mml:mo> <mml:mo>…</mml:mo> <mml:mo>,</mml:mo> <mml:msubsup><mml:mi>l</mml:mi> <mml:mrow><mml:msub><mml:mi>t</mml:mi> <mml:mn>2</mml:mn></mml:msub></mml:mrow> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></alternatives> <label>(2)</label></disp-formula>
where <italic>t</italic><sub>1</sub> specifies the first frame the animal appears at and <italic>t</italic><sub>2</sub> indicates the last valid measurement (1 ≤ <italic>t</italic><sub>1</sub> ≤ <italic>t</italic><sub>2</sub> ≤ <italic>T</italic>; <italic>T</italic> represents the total number of frames).</p>
</sec>
<sec id="sec007">
<title>Post processing</title>
<p>The initial definition of the larval orientation is based on two regions with the sharpest acute angles. Due to the non-rigid body wall or low per-animal resolutions this assumption is not true in some frames leading to alternating head/tail assignments. Furthermore, other model organisms like C. elegans can imply other curvature characteristics compared to larvae which leads to the necessity to correct the initial <bold>h</bold> and <bold>t</bold> calculation.</p>
<p>To adjust the assignments in <inline-formula id="pcbi.1005530.e049"><alternatives><graphic id="pcbi.1005530.e049g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e049" xlink:type="simple"/><mml:math display="inline" id="M49"><mml:msup><mml:mi mathvariant="double-struck">L</mml:mi> <mml:mi>i</mml:mi></mml:msup></mml:math></alternatives></inline-formula> (<xref ref-type="disp-formula" rid="pcbi.1005530.e048">Eq 2</xref>) first distinct sequences <inline-formula id="pcbi.1005530.e050"><alternatives><graphic id="pcbi.1005530.e050g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e050" xlink:type="simple"/><mml:math display="inline" id="M50"><mml:mrow><mml:mover accent="true"><mml:msup><mml:mi mathvariant="double-struck">L</mml:mi> <mml:mi>i</mml:mi></mml:msup> <mml:mo>˜</mml:mo></mml:mover> <mml:mo>⊆</mml:mo> <mml:msup><mml:mi mathvariant="double-struck">L</mml:mi> <mml:mi>i</mml:mi></mml:msup></mml:mrow></mml:math></alternatives></inline-formula> where the animal is not coiled are determined. Afterwards, a probability indicating whether the head/tail assignment is correct or not is calculated for all tuple <inline-formula id="pcbi.1005530.e051"><alternatives><graphic id="pcbi.1005530.e051g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e051" xlink:type="simple"/><mml:math display="inline" id="M51"><mml:mrow><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup> <mml:mo>∈</mml:mo> <mml:mover accent="true"><mml:msup><mml:mi mathvariant="double-struck">L</mml:mi> <mml:mi>i</mml:mi></mml:msup> <mml:mo>˜</mml:mo></mml:mover></mml:mrow></mml:math></alternatives></inline-formula> based on the following constrains:</p>
<list list-type="order">
<list-item>
<p>Locomotion conformity (i.e. the mid-point/head vector points in the direction of the locomotion)</p>
</list-item>
<list-item>
<p>Bending conformity (i.e. larvae move the head but not the tail during reorientations)</p>
</list-item>
</list>
<p specific-use="continuation">If the head and tail are swapped, the spine points <bold>s</bold><sub><italic>i</italic></sub> and the radii <bold>r</bold><sub><italic>i</italic></sub> are reversed, too. Furthermore, all spine-point derived features are recalculated. Note that, although these constraints are derived from larval locomotion, the resultant probability is still valid if a C. elegans worm moves forward in more than 50% of the frames. It is worth mentioning that, after identifying <bold>h</bold> and <bold>t</bold>, the position of these points along the spine is fixed by assigning each subsequent head/tail point based on the respective predecessor with smallest Euclidean distance. Furthermore, even if the head and tail are swapped one click in the results viewer module is sufficient to correct the model throughout the entire recording (see Results reveiwer module).</p>
</sec>
<sec id="sec008">
<title>Feature calculation</title>
<p>To quantify the locomotion in more detail several primary, secondary, and motion-related features are calculated by FIMTrack.</p>
<p><italic>Primary features</italic>. In addition to the representation of an animal <inline-formula id="pcbi.1005530.e052"><alternatives><graphic id="pcbi.1005530.e052g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e052" xlink:type="simple"/><mml:math display="inline" id="M52"><mml:msubsup><mml:mi>l</mml:mi> <mml:mi>t</mml:mi> <mml:mi>i</mml:mi></mml:msubsup></mml:math></alternatives></inline-formula> (<xref ref-type="disp-formula" rid="pcbi.1005530.e035">Eq 1</xref>) the area <italic>A</italic> and the perimeter <italic>P</italic> are calculated.</p>
<p><italic>Secondary features</italic>. The main body bending angle <italic>γ</italic> is calculated based on the head <bold>h</bold>, the mid spine point <inline-formula id="pcbi.1005530.e053"><alternatives><graphic id="pcbi.1005530.e053g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e053" xlink:type="simple"/><mml:math display="inline" id="M53"><mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mfrac><mml:mi mathvariant="bold">L</mml:mi> <mml:mn mathvariant="bold">2</mml:mn></mml:mfrac></mml:msub></mml:math></alternatives></inline-formula>, and the tail <bold>t</bold>. Given the vectors <inline-formula id="pcbi.1005530.e054"><alternatives><graphic id="pcbi.1005530.e054g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e054" xlink:type="simple"/><mml:math display="inline" id="M54"><mml:mrow><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub> <mml:mo>=</mml:mo> <mml:mi mathvariant="bold">h</mml:mi> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mfrac><mml:mi mathvariant="bold">L</mml:mi> <mml:mn mathvariant="bold">2</mml:mn></mml:mfrac></mml:msub></mml:mrow></mml:math></alternatives></inline-formula> and <inline-formula id="pcbi.1005530.e055"><alternatives><graphic id="pcbi.1005530.e055g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e055" xlink:type="simple"/><mml:math display="inline" id="M55"><mml:mrow><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">2</mml:mn></mml:msub> <mml:mo>=</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mfrac><mml:mi mathvariant="bold">L</mml:mi> <mml:mn mathvariant="bold">2</mml:mn></mml:mfrac></mml:msub> <mml:mo>-</mml:mo> <mml:mi mathvariant="bold">t</mml:mi></mml:mrow></mml:math></alternatives></inline-formula>, <xref ref-type="disp-formula" rid="pcbi.1005530.e056">Eq (3)</xref> is used to calculate the bending in degree.
<disp-formula id="pcbi.1005530.e056"><alternatives><graphic id="pcbi.1005530.e056g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e056" xlink:type="simple"/><mml:math display="block" id="M56"><mml:mrow><mml:mi>γ</mml:mi> <mml:mo>=</mml:mo> <mml:mo form="prefix">arccos</mml:mo> <mml:mfenced close=")" open="(" separators=""><mml:mo>〈</mml:mo> <mml:mfrac><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub> <mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub></mml:mfenced></mml:mfrac> <mml:mo>,</mml:mo> <mml:mfrac><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">2</mml:mn></mml:msub> <mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">v</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub></mml:mfenced></mml:mfrac> <mml:mo>〉</mml:mo></mml:mfenced> <mml:mo>·</mml:mo> <mml:mfrac><mml:msup><mml:mn>180</mml:mn> <mml:mo>°</mml:mo></mml:msup> <mml:mi>π</mml:mi></mml:mfrac></mml:mrow></mml:math></alternatives> <label>(3)</label></disp-formula></p>
<p>As a consequence, an animal is not bended if <italic>γ</italic> = 180°, bended to the left if <italic>γ</italic> &gt; 180° and bended to the right if <italic>γ</italic> &lt; 180° (<xref ref-type="fig" rid="pcbi.1005530.g002">Fig 2c</xref>). Since a user-specified number of spine points can be extracted these points can be used to extract other bendings along the spine by using <xref ref-type="disp-formula" rid="pcbi.1005530.e056">Eq (3)</xref> with appropriate <bold>v</bold><sub><bold>1</bold></sub> and <bold>v</bold><sub><bold>2</bold></sub> (e.g. to quantify the stereotypical <italic>S</italic>-shape of C. elegans).</p>
<p>Given a threshold <italic>τ</italic><sub>bend</sub>, an animal sweeps to the left if <italic>γ</italic> ≥ 180° + <italic>τ</italic><sub>bend</sub> and sweeps to the right if <italic>γ</italic> ≤ 180° − <italic>τ</italic><sub>bend</sub>. Furthermore, the spine length <italic>S</italic><sub><italic>l</italic></sub> is calculated by summing up the Euclidean distances between the head, all spine points, and the tail:
<disp-formula id="pcbi.1005530.e057"><alternatives><graphic id="pcbi.1005530.e057g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e057" xlink:type="simple"/><mml:math display="block" id="M57"><mml:mrow><mml:msub><mml:mi>S</mml:mi> <mml:mi>l</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:msub><mml:mfenced close="∥" open="∥" separators=""><mml:mi mathvariant="bold">h</mml:mi> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub></mml:mfenced> <mml:mn>2</mml:mn></mml:msub> <mml:mo>+</mml:mo> <mml:munderover><mml:mo>∑</mml:mo> <mml:mrow><mml:mi>i</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mrow><mml:mi>L</mml:mi> <mml:mo>-</mml:mo> <mml:mn>3</mml:mn></mml:mrow></mml:munderover> <mml:msub><mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mi mathvariant="bold">i</mml:mi></mml:msub> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mrow><mml:mi mathvariant="bold">i</mml:mi> <mml:mo>+</mml:mo> <mml:mn mathvariant="bold">1</mml:mn></mml:mrow></mml:msub></mml:mfenced> <mml:mn>2</mml:mn></mml:msub> <mml:mo>+</mml:mo> <mml:msub><mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">s</mml:mi> <mml:mrow><mml:mi mathvariant="bold">L</mml:mi> <mml:mo>-</mml:mo> <mml:mn mathvariant="bold">2</mml:mn></mml:mrow></mml:msub> <mml:mo>-</mml:mo> <mml:mi mathvariant="bold">t</mml:mi></mml:mfenced> <mml:mn>2</mml:mn></mml:msub></mml:mrow></mml:math></alternatives></disp-formula></p>
<p>In case of coiled animals (<xref ref-type="fig" rid="pcbi.1005530.g005">Fig 5a</xref>) the spine calculation fails to extract the posture correctly. As a consequence, all spine-related features are not reliable. To mark these ambiguous situations, a binary indicator <italic>c</italic>? is introduced to determine coiled states. The coiled indicator is true if one of the following constraints is satisfied:</p>
<list list-type="order">
<list-item>
<p>The perimeter to spine length fraction converges to <italic>π</italic> (<inline-formula id="pcbi.1005530.e058"><alternatives><graphic id="pcbi.1005530.e058g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e058" xlink:type="simple"/><mml:math display="inline" id="M58"><mml:mrow><mml:mfrac><mml:mi>P</mml:mi> <mml:mi>L</mml:mi></mml:mfrac> <mml:mo>≈</mml:mo> <mml:mi>π</mml:mi></mml:mrow></mml:math></alternatives></inline-formula>; <xref ref-type="fig" rid="pcbi.1005530.g005">Fig 5b</xref>)</p>
</list-item>
<list-item>
<p>The circle given by the mid spine point radius divided by the perimeter converges to 1 (<inline-formula id="pcbi.1005530.e059"><alternatives><graphic id="pcbi.1005530.e059g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e059" xlink:type="simple"/><mml:math display="inline" id="M59"><mml:mrow><mml:mfrac><mml:mrow><mml:mn>2</mml:mn> <mml:msub><mml:mi>r</mml:mi> <mml:mtext>mid</mml:mtext></mml:msub> <mml:mi>π</mml:mi></mml:mrow> <mml:mi>P</mml:mi></mml:mfrac> <mml:mo>≈</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:math></alternatives></inline-formula>; <xref ref-type="fig" rid="pcbi.1005530.g005">Fig 5c</xref>)</p>
</list-item>
</list>
<fig id="pcbi.1005530.g005" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g005</object-id>
<label>Fig 5</label>
<caption>
<title>Two constraints are used to determine if an animal is in a coiled state.</title>
<p>(<bold>A</bold>) Larva in a coiled state. (<bold>B</bold>) Perimeter <italic>P</italic> to spine length <italic>L</italic> fraction. (<bold>C</bold>) Mid spine point radius <italic>r</italic><sub>mid</sub> to perimeter <italic>P</italic> ratio.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g005" xlink:type="simple"/>
</fig>
<p><italic>Motion-related features</italic>. Most of the motion-related features are calculated based on the animal’s center of mass <bold>m</bold> since this point is calculated directly from the contour and does not depend on the spine calculation. The accumulated distance for an animal at time <italic>t</italic> is calculated by
<disp-formula id="pcbi.1005530.e060"><alternatives><graphic id="pcbi.1005530.e060g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e060" xlink:type="simple"/><mml:math display="block" id="M60"><mml:mrow><mml:msub><mml:mi>d</mml:mi> <mml:mtext>acc</mml:mtext></mml:msub> <mml:mo>=</mml:mo> <mml:munderover><mml:mo>∑</mml:mo> <mml:mrow><mml:mi>i</mml:mi> <mml:mo>=</mml:mo> <mml:mn>1</mml:mn></mml:mrow> <mml:mrow><mml:mi>t</mml:mi> <mml:mo>-</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:munderover> <mml:msub><mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mi mathvariant="bold">i</mml:mi></mml:msub> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mrow><mml:mi mathvariant="bold">i</mml:mi> <mml:mo>+</mml:mo> <mml:mn mathvariant="bold">1</mml:mn></mml:mrow></mml:msub></mml:mfenced> <mml:mn>2</mml:mn></mml:msub></mml:mrow></mml:math></alternatives></disp-formula>
and the distance to origin is given by
<disp-formula id="pcbi.1005530.e061"><alternatives><graphic id="pcbi.1005530.e061g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e061" xlink:type="simple"/><mml:math display="block" id="M61"><mml:mrow><mml:msub><mml:mi>d</mml:mi> <mml:mtext>org</mml:mtext></mml:msub> <mml:mo>=</mml:mo> <mml:msub><mml:mfenced close="∥" open="∥" separators=""><mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mn mathvariant="bold">1</mml:mn></mml:msub> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mi mathvariant="bold">t</mml:mi></mml:msub></mml:mfenced> <mml:mn>2</mml:mn></mml:msub></mml:mrow></mml:math></alternatives></disp-formula>
Furthermore, the velocity for time <italic>t</italic> is calculated by
<disp-formula id="pcbi.1005530.e062"><alternatives><graphic id="pcbi.1005530.e062g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e062" xlink:type="simple"/><mml:math display="block" id="M62"><mml:mrow><mml:msub><mml:mi>v</mml:mi> <mml:mi>m</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mfrac><mml:mrow><mml:mrow><mml:mo>∥</mml:mo></mml:mrow> <mml:mrow><mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mrow><mml:mi mathvariant="bold">t</mml:mi> <mml:mo>-</mml:mo> <mml:mfrac><mml:mtext>fps</mml:mtext> <mml:mn mathvariant="bold">2</mml:mn></mml:mfrac></mml:mrow></mml:msub> <mml:mo>-</mml:mo> <mml:msub><mml:mi mathvariant="bold">m</mml:mi> <mml:mrow><mml:mi mathvariant="bold">t</mml:mi> <mml:mo>+</mml:mo> <mml:mfrac><mml:mtext>fps</mml:mtext> <mml:mn mathvariant="bold">2</mml:mn></mml:mfrac></mml:mrow></mml:msub></mml:mrow> <mml:msub><mml:mrow><mml:mo>∥</mml:mo></mml:mrow> <mml:mn>2</mml:mn></mml:msub></mml:mrow> <mml:mtext>fps</mml:mtext></mml:mfrac></mml:mrow></mml:math></alternatives></disp-formula>
where fps is the given frame rate. In a similar fashion, the acceleration is obtained by using consecutive velocities:
<disp-formula id="pcbi.1005530.e063"><alternatives><graphic id="pcbi.1005530.e063g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e063" xlink:type="simple"/><mml:math display="block" id="M63"><mml:mrow><mml:msub><mml:mi>a</mml:mi> <mml:mi>m</mml:mi></mml:msub> <mml:mo>=</mml:mo> <mml:mfrac><mml:mrow><mml:mrow><mml:mo>∥</mml:mo></mml:mrow> <mml:msub><mml:mi>v</mml:mi> <mml:mrow><mml:mi>m</mml:mi> <mml:mo>,</mml:mo> <mml:mi>t</mml:mi></mml:mrow></mml:msub> <mml:mo>-</mml:mo> <mml:msub><mml:mi>v</mml:mi> <mml:mrow><mml:mi>m</mml:mi> <mml:mo>,</mml:mo> <mml:mi>t</mml:mi> <mml:mo>+</mml:mo> <mml:mn>1</mml:mn></mml:mrow></mml:msub> <mml:msub><mml:mrow><mml:mo>∥</mml:mo></mml:mrow> <mml:mn>2</mml:mn></mml:msub></mml:mrow> <mml:mtext>2</mml:mtext></mml:mfrac></mml:mrow></mml:math></alternatives></disp-formula></p>
<p>To identify if an animal is in a go phase, a binary indicator <italic>g</italic>? is used. The following constraints must be valid for a go phase:</p>
<list list-type="bullet">
<list-item>
<p>The velocity <italic>v</italic><sub><italic>m</italic></sub> is above a certain threshold</p>
</list-item>
<list-item>
<p>There is no strong bending <italic>γ</italic> of the animal’s body</p>
</list-item>
</list>
<p specific-use="continuation">To avoid alternating go phase measurements, a user-specified minimal go phase length (<italic>τ</italic><sub>go</sub>) is used to extract continuous phases. This implies that the number of consecutive <italic>g</italic>? = <italic>true</italic> measurements has to be ≥ <italic>τ</italic><sub>go</sub> to classify this sequence as a go phase. An animal is in a reorientation phase if <italic>g</italic>? is false.</p>
<p><italic>Stimulus-related features</italic>. In order to extend the capabilities of FIMTrack it is possible to place different stimulus markers on the raw image in the results viewer. The following markers are supported:</p>
<list list-type="bullet">
<list-item>
<p><bold>Point</bold> which is a (<italic>x</italic>, <italic>y</italic>) position</p>
</list-item>
<list-item>
<p><bold>Line</bold> which is a straight line segment</p>
</list-item>
<list-item>
<p><bold>Rectangle</bold> which is an arbitrarily sized axis-aligned 2D rectangle</p>
</list-item>
<list-item>
<p><bold>Ellipsoid</bold> which is an arbitrarily sized axis-aligned 2D ellipsoid</p>
</list-item>
</list>
<p specific-use="continuation">For all markers the additional features <italic>distance to stimulus</italic>, <italic>bearing angle to stimulus</italic>, and <italic>is in stimulus region</italic> are calculated for each time point and animal. The distance to a stimulus is given by the Euclidean distance between the center of mass <bold>m</bold> of the animal and the point <bold>p</bold> representing the nearest point on the stimulus. The bearing angle <italic>β</italic> is obtained by using <xref ref-type="disp-formula" rid="pcbi.1005530.e056">Eq (3)</xref> with <bold>v</bold><sub><bold>1</bold></sub> = <bold>m</bold> − <bold>t</bold> and <bold>v</bold><sub><bold>2</bold></sub> = <bold>p</bold> − <bold>t</bold> (note that the tail <bold>t</bold> is used since it is not affected by head casts).</p>
<p>Given a <bold>point stimulus</bold> the necessary computations are straight forward. The nearest point between the animal and a <bold>line stimulus</bold> is obtained by performing an orthogonal projection of <bold>m</bold> on the line defined by the line segment. If the projected point <bold>p</bold> is not located on the line segment we take one of the two endpoints of the line segment as the nearest point which has the minimal Euclidean distance to <bold>p</bold>. In case of a <bold>rectangular stimulus</bold> the nearest point <bold>p</bold> is calculated by <bold>p</bold> = arg min<sub><bold>p</bold><sub><italic>i</italic></sub></sub> ∥<bold>m</bold> − <bold>p</bold><sub><italic>i</italic></sub> ∥<sub>2</sub>, where <bold>p</bold><sub><italic>i</italic></sub> is the associated orthogonal protection of <bold>m</bold> onto each of the four boundaries of the stimulus. Since the calculation of the exact nearest point <bold>p</bold> of <bold>m</bold> on a <bold>ellipsoid stimulus</bold> cannot easily be performed in an analytical fashion, we use an approximation of <bold>p</bold>. Given an axis-aligned ellipse centered at <bold>c</bold> = (<italic>c</italic><sub><italic>x</italic></sub>, <italic>c</italic><sub><italic>y</italic></sub>). First, a line <bold>l</bold> going through <bold>m</bold> and <bold>c</bold> is determined. Next the intersection points <bold>p</bold><sub><bold>1</bold></sub> and <bold>p</bold><sub><bold>2</bold></sub> between <bold>l</bold> and the ellipse are obtained and the intersection point with the minimum distance to <bold>m</bold> is taken as the approximation of <bold>p</bold>.</p>
</sec>
</sec>
<sec id="sec009">
<title>Results viewer module</title>
<p>The <italic>results viewer</italic> module offers the possibility to review the calculated features. The experimenter can load, display, and manually correct the posture and motion-related features or even manually track some animals if they could not be recognized automatically. If an animal model is adjusted manually all features are updated accordingly. The results viewer module itself is divided into three main parts, namely the <italic>image view</italic> (<xref ref-type="fig" rid="pcbi.1005530.g006">Fig 6a</xref>), the <italic>table view</italic> (<xref ref-type="fig" rid="pcbi.1005530.g006">Fig 6b</xref>) and the <italic>animal view</italic> (<xref ref-type="fig" rid="pcbi.1005530.g006">Fig 6c</xref>).</p>
<fig id="pcbi.1005530.g006" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g006</object-id>
<label>Fig 6</label>
<caption>
<title>Results viewer module.</title>
<p>(<bold>A</bold>) Image view with the raw image, an overlay of the color coded features, and two stimuli marker with the notations given in the text. (<bold>B</bold>) Table view. (<bold>C</bold>) Animal view with both a cropped region of a single larva and plots of some features.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g006" xlink:type="simple"/>
</fig>
<p>The image view provides a qualitative impression of the tracking results. Most of the calculated features are plotted color coded for each animal as an overlay onto the raw images. Moreover, the user can manually change the calculated model or merge/remove trajectories. This is particularly helpful to resolve ambiguous situations like coiled or colliding animals. In the table view all calculated features can be inspected in a table showing animals in columns and the associated features in rows. The animal view can be used to inspect the results for a single animal in more detail: both a cropped region of a single animal and plots for relevant features can be obtained simultaneously.</p>
</sec>
<sec id="sec010">
<title>IO module</title>
<p>This module is responsible for reading and writing files. Currently the image file formats TIFF and PNG are supported. A CSV file containing all calculated features, a YML file including the same measurements as the CSV file in combination with some additional informations like the processed images, and an image with color coded trajectories are generated after tracking has been performed. It should be mentioned that the CSV format is standardized and can directly be imported into a variety of analysis programs (e.g. MATLAB, Excel, R).</p>
</sec>
</sec>
<sec id="sec011" sec-type="results">
<title>Results</title>
<p>Most of the calculated features rely on a precise calculation of the center of mass (e.g. accumulated distance, velocity, bearing, etc.). Furthermore, good candidates to assess the quality of the calculated model are the mid spine point and the body bending (most of the secondary and motion-related features are derived from the underlying model). Here, we evaluate the accuracy of the software regarding these features.</p>
<sec id="sec012">
<title>Ground truth data</title>
<p>An image sequence with a resolution of 2040 × 2048 pixels acquired with a Basler acA2040-25gm camera equipped with a 16mm objective (KOWA LM16HC) containing 15 larvae over 211 frames was used to generate ground truth data (<xref ref-type="fig" rid="pcbi.1005530.g007">Fig 7a and 7b</xref>). All animals were associated with a larval model consisting of the head, tail, and 5 equidistant spine points associated with appropriate radii. Furthermore, the center of mass was calculated based on these models.</p>
<fig id="pcbi.1005530.g007" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g007</object-id>
<label>Fig 7</label>
<caption>
<title>An image from the ground truth dataset and the manually generated model.</title>
<p>(<bold>A</bold>) Exemplary image used for ground truth generation. (<bold>B</bold>) Close up of the dashed box from Fig 7a.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g007" xlink:type="simple"/>
</fig>
<p>For the subsequent analysis we considered the 10 trajectories of the larvae which could be tracked by FIMTrack over all 211 frames (i.e. larvae which crawl at least by there own body length and do not collide).</p>
</sec>
<sec id="sec013">
<title>Measured deviations</title>
<p>Deviations from the ground truth are determined by calculating the Euclidean distances between the tracking results and ground truth data for both the center of mass and the central spine point. For the body bending, absolute differences are used to determine the accuracy. <xref ref-type="table" rid="pcbi.1005530.t001">Table 1</xref> illustrates the deviations.</p>
<table-wrap id="pcbi.1005530.t001" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.t001</object-id>
<label>Table 1</label>
<caption>
<title>Deviations for the examined parameters.</title>
<p>Body bending is given in degree, all other parameters are given in pixels. Max<sup>⋆</sup> represents the values obtained by including outliers whereas OL gives the number of outliers.</p>
</caption>
<alternatives>
<graphic id="pcbi.1005530.t001g" mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.t001" xlink:type="simple"/>
<table border="0" frame="box" rules="all">
<colgroup>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
</colgroup>
<thead>
<tr>
<th align="left">Deviations</th>
<th align="right">Mean (±Std)</th>
<th align="right">Median</th>
<th align="right">Min</th>
<th align="right">Max</th>
<th align="right">Max<sup>⋆</sup></th>
<th align="right">OL</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">Center of mass</td>
<td align="right">1.86 (±0.23)</td>
<td align="char" char=".">1.85</td>
<td align="char" char=".">1.21</td>
<td align="char" char=".">2.55</td>
<td align="char" char=".">2.84</td>
<td align="right">17 (0.80%)</td>
</tr>
<tr>
<td align="left">Central spine point</td>
<td align="right">1.84 (±1.10)</td>
<td align="char" char=".">1.57</td>
<td align="char" char=".">0.50</td>
<td align="char" char=".">4.58</td>
<td align="char" char=".">16.84</td>
<td align="right">61 (2.89%)</td>
</tr>
<tr>
<td align="left">Body bending</td>
<td align="right">3.54 (±7.51)</td>
<td align="char" char=".">2.55</td>
<td align="char" char=".">0.00</td>
<td align="char" char=".">13.16</td>
<td align="char" char=".">171.00</td>
<td align="right">46 (2.18%)</td>
</tr>
</tbody>
</table>
</alternatives>
</table-wrap>
<p>Obviously the deviation of the center of mass and the deviation of the central spine point are below 2 pixels in mean and median. It should be noted that during tracking no sub-pixel accuracy is used and thus the minimum possible error is 1 pixel if the displacement happens either in <italic>x</italic> or <italic>y</italic> direction. For a diagonal displacement the minimum possible error is <inline-formula id="pcbi.1005530.e064"><alternatives><graphic id="pcbi.1005530.e064g" mimetype="image" position="anchor" xlink:href="info:doi/10.1371/journal.pcbi.1005530.e064" xlink:type="simple"/><mml:math display="inline" id="M64"><mml:mrow><mml:msqrt><mml:mn>2</mml:mn></mml:msqrt> <mml:mo>≈</mml:mo> <mml:mn>1</mml:mn> <mml:mo>.</mml:mo> <mml:mn>41</mml:mn></mml:mrow></mml:math></alternatives></inline-formula> pixels. In combination with the area of the animals which range from 232.50 to 454.50 square pixels, this leads us to the assertion that deviations below 2 pixels are caused due to noise.</p>
<sec id="sec014">
<title>Center of mass</title>
<p>A detailed overview of the center of mass progress is given in <xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8a</xref>. Each boxplot represents the center of mass deviation for the respective larva. None of the measurements has a median deviation above 3 pixels. This suggests that the divergence is rather the result of an inaccuracy of the tracking algorithm but more likely caused by the previously performed image processing and definitely influenced by the non-contour-based center of mass extraction in the ground truth data.</p>
<fig id="pcbi.1005530.g008" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g008</object-id>
<label>Fig 8</label>
<caption>
<title>Measured deviations.</title>
<p>(<bold>A</bold>) Center of mass deviations. (<bold>B</bold>) Central spine point deviations. (<bold>C</bold>) Body bending angle deviations. The mean divergence of the body bending is sketched by the light yellow area in the larva image at the top left corner. (<bold>D</bold>) The coiled structure of larva 6 (at <italic>t</italic> = 2, 3) causes outliers in the measurements (compare to <xref ref-type="table" rid="pcbi.1005530.t001">Table 1</xref>). The head is given in red and tail is given in blue.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g008" xlink:type="simple"/>
</fig>
</sec>
<sec id="sec015">
<title>Central spine point</title>
<p>The central spine point location contains more outliers compared to the center of mass measurements. The maximal deviation (including outliers) between a measurement and the ground truth is 16.84 pixels (<xref ref-type="table" rid="pcbi.1005530.t001">Table 1</xref>). As illustrated in <xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8b</xref> measurements for larva 6 include most outliers. These inaccuracies are caused within several frames in which the animal is coiled resulting in an erroneous spine calculation (<xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8d</xref>). The median spine point deviation is below 2 pixels and after removing the outliers the maximum distance decreases to 4.58 pixels (<xref ref-type="table" rid="pcbi.1005530.t001">Table 1</xref>).</p>
<p>To further study the accuracy an overlay of ground truth and calculated central spine point trajectories is given in <xref ref-type="fig" rid="pcbi.1005530.g009">Fig 9</xref>. Since no sub-pixel accuracy is used for tracking, the calculated path contains more straight lines interrupted by edges. However, the deviation from the ground truth path is rarely more than one pixel.</p>
<fig id="pcbi.1005530.g009" position="float">
<object-id pub-id-type="doi">10.1371/journal.pcbi.1005530.g009</object-id>
<label>Fig 9</label>
<caption>
<title>Resultant center of mass trajectories compared to the ground truth paths.</title>
<p>(<bold>A</bold>) Center of mass point of the ground truth and tracked larvae. (<bold>B</bold>) Close-up or the dashed box from Fig 9a.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.g009" xlink:type="simple"/>
</fig>
</sec>
<sec id="sec016">
<title>Body bending</title>
<p>A high tracking precision can also be observed within the body bending quantification: the mean deviation is below 4° (<xref ref-type="table" rid="pcbi.1005530.t001">Table 1</xref>) which is depicted in the top left corner of <xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8c</xref> where the head of the larva is given in red, the tail in blue, and the central spine point in black. The mean deviation is indicated by the light yellow area visible at both sides of the spine segment connecting the head and the tail.</p>
<p>By taking a closer look at the plots given in <xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8c</xref>, it can be seen that again only larva 6 includes several frames with a very strong deviation. Since the deviations go up to 171° the head and the central spine point are swapped which can be observed in <xref ref-type="fig" rid="pcbi.1005530.g008">Fig 8d</xref>.</p>
</sec>
</sec>
</sec>
<sec id="sec017">
<title>Availability and future directions</title>
<p>FIMTrack is freely available as a pre-built binary package for Windows and Mac at <ext-link ext-link-type="uri" xlink:href="http://fim.uni-muenster.de" xlink:type="simple">http://fim.uni-muenster.de</ext-link>. Further documentation and exemplary FIM-images for testing purposes are available at the same website. An open-access video tutorial for experimental biologists illustrating the usage of our system with and without stimulation can be found in [<xref ref-type="bibr" rid="pcbi.1005530.ref012">12</xref>].</p>
<p>The source code of FIMTrack is licensed under the GNU GPLv3 and can be obtained from <ext-link ext-link-type="uri" xlink:href="https://github.com/i-git/FIMTrack" xlink:type="simple">https://github.com/i-git/FIMTrack</ext-link>. Users implementing new features or extensions are encouraged to submit their work via GitHub’s pull request mechanism for inclusion in a coming release.</p>
<p>In the past, several others groups successfully used FIMTrack to differentiate between different behavioral phenotypes (examples for Drosophila larvae can be found in [<xref ref-type="bibr" rid="pcbi.1005530.ref009">9</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref018">18</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref019">19</xref>] and for C. elegans in [<xref ref-type="bibr" rid="pcbi.1005530.ref013">13</xref>]). Furthermore, the software has been used as the basis for extensions in order to address more specific biological questions [<xref ref-type="bibr" rid="pcbi.1005530.ref008">8</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref010">10</xref>, <xref ref-type="bibr" rid="pcbi.1005530.ref020">20</xref>].</p>
<p>It should be noted that FIMTrack has been initially developed for FIM images and Drosophila larvae [<xref ref-type="bibr" rid="pcbi.1005530.ref007">7</xref>]. For example, the algorithms described above only segment the animals if the background is darker than the foreground (i.e. the animals). However, we successfully adopted the algorithm to track images recorded with transmitted light illumination by inverting the images before passing them to FIMTrack. Furthermore, some of the extracted features are only valid for larval behavior like the stop and go classification. Otherwise, since the complete model of the animal (<xref ref-type="disp-formula" rid="pcbi.1005530.e035">Eq 1</xref>) obtained after tracking, prepossessing, and maybe some user adjustments is saved in a standardized file format (i.e. CSV), higher-level features for other model organisms can be derived easily. Finally, FIMTrack does not include a module to resolve colliding animals so that the identities of animals participating in a collision get lost and the trajectories of these animals terminate. After the ending of the collision the associated animals receive new identities and are treated as newly appeared.</p>
<p>In the future, we are going to extend FIMTrack by optimizing the tracking for other model organisms like flatworms. In order to overcome the problem of losing identities and behavioral quantities during animal-animal contact, we are working on a statistical approach capable of resolving colliding animals.</p>
</sec>
<sec id="sec018">
<title>Supporting information</title>
<supplementary-material id="pcbi.1005530.s001" mimetype="application/zip" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.s001" xlink:type="simple">
<label>S1 Data</label>
<caption>
<title>In order to quantify the accuracy of FIMTrack we have manually tracked 15 larvae over 211 frames.</title>
<p>The resultant quantities and the used evaluation script are provided in order to guarantee reproducibility of our results. Note that the images can be downloaded at <ext-link ext-link-type="uri" xlink:href="http://fim.uni-muenster.de" xlink:type="simple">http://fim.uni-muenster.de</ext-link>.</p>
<p>(ZIP)</p>
</caption>
</supplementary-material>
<supplementary-material id="pcbi.1005530.s002" mimetype="application/pdf" position="float" xlink:href="info:doi/10.1371/journal.pcbi.1005530.s002" xlink:type="simple">
<label>S1 Text</label>
<caption>
<title>FIMTrack manual describing the work flow.</title>
<p>(PDF)</p>
</caption>
</supplementary-material>
</sec>
</body>
<back>
<ref-list>
<title>References</title>
<ref id="pcbi.1005530.ref001">
<label>1</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Gohl</surname> <given-names>DM</given-names></name>, <name name-style="western"><surname>Silies</surname> <given-names>MA</given-names></name>, <name name-style="western"><surname>Gao</surname> <given-names>XJ</given-names></name>, <name name-style="western"><surname>Bhalerao</surname> <given-names>S</given-names></name>, <name name-style="western"><surname>Luongo</surname> <given-names>FJ</given-names></name>, <name name-style="western"><surname>Lin</surname> <given-names>CC</given-names></name>, <etal>et al</etal>. <article-title>A versatile in vivo system for directed dissection of gene expression patterns</article-title>. <source>Nature Methods</source>. <year>2011</year>;<volume>8</volume>(<issue>3</issue>):<fpage>231</fpage>–<lpage>237</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1038/nmeth.1561" xlink:type="simple">10.1038/nmeth.1561</ext-link></comment> <object-id pub-id-type="pmid">21473015</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref002">
<label>2</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Sokolowski</surname> <given-names>MB</given-names></name>. <article-title>Drosophila: Genetics meets behaviour</article-title>. <source>Nature Reviews Genetics</source>. <year>2001</year>;<volume>2</volume>(<issue>11</issue>):<fpage>879</fpage>–<lpage>890</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1038/35098592" xlink:type="simple">10.1038/35098592</ext-link></comment> <object-id pub-id-type="pmid">11715043</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref003">
<label>3</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Spink</surname> <given-names>AJ</given-names></name>, <name name-style="western"><surname>Tegelenbosch</surname> <given-names>RA</given-names></name>, <name name-style="western"><surname>Buma</surname> <given-names>MO</given-names></name>, <name name-style="western"><surname>Noldus</surname> <given-names>LP</given-names></name>. <article-title>The EthoVision video tracking system–a tool for behavioral phenotyping of transgenic mice</article-title>. <source>Physiology and Behavior</source>. <year>2001</year>;<volume>73</volume>(<issue>5</issue>):<fpage>731</fpage>–<lpage>744</lpage>. <object-id pub-id-type="pmid">11566207</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref004">
<label>4</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Swierczek</surname> <given-names>NA</given-names></name>, <name name-style="western"><surname>Giles</surname> <given-names>AC</given-names></name>, <name name-style="western"><surname>Rankin</surname> <given-names>CH</given-names></name>, <name name-style="western"><surname>Kerr</surname> <given-names>RA</given-names></name>. <article-title>High-throughput behavioral analysis in C. elegans</article-title>. <source>Nature Methods</source>. <year>2011</year>;<volume>8</volume>(<issue>7</issue>):<fpage>592</fpage>–<lpage>598</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1038/nmeth.1625" xlink:type="simple">10.1038/nmeth.1625</ext-link></comment> <object-id pub-id-type="pmid">21642964</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref005">
<label>5</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Gershow</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Berck</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Mathew</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Luo</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Kane</surname> <given-names>EA</given-names></name>, <name name-style="western"><surname>Carlson</surname> <given-names>JR</given-names></name>, <etal>et al</etal>. <article-title>Controlling airborne cues to study small animal navigation</article-title>. <source>Nature Methods</source>. <year>2012</year>;<volume>9</volume>(<issue>3</issue>):<fpage>290</fpage>–<lpage>296</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1038/nmeth.1853" xlink:type="simple">10.1038/nmeth.1853</ext-link></comment> <object-id pub-id-type="pmid">22245808</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref006">
<label>6</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Gomez-Marin</surname> <given-names>A</given-names></name>, <name name-style="western"><surname>Partoune</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Stephens</surname> <given-names>GJ</given-names></name>, <name name-style="western"><surname>Louis</surname> <given-names>M</given-names></name>. <article-title>Automated Tracking of Animal Posture and Movement during Exploration and Sensory Orientation Behaviors</article-title>. <source>PLoS ONE</source>. <year>2012</year>; <volume>7</volume>(<issue>8</issue>): <fpage>e41642</fpage>. <object-id pub-id-type="pmid">22912674</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref007">
<label>7</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Risse</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Thomas</surname> <given-names>S</given-names></name>, <name name-style="western"><surname>Otto</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Löpmeier</surname> <given-names>T</given-names></name>, <name name-style="western"><surname>Valkov</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Jiang</surname> <given-names>X</given-names></name>, <etal>et al</etal>. <article-title>FIM, a novel FTIR-based imaging method for high throughput locomotion analysis</article-title>. <source>PloS ONE</source>. <year>2013</year>;<volume>8</volume>(<issue>1</issue>):<fpage>e53963</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1371/journal.pone.0053963" xlink:type="simple">10.1371/journal.pone.0053963</ext-link></comment> <object-id pub-id-type="pmid">23349775</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref008">
<label>8</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Risse</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Berh</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Otto</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Jiang</surname> <given-names>X</given-names></name>, <name name-style="western"><surname>Klämbt</surname> <given-names>C</given-names></name>. <article-title>Quantifying subtle locomotion phenotypes of Drosophila larvae using internal structures based on FIM images</article-title>. <source>Computers in biology and medicine</source>. <year>2015</year>;<volume>63</volume>:<fpage>269</fpage>–<lpage>276</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.compbiomed.2014.08.026" xlink:type="simple">10.1016/j.compbiomed.2014.08.026</ext-link></comment> <object-id pub-id-type="pmid">25280919</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref009">
<label>9</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Slater</surname> <given-names>G</given-names></name>, <name name-style="western"><surname>Levy</surname> <given-names>P</given-names></name>, <name name-style="western"><surname>Chan</surname> <given-names>KA</given-names></name>, <name name-style="western"><surname>Larsen</surname> <given-names>C</given-names></name>. <article-title>A Central Neural Pathway Controlling Odor Tracking in <italic>Drosophila</italic></article-title>. <source>The Journal of Neuroscience</source>. <year>2015</year>;<volume>35</volume>(<issue>5</issue>):<fpage>1831</fpage>–<lpage>1848</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1523/JNEUROSCI.2331-14.2015" xlink:type="simple">10.1523/JNEUROSCI.2331-14.2015</ext-link></comment> <object-id pub-id-type="pmid">25653345</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref010">
<label>10</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Otto</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Risse</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Berh</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Bittern</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Jiang</surname> <given-names>X</given-names></name>, <name name-style="western"><surname>Klämbt</surname> <given-names>C</given-names></name>. <article-title>Interactions among Drosophila larvae before and during collision</article-title>. <source>Scientific Reports</source>. <year>2016</year>;<volume>6</volume>:<fpage>31564</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1038/srep31564" xlink:type="simple">10.1038/srep31564</ext-link></comment> <object-id pub-id-type="pmid">27511760</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref011">
<label>11</label>
<mixed-citation publication-type="other" xlink:type="simple">Kiel M, Berh D, Daniel J, Otto N, ter Steege A, Jiang X, et al. A Multi-Purpose Worm Tracker Based on FIM; in preparation.</mixed-citation>
</ref>
<ref id="pcbi.1005530.ref012">
<label>12</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Risse</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Otto</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Berh</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Jiang</surname> <given-names>X</given-names></name>, <name name-style="western"><surname>Klämbt</surname> <given-names>C</given-names></name>. <article-title>FIM Imaging and FIMTrack: Two New Tools Allowing High-Throughput and Cost Effective Locomotion Analysis</article-title>. <source>The Journal of Visualized Experiments</source>. <year>2014</year>; (<issue>94</issue>):<fpage>e52207</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.3791/52207" xlink:type="simple">10.3791/52207</ext-link></comment> <object-id pub-id-type="pmid">25591081</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref013">
<label>13</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Colin</surname> <given-names>E</given-names></name>, <name name-style="western"><surname>Daniel</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Ziegler</surname> <given-names>A</given-names></name>, <name name-style="western"><surname>Wakim</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Scrivo</surname> <given-names>A</given-names></name>, <name name-style="western"><surname>Haack</surname> <given-names>TB</given-names></name>, <etal>et al</etal>. <article-title>Biallelic Variants in UBA5 Reveal that Disruption of the UFM1 Cascade Can Result in Early-Onset Encephalopathy</article-title>. <source>The American Journal of Human Genetics</source>. <year>2016</year>;<volume>99</volume>(<issue>3</issue>):<fpage>695</fpage>–<lpage>703</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.ajhg.2016.06.030" xlink:type="simple">10.1016/j.ajhg.2016.06.030</ext-link></comment> <object-id pub-id-type="pmid">27545681</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref014">
<label>14</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Suzuki</surname> <given-names>S</given-names></name>. <article-title>Topological structural analysis of digitized binary images by border following</article-title>. <source>Computer Vision, Graphics, and Image Processing</source>. <year>1985</year>;<volume>30</volume>(<issue>1</issue>):<fpage>32</fpage>–<lpage>46</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/0734-189X(85)90016-7" xlink:type="simple">10.1016/0734-189X(85)90016-7</ext-link></comment></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref015">
<label>15</label>
<mixed-citation publication-type="other" xlink:type="simple">Chetverikov D. A simple and efficient algorithm for detection of high curvature points in planar curves. In: Proc. of the 10th International Conference on Computer Analysis of Images and Patterns; 2003. p. 746–753.</mixed-citation>
</ref>
<ref id="pcbi.1005530.ref016">
<label>16</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Kuhn</surname> <given-names>HW</given-names></name>. <article-title>The Hungarian method for the assignment problem</article-title>. <source>Naval Research Logistics Quarterly</source>. <year>1955</year>;<volume>2</volume>(<issue>1–2</issue>):<fpage>83</fpage>–<lpage>97</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1007/978-3-540-68279-0_2" xlink:type="simple">10.1007/978-3-540-68279-0_2</ext-link></comment></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref017">
<label>17</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Munkres</surname> <given-names>J</given-names></name>. <article-title>Algorithms for the assignment and transportation problems</article-title>. <source>Journal of the Society for Industrial and Applied Mathematics</source>. <year>1957</year>;<volume>5</volume>(<issue>1</issue>):<fpage>32</fpage>–<lpage>38</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1137/0105003" xlink:type="simple">10.1137/0105003</ext-link></comment></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref018">
<label>18</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Kunc</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Arefin</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Hyrsl</surname> <given-names>P</given-names></name>, <name name-style="western"><surname>Theopold</surname> <given-names>U</given-names></name>. <article-title>Monitoring the effect of pathogenic nematodes on locomotion of Drosophila larvae</article-title>. <source>Fly</source>. <year>2017</year>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1080/19336934.2017.1297350" xlink:type="simple">10.1080/19336934.2017.1297350</ext-link></comment></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref019">
<label>19</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Hirono</surname> <given-names>K</given-names></name>, <name name-style="western"><surname>Kohwi</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Clark</surname> <given-names>MQ</given-names></name>, <name name-style="western"><surname>Heckscher</surname> <given-names>ES</given-names></name>, <name name-style="western"><surname>Doe</surname> <given-names>CQ</given-names></name>. <article-title>The Hunchback temporal transcription factor establishes, but is not required to maintain, early-born neuronal identity</article-title>. <source>Neural Development</source>. <year>2017</year>;<volume>12</volume>(<issue>1</issue>):<fpage>1</fpage>–<lpage>11</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1186/s13064-017-0078-1" xlink:type="simple">10.1186/s13064-017-0078-1</ext-link></comment> <object-id pub-id-type="pmid">28137283</object-id></mixed-citation>
</ref>
<ref id="pcbi.1005530.ref020">
<label>20</label>
<mixed-citation publication-type="journal" xlink:type="simple">
<name name-style="western"><surname>Risse</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Otto</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Berh</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Jiang</surname> <given-names>X</given-names></name>, <name name-style="western"><surname>Kiel</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Klämbt</surname> <given-names>C</given-names></name>. <article-title>FIM<sup>2<italic>c</italic></sup>: Multicolor, Multipurpose Imaging System to Manipulate and Analyze Animal Behavior</article-title>. <source>IEEE Transactions on Biomedical Engineering</source>. <year>2017</year>;<volume>64</volume>(<issue>3</issue>):<fpage>610</fpage>–<lpage>620</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1109/TBME.2016.2570598" xlink:type="simple">10.1109/TBME.2016.2570598</ext-link></comment> <object-id pub-id-type="pmid">28113210</object-id></mixed-citation>
</ref>
</ref-list>
</back>
</article>