treetop: A Shiny‐based application and R package for extracting forest information from LiDAR data for ecologists and conservationists

Individual tree detection (ITD) and crown delineation are two of the most relevant methods for extracting detailed and reliable forest information from LiDAR (Light Detection and Ranging) datasets. However, advanced computational skills and specialized knowledge have been normally required to extract forest information from LiDAR. The development of accessible tools for 3D forest characterization can facilitate rapid assessment by stakeholders lacking a remote sensing background, thus fostering the practical use of LiDAR datasets in forest ecology and conservation. This paper introduces the treetop application, an open‐source web‐based and R package LiDAR analysis tool for extracting forest structural information at the tree level, including cutting‐edge analyses of properties related to forest ecology and management. We provide case studies of how treetop can be used for different ecological applications, within various forest ecosystems. Specifically, treetop was employed to assess post‐hurricane disturbance in natural temperate forests, forest homogeneity in industrial forest plantations and the spatial distribution of individual trees in a tropical forest. treetop simplifies the extraction of relevant forest information for forest ecologists and conservationists who may use the tool to easily visualize tree positions and sizes, conduct complex analyses and download results including individual tree lists and figures summarizing forest structural properties. Through this open‐source approach, treetop can foster the practical use of LiDAR data among forest conservation and management stakeholders and help ecological researchers to further understand the relationships between forest structure and function.


| t r e e t o p : AN OPEN -SOURCE TOOL
An enhanced understanding of forest structure and ecology using airborne LiDAR (Light Detection and Ranging) can be gained through improved data analysis tools and optimized data processing frameworks that simplify working with LiDAR data. The aim of this paper is

| Background and model foundation
The use of LiDAR for ITD and crown delineation is promising; however, it requires specific training in computational methods for practitioners to derive reliable forest information from LiDAR datasets . A LiDAR-derived CHM can be used to detect individual trees, delineate their crowns and subsequently estimate biophysical attributes such as biomass, stem volume and gap fraction (Silva et al., 2016;Stark et al., 2012). The CHM is defined as the spatially explicit height of the tallest vegetation and is essentially computed by subtracting the digital terrain model (DTM) from the digital surface model (DSM) representing the scanned vegetation ( Figure 1). The simplest method to detect individual trees on the LiDAR-derived CHM is by using the local maximum (LM) algorithm.
LM methods assume that local height maxima in the CHM represent tree tops (Korpela et al., 2006), and the method is a relatively straightforward technique that utilizes two major parameters: a smoothing parameter, which is also often mentioned as smoothing window size (SWS), and a fixed window size (FWS) for tree detection (Silva et al., 2016). As FWS increases, the number of trees detected decreases . Application of smoothing filters helps eliminate spurious local maxima caused by, say, large spreading tree branches, and thereby limits the number of local maxima detected, increasing the accuracy of the algorithm (Lindberg & Hollaus, 2012).
Once, individual trees are detected, their crown boundaries can be delimited using the Voronoi tessellation-based algorithm developed by Silva et al. (2016) (Figure 2). The algorithm uses maximum crown factor and exclusion parameters, both ranging from 0 to 1, to define the crown boundaries on the LiDAR-CHM (Silva et al., 2016).
treetop is both an interactive online tool as well as a standalone R package (Silva et al., 2021) that puts complex ITD and crown delineation procedures easily within reach of any non-specialized user, allowing the visualization of forest information promptly and the ability to download generated results in a variety of file formats. We used the LM, SWS and FWS algorithms for ITD ( Figure 2) along with three CHM filter options and a Voronoi tessellationbased algorithm for crown delineation. This algorithm and ITD accuracy have been already validated in Silva et al. (2016) and Leite et al. (2020). Optionally, the user can estimate tree crown width using a list of equations available in the application (Popescu et al., 2014) or even by a user-defined custom equation.

| System design and features
The requested data input for ITD through the treetop application is a LiDAR-derived CHM in raster format, and thus CHM-derived from other remote sensing sources can also be used. The R package version of treetop does not have any data size limitations, thus allowing users to process larger CHM rasters. The treetop tool is capable of providing crown change estimates from multitemporal data as

