<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="other" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.19801.3</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Software Tool Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>bwimage: A package to describe image patterns in natural structures</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 3; peer review: 2 approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Biagolini-Jr.</surname>
                        <given-names>Carlos</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-3699-3337</uri>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Macedo</surname>
                        <given-names>Regina H.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Funding Acquisition</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>Programa de P&#x00f3;s-Gradua&#x00e7;&#x00e3;o em Ecologia, Universidade de Bras&#x00ed;lia, Bras&#x00ed;lia, DF, 70910-900, Brazil</aff>
                <aff id="a2">
                    <label>2</label>Departamento de Zoologia, Universidade de Bras&#x00ed;lia, Bras&#x00ed;lia, DF, 70910-900, Brazil</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:c.biagolini@gmail.com">c.biagolini@gmail.com</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>14</day>
                <month>4</month>
                <year>2020</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2019</year>
            </pub-date>
            <volume>8</volume>
            <elocation-id>1168</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>7</day>
                    <month>4</month>
                    <year>2020</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Biagolini-Jr. C and Macedo RH</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/8-1168/pdf"/>
            <abstract>
                <p>Currently R is the most popular software for data analyses among biologists. Here, we present bwimage, a package designed to describe patterns from black and white images. The package can be used for a wide range of applications. We implemented functions previously described in the literature to calculate parameters designed originally, but not exclusively, for vegetation structures. Additionally, we propose a new parameter: the aggregation index. We demonstrate applications for field work, providing examples that range from calculation of canopy openness, description of patterns in vertical vegetation structure, to patterns in bird nest structure. We provide advice and illustrated examples of how to produce high quality images for analyses.</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>animal</kwd>
                <kwd>ecology methods</kwd>
                <kwd>field</kwd>
                <kwd>image analyses</kwd>
                <kwd>image processing</kwd>
                <kwd>vegetation patterns</kwd>
            </kwd-group>
            <funding-group>
                <award-group id="fund-1" xlink:href="http://dx.doi.org/10.13039/501100002322">
                    <funding-source>Coordena&#x00e7;&#x00e3;o de Aperfei&#x00e7;oamento de Pessoal de N&#x00ed;vel Superior</funding-source>
                </award-group>
                <award-group id="fund-2" xlink:href="http://dx.doi.org/10.13039/501100003593">
                    <funding-source>Conselho Nacional de Desenvolvimento Cient&#x00ed;fico e Tecnol&#x00f3;gico</funding-source>
                </award-group>
                <funding-statement>CB received graduate fellowships from Coordena&#x00e7;&#x00e3;o de Aperfei&#x00e7;oamento de Pessoal de N&#x00ed;vel Superior (CAPES) and Conselho Nacional de Desenvolvimento Cient&#x00ed;fico e Tecnol&#x00f3;gico (CNPq).</funding-statement>
                <funding-statement>
                    <italic>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</italic>
                </funding-statement>
            </funding-group>
        </article-meta>
        <notes>
            <sec sec-type="version-changes">
                <label>Revised</label>
                <title>Amendments from Version 2</title>
                <p>Typos were fixed, and Dr. Roy Francis was included in the Acknowledgments section.</p>
            </sec>
        </notes>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>The facility to obtain high quality digital images creates the opportunity to measure natural variables using image analyses. Black and white pictures have frequently been used to understand patterns in field ecology, especially in plant biology studies
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>
                </sup>. However, the use of plant image analyses software is not easily extended to other biological fields for several reasons. Free programs are uncommon and paid software normally has threshold algorithms that were specifically designed for vegetation pictures
                <sup>
                    <xref ref-type="bibr" rid="ref-2">2</xref>
                </sup>. Thus, a flexible method that would allow the application of such analyses to other subjects would be welcome. For example, despite the relatively well reported descriptions of bird nests and egg morphology in Del Hoyo and collaborators
                <sup>
                    <xref ref-type="bibr" rid="ref-3">3</xref>
                </sup> (but see Xiao, Hu
                <sup>
                    <xref ref-type="bibr" rid="ref-4">4</xref>
                </sup>), there are no well-established approaches to estimate nest wall openness patterns.</p>
            <p>Currently, R software
                <sup>
                    <xref ref-type="bibr" rid="ref-5">5</xref>
                </sup> allows users to migrate from data processing based on combinations of different software (with the possibility of having costly licensing, software-specific files, incompatibility between operating systems and lack of updates) to a free, single cross-platform software. Here, we introduce bwimage, a package for R that can be used to analyze patterns in black and white images from natural structures. We provide data examples for applications and descriptions of routines for processing of black and white images.</p>
        </sec>
        <sec sec-type="methods">
            <title>Methods</title>
            <sec>
                <title>Implementation</title>
                <p>Bwimage&#x00b4;s analysis of images is based on the transformation from a picture (&#x201c;jpeg&#x201d; and &#x201c;png&#x201d; files are allowed) to a binary matrix (
                    <xref ref-type="fig" rid="f1">Figure 1</xref>). For each pixel, the intensity of red, green, blue, or the average of these three channels (argument channel) is compared to a threshold (argument threshold_value). If the average intensity is less than the threshold (default is 50%) the pixel will be set as black, otherwise it will be white. Beyond RGB intensity in PNG images, the alpha channel is used to set transparent pixels, i.e
                    <italic toggle="yes">.</italic> alpha channel values above the threshold (argument threshold_value; default is 50%) will set the pixel as transparent. In the data matrix, the value one represents black pixels, zero represents white pixels and NA represents transparent pixels. For high resolution files, i.e. numbers of pixels in width and height, we suggest reducing the resolution to create a smaller matrix, as this strongly reduces GPU usage and time necessary to run analyses. However, by reducing resolution, the accuracy of data description will also be lowered. 
                    <xref ref-type="fig" rid="f2">Figure 2</xref> compares different resamplings from a figure of 2500&#x00d7;2500 pixels. If the user is not acquainted with scale and threshold processing and/or images were captured under different light conditions, we recommend the scale and application of threshold algorithms in a native image editor software, such as GIMP
                    <sup>
                        <xref ref-type="bibr" rid="ref-6">6</xref>
                    </sup>, and subsequent usage of the resulting images with the bwimage package.</p>
                <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                    <label>Figure 1. </label>
                    <caption>
                        <title>General approach for image analysis in the bwimage package.</title>
                        <p>
                            <bold>A</bold>) An image of a natural structure is obtained with digital photography; here we used an image from a canopy. 
                            <bold>B</bold>) The image is converted into a binary matrix, functions 
                            <styled-content style="#0000FF" style-type="color">threshold_color</styled-content> (to a single image) or 
                            <styled-content style="#0000FF" style-type="color">threshold_image_list</styled-content> (for two or more images). In the data matrix the value one represents black pixels, zero represents white pixels and NA represents transparent pixels.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/25662/30590d48-9541-4cb3-9d25-63e700752aa9_figure1.gif"/>
                </fig>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>Figure 2. </label>
                    <caption>
                        <title>Comparison of different resamplings from a figure of 2500&#x00d7;2500 pixels.</title>
                        <p>
                            <bold>A</bold>) Original image. 
                            <bold>B</bold>) Black and white conversion of the original image by GIMP software, i.e. all pixels converted to either black or white in image. 
                            <bold>C</bold>&#x2013;
                            <bold>I</bold>) conversion of the original image to binary matrices of 10&#x00d7;10, 50&#x00d7;50, 75&#x00d7;75, 100&#x00d7;100, 250&#x00d7;250, and 500&#x00d7;500, respectively.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/25662/30590d48-9541-4cb3-9d25-63e700752aa9_figure2.gif"/>
                </fig>
                <p>Several metrics can be performed with the functions presented in 
                    <xref ref-type="table" rid="T1">Table 1</xref>. We implemented functions to calculate parameters designed originally, but not exclusively, for vegetation structures (described by Zehm 
                    <italic toggle="yes">et al.</italic> 2003) and propose a new parameter: the aggregation index. The aggregation index is a standardized estimation of the average proportion of same-color pixels around each image pixel. First, the proportion of same-color neighboring pixels (SCNP) is calculated (marginal lines and columns are excluded). Next, the SCNP for all pixels are averaged; then, given the proportion of black and white pixels, number of pixels in height and width, and location of transparent pixels (when present), the maximum and minimum possible aggregation indexes are calculated. Finally, the observed aggregation is standardized to a scale where the minimum possible value is set at zero and the maximum value is set at one (
                    <xref ref-type="fig" rid="f3">Figure 3</xref>).</p>
                <table-wrap id="T1" orientation="portrait" position="anchor">
                    <label>Table 1. </label>
                    <caption>
                        <title>Main functions of the bwimage package.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="left" colspan="1" rowspan="1" valign="top">Functions</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Description</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="2" rowspan="1" valign="top">
                                    <bold>Image processes</bold>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">threshold_color</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Convert an image into a matrix</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">threshold_image_list</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Convert several images into a list of matrices</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">image_information</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Summary of image information</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">compress</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Map data from square to circular image matrix</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">stretch</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Map data from circular to square image matrix</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="2" rowspan="1" valign="top">
                                    <bold>Image analyses</bold>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">denseness_total</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Proportion of black pixels in relation to all pixels</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">denseness_row</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Proportion of black pixels in rows subsets</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">denseness_column</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Proportion of black pixels in column subsets</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">hole_row</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Description of white pixel continuous sequences in rows</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">hole_columm</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Description of white pixel continuous sequences in columns</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">hole_section_data</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Summary information of holes of a given color in a given section</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">light_gap</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Left and right distances from first black pixel to image edge</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">heigh_maximum</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Higher black pixel in all image</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">altitudinal_profile</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Description of higher black pixel in image sections</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">heigh_propotion</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Height below which a given proportion of vegetation denseness occurs</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">topline</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Line running along the crest of highest black pixel</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">aggregation_index</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Pixel aggregation estimator</td>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>Demonstration of aggregation index calculation.</title>
                        <p>Images represent photos of 6&#x00d7;6 pixel, with 50% black and 50% white pixels. For the aggregation index calculation, first, the proportion of same-color neighboring pixels (SCNP) is calculated (marginal lines and columns are excluded). Then, SCNP are averaged. In these examples, the average SCNP is 0.75 (
                            <bold>A</bold>), 0.5 (
                            <bold>B</bold>), 0 (
                            <bold>C</bold>) and 0.875 (
                            <bold>D</bold>).  Next, the maximum and minimum possible aggregation indexes are calculated. In images with 50% black and white pixels, the minimum aggregation will be pixels distributed in chessboard style (
                            <bold>C</bold>), and the highest aggregation will be the aggregation of all same color pixels on each image side (
                            <bold>D</bold>). Thus, by scaling the aggregation by the minimum and maximum possible aggregation, the final aggregation index is: 0.857 (
                            <bold>A</bold>), 0.571 (
                            <bold>B</bold>), 0 (
                            <bold>C</bold>) and 1 (
                            <bold>D</bold>).</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/25662/30590d48-9541-4cb3-9d25-63e700752aa9_figure3.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Operation</title>
                <p>Bwimage is written in the R programming language
                    <sup>
                        <xref ref-type="bibr" rid="ref-5">5</xref>
                    </sup>, and can be run on Windows, Mac OS X, and Linux systems. The package is available at the CRAN repository, and the development releases are available at Github (see 
                    <italic toggle="yes">Software availability</italic>)
                    <sup>
                        <xref ref-type="bibr" rid="ref-7">7</xref>
                    </sup>. The bwimage CRAN page documents package dependencies. Input images must be in one of the following formats PNG, JPG, or JPEG.</p>
            </sec>
        </sec>
        <sec>
            <title>Use cases</title>
            <p>Canopy openness is one of the most essential ecological parameters for a field ecologist. In the bwimage package, canopy openness can be calculated based on a single picture. To illustrate, we demonstrate below how to analyze a canopy image with the bwimage package. The photo was taken with a digital camera placed in the ground, perpendicular to the ground. Canopy closure can be calculated by estimating the total amount of vegetation in the canopy. Canopy openness is equal to one minus the canopy closure. For this example, we used the original image from 
                <xref ref-type="fig" rid="f1">Figure 1</xref>. The original image file is provided as 
                <italic toggle="yes">Underlying data</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-8">8</xref>
                </sup>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:15px;color:#0000FF;">canopy_matrix&lt;-</styled-content>

                    <styled-content style="font-size:15px;color:#0000FF;">threshold_color("canopy.JPG",compress_method="proportional",compress_rate=0.1)</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">1-denseness_total(canopy_matrix)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">[1] 0.1297333</styled-content>
                </preformat>
            </p>
            <p>Several metrics to describe vertical vegetation complexity can be performed by the bwimage package (see 
                <xref ref-type="table" rid="T1">Table 1</xref>). Here we provide examples based on an image (
                <xref ref-type="fig" rid="f2">Figure 2A</xref>) from a vegetation plot of 30&#x00d7;100cm
                <sup>1</sup>. The original image file is provided as 
                <italic toggle="yes">Underlying data</italic>
                <sup>
                    <xref ref-type="bibr" rid="ref-9">9</xref>
                </sup>. On the 100cm side of this plot we placed a panel of 100&#x00d7;100 cm, covered with white cloth, and perpendicular to the ground. A plastic canvas of 50x100cm was used to cover the vegetation along a narrow strip in front of a camera positioned on a tripod at a height of 55 cm. A photograph of the portion of standing vegetation against the white cloth was taken.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:15px;color:#0000FF;">vegetation_matrix&lt;-threshold_color(bush)</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">denseness_total(vegetation_matrix,height_size = 100, width_size = 100)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">[1] 0.115248</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">topline(vegetation_matrix)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">topline</styled-content> 
  
                    <styled-content style="font-size:15px;color:#000000;">785.6</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">heigh_propotion_test(vegetation_matrix,proportion=0.75,height_size=100)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">Height below which 0.75 of the vegetation denseness is located</styled-content>
                                                                                
                    <styled-content style="font-size:15px;color:#000000;">31.2</styled-content> 

 
                    <styled-content style="font-size:15px;color:#0000FF;">aggregation_index(vegetation_matrix)</styled-content>
       
                    <styled-content style="font-size:15px;color:#000000;">adjusted_aggregation non_adjusted_aggregation</styled-content>
                    
                    <styled-content style="font-size:15px;color:#000000;">0.8512586                0.9634373</styled-content>
                </preformat>
            </p>
            <p>Variation in eggs and nest morphology provide relevant information concerning bird life history that has frequently been used to answer ecological
                <sup>
                    <xref ref-type="bibr" rid="ref-10">10</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-12">12</xref>
                </sup> and evolutionary questions
                <sup>
                    <xref ref-type="bibr" rid="ref-13">13</xref>&#x2013;
                    <xref ref-type="bibr" rid="ref-15">15</xref>
                </sup>. Here we analyze examples that address the quantification nest wall openness and the aggregation of nest wall holes, using a nest of the blue-black grasssquit (
                <italic toggle="yes">Volatinia jacarina</italic>) deposited in the museum collection Cole&#x00e7;&#x00e3;o Ornitol&#x00f3;gica Marcelo Bagno, at Universidade de Bras&#x00ed;lia (register number COMB-N682). 
                <xref ref-type="fig" rid="f4">Figure 4</xref> describes how to produce a high-quality image to describe patterns in bird nest wall openness. The original image file used is provided as Underlying data
                <sup>
                    <xref ref-type="bibr" rid="ref-16">16</xref>
                </sup>.</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:15px;color:#0000FF;">NestWall_matrix&lt;-threshold_color("NestWall.png",</styled-content> 

                    <styled-content style="font-size:15px;color:#0000FF;">filetype="png",compress_method="width_fixed",target_width=300)</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">denseness_total(NestWall_matrix)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">[1] 0.7612406</styled-content>


                    <styled-content style="font-size:15px;color:#0000FF;">aggregation_index(NestWall_matrix)</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">adjusted_aggregation non_adjusted_aggregation</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">0.9007821                0.9502800</styled-content>
                </preformat>
            </p>
            <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                <label>Figure 4. </label>
                <caption>
                    <title>Description of how to produce an image to evaluate patterns in bird nest wall openness.</title>
                    <p>The following example used a blue-black grasssquit (
                        <italic toggle="yes">Volatinia jacarina</italic>) nest deposited in the museum collection Cole&#x00e7;&#x00e3;o Ornitol&#x00f3;gica Marcelo Bagno, at Universidade de Bras&#x00ed;lia (catalog number COMB-N682). 
                        <bold>A</bold>)  A photo of the nest was taken with a white styrofoam ball (50mm in diameter) placed inside the nest chamber. 
                        <bold>B</bold>) In GIMP software (version 2.10.10), we added alpha channel (to allow transparent pixels), and used the Ellipse select tool to select contrast of the white ball and nest wall, and then erased all background elements. 
                        <bold>C</bold>) To ensure that shadows from nest wall did not influence white ball detection, we also performed the threshold processing in GIMP. To preserve the transparent pixels from background elements, the final image must be saved as a PNG file.</p>
                </caption>
                <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/25662/30590d48-9541-4cb3-9d25-63e700752aa9_figure4.gif"/>
            </fig>
        </sec>
        <sec sec-type="conclusions">
            <title>Conclusions</title>
            <p>The bwimage package provides accessible and simple methods for ecologists and field researchers to describe patterns from black and white digital images. It is a flexible method that allows the application of image analyses to an exceptionally broad range of research subjects.  Bwimage&#x00b4;s analysis is based on a simple computational routine based on the transformation of a picture (&#x201c;jpeg&#x201d; or &#x201c;png&#x201d; files) into a binary matrix, followed by the analysis itself. Several metrics can be calculated by the bwimage package. We implemented functions previously described in the literature, and additionally, we proposed a new parameter: the aggregation index, which generates a standardized estimate of the average proportion of same-color pixels around each image pixel. The application of this methods is exceptionally broad.</p>
        </sec>
        <sec>
            <title>Data availability</title>
            <sec>
                <title>Underlying data</title>
                <p>Figshare: Canopy of Royal poinciana. 
                    <ext-link ext-link-type="uri" xlink:href="https://dx.doi.org/10.6084/m9.figshare.8429117.v2">https://doi.org/10.6084/m9.figshare.8429117.v2</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-8">8</xref>
                    </sup>