| t r e e t o p APPLI C ATI ON S AND C A S E S TUD IE S
treetop's main functionality is to detect and delineate individual tree crowns using CHMs derived from LiDAR or other remote sensing sources, and to generate forest structure information relevant to forest ecologists and conservationists, not requiring any specialized Panel a) Input CHM file Allows the user to import their own CHM (as raster file in.tif, .asc or .img format) with grid cell size higher than 0.5 m. An example CHM is also provided. When uploaded CHM with grid cell <0.5 m, the tool resamples the CHM from its original spatial resolution to 0.5 m using the nearest neighbour approach Allows the user to set parameters for delineating individual tree crowns.
• Allows the users to delineate automatically individual tree crowns using the Voronoi tessellation-based algorithm (Silva et al., 2016). The user can set the parameters: Maxcrown defines the maximum crown diameter of a tree as a proportion of its height; Exclusion is the proportion of tree height under which pixels are excluded from the crown. • Allows the users to select the allometry to estimate crown width based on tree height.
Users can either specify their custom allometric equation, or select one of three allometric equations provided, respectively calibrated for deciduous, pine and mixed forests

CHM 3d/Trees 3d
Option to switch interactive 3D information displayed in panel (e) between: (1) CHM; or (2) detected trees. Selecting Trees 3d creates a visual reconstruction of trees using a solid, mesh or line surfaces and with their crowns being optional Cones (e.g. conifer), Ellipsoids (e.g. broadleaved), halfellipsoid, paraboloid or cylinder 3D shapes (see Table S1)

Run
Start the data processing this forest. We made a quick assessment of damage and disturbance on sites impacted by Hurricane Michael using LiDAR data and the treetop tool. Specifically, we used LiDAR data that were collected immediately prior to Hurricane Michael from an aircraft-borne LiDAR system. A UAV-LiDAR system (GatorEye system, see Supporting Information) collected data at the same site 2 months after the hurricane which was 6 months after the initial airborne flight. CHMs (0.5 m resolution) were computed using LAStools (Isenburg, 2018) and, for the purposes of this case study, we selected a 50 × 50 m sample plot in which individual trees were detected and delineated on the CHMs using FWS = 3 × 3 and SWS = 3 × 3, and MaxCrown and Exclusion parameters were set to 0.6 and 0.3 respectively ( Figures S1 and S2).
Hurricane impacts were visually apparent between the collection dates in our sample site. The 32 trees initially detected were reduced to 24 trees following the hurricane. We found 38.5% reduction in canopy coverage with large increases in gaps and crown reductions in some remaining standing trees ( Figure 4). No decrease in maximum tree height was detected within the plot; however, mean tree height decreased from 26.8 to 23 m, indicating that mortality of the canopy trees possibly occurred. Height distributions ( Figure 5) can be used to calculate vertical leaf area density provided sufficient calibration data (Stark et al., 2012). Even without calibration, the assessment of these vertical profiles reveals a large increase in LiDAR echoes below 8 ms above the ground which is consistent with an increase in downed woody debris following the hurricane. However, for this small sample plot, a twosample Kolmogorov-Smirnov (KS) test (Wayne, 1990) showed that the tree height distribution pre-and post-hurricane disturbance ( Figure 5) did not significantly differ (KS = 0.23, p-value = 0.47 and α = 0.05).