</p>
                <p>Figshare: Image from a vegetation plot of 30x100cm. 
                    <ext-link ext-link-type="uri" xlink:href="https://dx.doi.org/10.6084/m9.figshare.8429882.v2">https://doi.org/10.6084/m9.figshare.8429882.v2</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-9">9</xref>
                    </sup>
</p>
                <p>Figshare: Blue-black grassquit (Volatinia jacarina) nest. 
                    <ext-link ext-link-type="uri" xlink:href="https://dx.doi.org/10.6084/m9.figshare.8432018.v1">https://doi.org/10.6084/m9.figshare.8432018.v1</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-16">16</xref>
                    </sup>
</p>
                <p>Data are available under the terms of the 
                    <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/publicdomain/zero/1.0/">Creative Commons Zero "No rights reserved" data waiver</ext-link> (CC0 1.0 Public domain dedication).</p>
            </sec>
        </sec>
        <sec>
            <title>Software availability</title>
            <list list-type="bullet">
                <list-item>
                    <label>-</label>
                    <p>Software available from: 
                        <ext-link ext-link-type="uri" xlink:href="https://cran.r-project.org/package=bwimage">https://CRAN.R-project.org/package=bwimage</ext-link>
                    </p>
                </list-item>
                <list-item>
                    <label>-</label>
                    <p>Source code available from: 
                        <ext-link ext-link-type="uri" xlink:href="https://github.com/biagolini/bwimage">https://github.com/biagolini/bwimage</ext-link>
                    </p>
                </list-item>
                <list-item>
                    <label>-</label>
                    <p>Archived source code at time of publication: 
                        <ext-link ext-link-type="uri" xlink:href="https://dx.doi.org/10.5281/zenodo.3266299">https://doi.org/10.5281/zenodo.3266299</ext-link>
                        <sup>
                            <xref ref-type="bibr" rid="ref-7">7</xref>
                        </sup>
                    </p>
                </list-item>
                <list-item>
                    <label>-</label>
                    <p>License: GPL-3</p>
                </list-item>
            </list>
        </sec>
    </body>
    <back>
        <ack>
            <title>Acknowledgments</title>
            <p>We are grateful to Universidade de Bras&#x00ed;lia for logistic support and Marcelo Ant&#x00f4;nio de Assis Silva for technical advice on how to obtain a high-quality image of the bird nest used in the manuscript. We also acknowledge Dr. Francesco Chianucci and Dr. Roy Francis for comments in a previous version of the manuscript.</p>
        </ack>
        <ref-list>
            <ref id="ref-1">
                <label>1</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Zehm</surname>
                            <given-names>A</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Nobis</surname>
                            <given-names>M</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Schwabe</surname>
                            <given-names>A</given-names>
                        </name>
			</person-group>:
                    <article-title>Multiparameter analysis of vertical vegetation structure based on digital image processing.</article-title>
                    <source>
				
                        <italic toggle="yes">Flora.</italic>
			</source>
                    <year>2003</year>;<volume>198</volume>(<issue>2</issue>):<fpage>142</fpage>&#x2013;<lpage>60</lpage>.
                    <pub-id pub-id-type="doi">10.1078/0367-2530-00086</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-2">
                <label>2</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Nobis</surname>
                            <given-names>M</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Hunziker</surname>
                            <given-names>U</given-names>
                        </name>
			</person-group>:
                    <article-title>Automatic thresholding for hemispherical canopy-photographs based on edge detection.</article-title>
                    <source>
				
                        <italic toggle="yes">Agr Forest Meteorol.</italic>
			</source>
                    <year>2005</year>;<volume>128</volume>(<issue>3&#x2013;4</issue>):<fpage>243</fpage>&#x2013;<lpage>50</lpage>.
                    <pub-id pub-id-type="doi">10.1016/j.agrformet.2004.10.002</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-3">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Del Hoyo</surname>
                            <given-names>J</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Elliott</surname>
                            <given-names>A</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Sargatal</surname>
                            <given-names>J</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>Handbook of the Birds of the World Alive</article-title>. Barcelona: Lynx Edicions;<year>2018</year>.</mixed-citation>
            </ref>
            <ref id="ref-4">
                <label>4</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Xiao</surname>
                            <given-names>H</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Hu</surname>
                            <given-names>Y</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Lang</surname>
                            <given-names>Z</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>How much do we know about the breeding biology of bird species in the world?</article-title>
                    <source>
				
                        <italic toggle="yes">J Avian Biol.</italic>
			</source>
                    <year>2016</year>;<volume>48</volume>(<issue>4</issue>):<fpage>513</fpage>&#x2013;<lpage>8</lpage>.
                    <pub-id pub-id-type="doi">10.5061/dryad.m7ph3</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-5">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <collab>R Core Team</collab>:
                    <article-title>R: a language and environment for statistical computing</article-title>.<year>2019</year>.</mixed-citation>
            </ref>
            <ref id="ref-6">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Kimball </surname>
                            <given-names>S</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Mattis </surname>
                            <given-names>P</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Natterer </surname>
                            <given-names>M</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>GIMP Image Manipulation Program</article-title>.<year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.gimp.org/">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-7">
                <label>7</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Biagolini-Jr</surname>
                            <given-names>C</given-names>
                        </name>
			</person-group>:
                    <article-title>biagolini/bwimage: Describe Image Patterns in Natural Structures (Version 1.01).</article-title>
                    <source>
				
                        <italic toggle="yes">Zenodo.</italic>
			</source>
                    <year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.5281/zenodo.3266299">http://www.doi.org/10.5281/zenodo.3266299</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-8">
                <label>8</label>
                <mixed-citation publication-type="data">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Biagolini-Jr</surname>
                            <given-names>C</given-names>
                        </name>
			</person-group>:
                    <article-title>Canopy of Royal poinciana</article-title>.<year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.6084/m9.figshare.8429117.v2">http://www.doi.org/10.6084/m9.figshare.8429117.v2</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-9">
                <label>9</label>
                <mixed-citation publication-type="data">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Biagolini-Jr</surname>
                            <given-names>C</given-names>
                        </name>
			</person-group>:
                    <article-title>Image from a vegetation plot of 30x100cm</article-title>.<year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.6084/m9.figshare.8429882.v2">http://www.doi.org/10.6084/m9.figshare.8429882.v2</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-10">
                <label>10</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Pol&#x00e1;&#x010d;ek</surname>
                            <given-names>M</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Bart&#x00ed;kov&#x00e1;</surname>
                            <given-names>M</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Hoi</surname>
                            <given-names>H</given-names>
                        </name>
			</person-group>:
                    <article-title>Intraclutch eggshell colour variation in birds: are females able to identify their eggs individually?</article-title>
                    <source>
				
                        <italic toggle="yes">PeerJ.</italic>
			</source>
                    <year>2017</year>;<volume>5</volume>:<fpage>e3707</fpage>.
                    <pub-id pub-id-type="pmid">28875071</pub-id>
                    <pub-id pub-id-type="doi">10.7717/peerj.3707</pub-id>
                    <pub-id pub-id-type="pmcid">5581944</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-11">
                <label>11</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>G&#x00f3;mez</surname>
                            <given-names>J</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Ramo</surname>
                            <given-names>C</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Troscianko</surname>
                            <given-names>J</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>Individual egg camouflage is influenced by microhabitat selection and use of nest materials in ground-nesting birds.</article-title>
                    <source>
				
                        <italic toggle="yes">Behav Ecol Sociobiol.</italic>
			</source>
                    <year>2018</year>;<volume>72</volume>(<issue>9</issue>):<fpage>142</fpage>.
                    <pub-id pub-id-type="doi">10.1007/s00265-018-2558-7</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-12">
                <label>12</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Wang</surname>
                            <given-names>L</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Cheng</surname>
                            <given-names>SJ</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Hsu</surname>
                            <given-names>YC</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>Nest-dismantling behavior of yellow-bellied prinia in mainland and island populations.</article-title>
                    <source>
				
                        <italic toggle="yes">Acta Ethol.</italic>
			</source>
                    <year>2018</year>;<volume>21</volume>(<issue>1</issue>):<fpage>35</fpage>&#x2013;<lpage>41</lpage>.
                    <pub-id pub-id-type="doi">10.1007/s10211-017-0281-4</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-13">
                <label>13</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Leighton</surname>
                            <given-names>GM</given-names>
                        </name>
			</person-group>:
                    <article-title>Evolutionary mechanisms maintaining nest construction in avian clades.</article-title>
                    <source>
				
                        <italic toggle="yes">Avian Biol Res.</italic>
			</source>
                    <year>2016</year>;<volume>9</volume>(<issue>1</issue>):<fpage>44</fpage>&#x2013;<lpage>51</lpage>.
                    <pub-id pub-id-type="doi">10.3184/175815516X14500793412915</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-14">
                <label>14</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Deeming</surname>
                            <given-names>DC</given-names>
                        </name>
			</person-group>:
                    <article-title>How does the bird-nest incubation unit work?</article-title>
                    <source>
				
                        <italic toggle="yes">Avian Biol Res.</italic>
			</source>
                    <year>2016</year>;<volume>9</volume>(<issue>2</issue>):<fpage>103</fpage>&#x2013;<lpage>13</lpage>.
                    <pub-id pub-id-type="doi">10.3184/175815516X14567543242701</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-15">
                <label>15</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Stoddard</surname>
                            <given-names>MC</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Yong</surname>
                            <given-names>EH</given-names>
                        </name>
				
                        <name name-style="western">
                            <surname>Akkaynak</surname>
                            <given-names>D</given-names>
                        </name>
				
                        <etal/>
			</person-group>:
                    <article-title>Avian egg shape: Form, function, and evolution.</article-title>
                    <source>
				
                        <italic toggle="yes">Science.</italic>
			</source>
                    <year>2017</year>;<volume>356</volume>(<issue>6344</issue>):<fpage>1249</fpage>&#x2013;<lpage>54</lpage>.
                    <pub-id pub-id-type="pmid">28642430</pub-id>
                    <pub-id pub-id-type="doi">10.1126/science.aaj1945</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-16">
                <label>16</label>
                <mixed-citation publication-type="data">
                    <person-group person-group-type="author">
				
                        <name name-style="western">
                            <surname>Biagolini-Jr</surname>
                            <given-names>C</given-names>
                        </name>
			</person-group>:
                    <article-title>Blue-black grassquit (Volatinia jacarina) nest</article-title>.<year>2019</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.6084/m9.figshare.8432018.v1">http://www.doi.org/10.6084/m9.figshare.8432018.v1</ext-link>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report59116">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.23161.r59116</article-id>
            <title-group>
                <article-title>Reviewer response for version 2</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Francis</surname>
                        <given-names>Roy</given-names>
                    </name>
                    <xref ref-type="aff" rid="r59116a1">1</xref>
                    <xref ref-type="aff" rid="r59116a2">2</xref>
                    <role>Referee</role>
                </contrib>
                <aff id="r59116a1">
                    <label>1</label>Department of Medical Biochemistry and Microbiology, Uppsala University, Uppsala, Sweden</aff>
                <aff id="r59116a2">
                    <label>2</label>National Bioinformatics Infrastructure Sweden, Uppsala, Sweden</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>13</day>
                <month>2</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Francis R</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport59116" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.19801.2"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>
                <list list-type="bullet">
                    <list-item>
                        <p>Describing image patterns in natural structure is not my area, therefore my comments are quite general.</p>
                    </list-item>
                    <list-item>
                        <p>I have tried running the tool on two different OS and tried out most of the functions using several images. Generally, the tool and functions work as described. The documentation is reasonably well written and easy to follow.</p>
                    </list-item>
                    <list-item>
                        <p>R is quite lacking in image analysis, therefore this package could be a useful little addition.</p>
                    </list-item>
                    <list-item>
                        <p>For effectively following the workflow described here, optimal thresholding is the key. The thresholding offered with the package is too basic and the user has to rely on external tools.</p>
                    </list-item>
                    <list-item>
                        <p>To compare the resulting metrics, two images need to be exactly comparable. The zoom/crop/scaling of the image, the lighting conditions, shadow etc would most likely render the results incomparable. This is something to be handled by external tools as well.</p>
                    </list-item>
                    <list-item>
                        <p>My opinion is that image recognition and classification has to be implemented as some sort of machine learning algorithm rather than any manual thresholding for practical real world application. See relevant example
                            <sup>
                                <xref ref-type="bibr" rid="rep-ref-59116-1">1</xref>
                            </sup>.</p>
                    </list-item>
                    <list-item>
                        <p>No implementation to work with large images (Sparse matrices etc). Only available option is to scale down the image and work with a smaller image. Issues with small image size is briefly discussed in the manuscript.</p>
                    </list-item>
                    <list-item>
                        <p>Summary functions would be nice. Some simple functions to visualise the results would be nice. For example just to preview the thresholded image, I used image(t(apply(img_thres,2,rev))).</p>
                    </list-item>
                    <list-item>
                        <p>Benchmarking: It's hard to say how good the results are. It would've been nice to see a comparison of this tool to other existing tools in terms of efficiency as well as accuracy. For example; How does SCNP compare to other measures of aggregation (used in this field)? It would be nice to see some sort of use case on real world dataset rather than a few isolated images.</p>
                    </list-item>
                    <list-item>
                        <p>A detailed HTML vignette showcasing all the functionality and typical use case workflows. The r-bloggers tutorial was a good start but I wouldn't consider that as a stable location. Perhaps on github along with the source?</p>
                    </list-item>
                    <list-item>
                        <p>Possible typos in function names: heigh_maximum, heigh_propotion, heigh_propotion_test, hole_columm. At least, it's consistent with Table 1 in the manuscript.</p>
                    </list-item>
                    <list-item>
                        <p>In figure 2, dimension of sub plot I is missing in the caption.</p>
                    </list-item>
                    <list-item>
                        <p>Figure 3 caption typo: Imagens.</p>
                    </list-item>
                    <list-item>
                        <p>Typo Page 8, last line of acknowledgements. acknowledg.</p>
                    </list-item>
                </list>
            </p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>Molecular Biology, Bioinformatics</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-59116-1">
                    <label>1</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>Automatic detection of woody vegetation in repeat landscape photographs using a convolutional neural network</article-title>.
                        <source>
                            <italic>Ecological Informatics</italic>
                        </source>.<year>2019</year>;<volume>50</volume>:
                        <elocation-id>10.1016/j.ecoinf.2019.01.012</elocation-id>
                        <fpage>220</fpage>-<lpage>233</lpage>
                        <pub-id pub-id-type="doi">10.1016/j.ecoinf.2019.01.012</pub-id>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report55892">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.23161.r55892</article-id>
            <title-group>
                <article-title>Reviewer response for version 2</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Chianucci</surname>
                        <given-names>Francesco</given-names>
                    </name>
                    <xref ref-type="aff" rid="r55892a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-5688-2060</uri>
                </contrib>
                <aff id="r55892a1">
                    <label>1</label>The Council for Agricultural Research and Economics (CREA) - Research Centre for Forestry and Wood, Arezzo, Italy</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>12</day>
                <month>11</month>
                <year>2019</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2019 Chianucci F</copyright-statement>
                <copyright-year>2019</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport55892" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.19801.2"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>I think the author(s) has made the required correction and therefore I suggest the revised article is ready for indexing.</p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Partly</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Partly</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>Forestry</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report51562">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.21722.r51562</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Chianucci</surname>
                        <given-names>Francesco</given-names>
                    </name>
                    <xref ref-type="aff" rid="r51562a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-5688-2060</uri>
                </contrib>
                <aff id="r51562a1">
                    <label>1</label>The Council for Agricultural Research and Economics (CREA) - Research Centre for Forestry and Wood, Arezzo, Italy</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>13</day>
                <month>8</month>
                <year>2019</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2019 Chianucci F</copyright-statement>
                <copyright-year>2019</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport51562" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.19801.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve-with-reservations</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The topic is interesting. However, I think the package makes simple things which many other similar packages do, and omit some intermediate steps required to refine the analysis.</p>
            <p> </p>
            <p> First, the authors should provide a list of thresholding (either single or dual) methods to binarize images. The single Otsu, the minimum algorithm, the two-corner method are some of the algorithm which should be developed. The package could also use some dependancies from other packages to implement these thresholding. For instance, the rtiff package contains the function autoThreshold which implement the Ridler-Calvard thresholding. I also suggest take a look at the caiman package which contains tool for canopy image analysis, see also below.</p>
            <p> </p>
            <p> Second, users can also process single channel image or decide to use a single channel (for example, the blue channel is frequently used for canopy images). So the user should have flexibility on choosing the image feature to process (setting the channel, setting the threshold).</p>
            <p> </p>
            <p> Canopy images are usually fish eye images, and therefore they require correction for lens projection. In addition, canopy openness should be weighted for zenith angle in fish eye image. Similarly, gap fraction is required for zenith ring. Thus, the packages should allow to work with fish eye (circular image), namely correct for lens distortion, setting the circular inner mask, extract information for zenith angle ranges (inner rings). I suggest to take a look in the caiman package to inherit its functions.</p>
            <p> </p>
            <p> An interesting attribute from the packages is the identification of row or column gaps (holes), namely continuous sequences of white pixels. In my view, a very interesting output would be the identification and the labelling of all holes in the image, along with their summary statistics (e.g. number of holes, size of each hole in number of pixels, average, sd and so on). I think the package will improve strongly if authors can implement such function. This would allow the extraction of canopy attributes from images
                <sup>
                    <xref ref-type="bibr" rid="rep-ref-51562-1">1</xref>
                </sup>.</p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Partly</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Partly</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>Forestry</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-51562-1">
                    <label>1</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>An objective image analysis method for estimation of canopy attributes from digital cover photography</article-title>.
                        <source>
                            <italic>Trees</italic>
                        </source>.<year>2018</year>;<volume>32</volume>(<issue>3</issue>) :
                        <elocation-id>10.1007/s00468-018-1666-3</elocation-id>
                        <fpage>713</fpage>-<lpage>723</lpage>
                        <pub-id pub-id-type="doi">10.1007/s00468-018-1666-3</pub-id>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
        <sub-article article-type="response" id="comment4976-51562">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Biagolini-Jr.</surname>
                            <given-names>Carlos</given-names>
                        </name>
                        <aff/>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>16</day>
                    <month>10</month>
                    <year>2019</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Dear Dr. Francesco Chianucci,</p>
                <p>We appreciate all of your helpful comments, and we are certain that they have improved significantly the original version of the Package. In the new version (1.2) of bwimage package published in CRAN we: i) introduced two new functions (stretch and compress functions) to provide an additional tool to distort images. These functions are applications of algorithms for mapping images from circle to square, and vice versa, adapted from Lambers (2016 
                    <italic>J of Computer Graphics Techniques</italic>); and ii) included the possibility of users processing single channel images.</p>
                <p>We considered incorporating other packages for threshold in bwimage dependencies; however, we decided to avoid a cross-dependency of packages because it implies in a heavy load package, and brings possible compatibility issues with R updates. &#x00a0;Thus, we chose to create a tutorial (shared on 
                    <ext-link ext-link-type="uri" xlink:href="https://www.r-bloggers.com/using-bwimge-r-package-to-describe-patterns-in-images-of-natural-structures/">https://www.r-bloggers.com/using-bwimge-r-package-to-describe-patterns-in-images-of-natural-structures/</ext-link>) to provide an overview of bwimage package and demonstrate examples of how to apply threshold algorithms from the package autothresholdr, following its application in bwimage package. A comparison of estimation of vegetation density from a bush image submitted to different thresholding algorithms is provided. Note: the current version of autothresholdr package (1.3.5) provide 17 threshold algorithms by function auto_thresh, covering a wide range of applications.</p>
                <p>We do not mention in the previous version of this article, but bwimage version 1.0 already had a function (hole_section_data) to summarize holes statistics (i.e. number of holes, mean hole size, sd, minimum and maximum size).&#x00a0; This function was designed to be used inside a loop or apply-family functions. By combination of hole_section_data and loop function, users can potentially collect a summary of holes statistics. The size of each section is obtained by the hole_section function, which returns size and map of each hole. We add information about this function in manuscript table 1. We also provide an example of how to apply hole_section_data for a set of 12 images in the above-mentioned tutorial.</p>
                <p>With my best regards.</p>
                <p>Sincerely,</p>
                <p>Carlos Biagolini-Jr</p>
            </body>
        </sub-article>
    </sub-article>
</article>