| Assessment of structural heterogeneity in forest plantations
The treetop tool was used to access forest structural heterogeneity in a 3-year-old fast-growing Eucalyptus grandis forest plantation (e.g. Silva et al., 2014) and in an 8-year-old seminal (seed) plantation of Pinus taeda ( Figure 6) in southern Brazil (Klabin SA company, Paraná State, Brazil; Silva et al., 2017). LiDAR data were collected with pulse density of 4 pulses/m 2 and CHM (0.5 m of resolution) was created using LAStools (Isenburg, 2018). Individual trees were detected and delineated in both plantation sites using treetop tool in a plot area of 0.25 ha (50 × 50 m 2 ). ITD and crown delineation were performed using FWS = 3 × 3 and SWS = 3 × 3, and MaxCrown and Exclusion parameters were set to 0.6 and 0.3 respectively ( Figures S3 and S4).
The structural heterogeneity of forests is typically assessed by a measurement of variability and a measurement of asymmetry (Knox et al., 1989;Valbuena et al., 2017). In our treetop tool, we chose to evaluate variability and asymmetry in the height of detected trees, because height above the ground is the variable directly measured by the LiDAR. Except for MacArthur and MacArthur's (1961) foliage height diversity (FHD), structural indices are more typically based on tree bole diameters because in the field they are more directly measurable than heights. One such measure of heterogeneity based on tree heights is the PH 3 50 index (Hentz et al., 2018). To clarify the role of PH 3 50 in evaluating forest heterogeneity, we computed Lorenz curves from the cubic power of tree heights, which has been observed to relate to Lorenz curves obtained from tree diameters (Hakamada et al., 2015). Lorenz plots for the two forest areas-(a) the E. grandis and (b) P. taeda plantations (Figure 7)-both showed a high degree of homogeneity in their structure, which can be observed by the low amplitude of their Lorenz curves, close to the diagonal (absolute equality). The Gini coefficient obtained from both of stands, GC = 0.17 and 0.11, respectively, are reflective of the Lorenz curve results (Weiner & Thomas, 1986). The upper part of the shaded area in Figure 7 shows

| Spatial patterns of individual trees in tropical forest
In our third case study, the treetop tool was used for ITD and crown Ripley's K and L functions (Besag, 1977;Ripley, 1976) and the Clark-Evans index (Clark & Evans, 1954) were used to examine spatial patterns followed by the detected trees in the 2.25-ha plot in the Adolfo Ducke Forest Reserve. Ripley's function calculates distances (r) between individual pairs of trees and compares them to what would be expected from a purely random (Poisson) point process.
The empirical K function observed from spatial distribution of trees (Kobs (r); black solid lines in Figure 9) is compared against the theoretical K function (Ktheo (r) = πr 2 ; red dashed line in Figure 9). The grey-shaded areas in Figure 9 are confidence intervals for the ran-

F I G U R E 5
Pre-and post-hurricane canopy metrics from LiDAR on a selected area of the USFS Panhandle Apalachicola National Forest. (a1, a2) Canopy height density profile, (b1, b2) tree height density distribution and (c1, c2) crown area density distribution

| FINAL CONS IDER ATIONS
We have provided an overview of the design and usage of treetop, the first web-based application and R package for ecologists and conservationist to automatically extract and analyse forest information from LiDAR-CHM data. The tool provides five panels which were described in detail, and functionality exemplified with three case studies using LiDAR datasets collected from disparate forest ecosystems, illustrating the ecological meaning of the analyses included in the application. The paper presents case studies focused on mostly forested areas; however, the tool can be applied in non-forested (e.g. urban) areas as well. We hope this web-based F I G U R E 6 (a1) Plot (50 × 50 m 2 ) of forest clone plantation of Eucalyptus grandis (3 years old); and (a2) plot (50 × 50 m 2 ) of seminal plantation of Pinus taeda (8 years old). The CHM is 0.5 m spatial resolution; (b1) and (b2) represent the 3D trees while (c1) and (c2) show the distribution of tree height within the Eucalyptus grandis and Pinus taeda sample plot application will assist non-specialized practitioners of ecology and conservation world-wide towards better understanding the relationships between forest structure and function in different ecosystems.
treetop is open-source software and the source code as well as the datasets used in this study are available on the treetop GitHub repository (https://github.com/carlo s-alber to-silva/ webli dar-treetop).
F I G U R E 7 Lorenz curve plots of cubic powers of detected tree heights for (a) the forest clone plantation of Eucalyptus grandis; and (b) the seminal plantation of Pinus taeda. Lorenz curves are plotted according to Valbuena et al. (2012Valbuena et al. ( , 2013, and the red arrow shows how the value of the inverse of PH 3 50 can be read from them