1.3.64
 
Loading...
Searching...
No Matches
LiDARcloud Class Reference

Primary class for terrestrial LiDAR scan. More...

#include <LiDAR.h>

Public Member Functions

 LiDARcloud ()
 LiDAR point cloud constructor.
 
 ~LiDARcloud ()
 LiDAR point cloud destructor.
 
void validateRayDirections ()
 
void disableMessages ()
 Disable all print messages to the screen except for fatal error messages.
 
void enableMessages ()
 Enable all print messages to the screen.
 
void initializeCollisionDetection (helios::Context *context)
 Initialize collision detection plugin for unified ray-tracing (called automatically when needed)
 
void performUnifiedRayTracing (helios::Context *context, size_t N, int Npulse, helios::vec3 *ray_origins, helios::vec3 *direction, float *hit_t, float *hit_fnorm, int *hit_ID)
 Perform unified ray-tracing using collision detection plugin (replaces CUDA kernels)
 
uint getScanCount ()
 Get number of scans in point cloud.
 
uint addScan (ScanMetadata &newscan)
 Add a LiDAR scan to the point cloud.
 
void addHitPoint (uint scanID, const helios::vec3 &xyz, const helios::SphericalCoord &direction)
 Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.
 
void addHitPoint (uint scanID, const helios::vec3 &xyz, const helios::SphericalCoord &direction, const helios::RGBcolor &color)
 Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.
 
void addHitPoint (uint scanID, const helios::vec3 &xyz, const helios::SphericalCoord &direction, const std::map< std::string, double > &data)
 Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.
 
void addHitPoint (uint scanID, const helios::vec3 &xyz, const helios::SphericalCoord &direction, const helios::RGBcolor &color, const std::map< std::string, double > &data)
 Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.
 
void addHitPoint (uint scanID, const helios::vec3 &xyz, const helios::int2 &row_column, const helios::RGBcolor &color, const std::map< std::string, double > &data)
 Specify a scan point as a hit by providing the (x,y,z) coordinates and row,column in scan table.
 
void deleteHitPoint (uint index)
 Delete a hit point in the scan.
 
uint getHitCount () const
 Get the number of hit points in the point cloud.
 
helios::vec3 getScanOrigin (uint scanID) const
 Get the (x,y,z) scan origin.
 
uint getScanSizeTheta (uint scanID) const
 Get the number of scan points in the theta (zenithal) direction.
 
uint getScanSizePhi (uint scanID) const
 Get the number of scan points in the phi (azimuthal) direction.
 
helios::vec2 getScanRangeTheta (uint scanID) const
 Get the range of scan directions in the theta (zenithal) direction.
 
helios::vec2 getScanRangePhi (uint scanID) const
 Get the range of scan directions in the phi (azimuthal) direction.
 
float getScanBeamExitDiameter (uint scanID) const
 Get the diameter of the laser beam at exit from the instrument.
 
std::vector< std::string > getScanColumnFormat (uint scanID) const
 Get the labels for columns in ASCII input/output file.
 
float getScanBeamDivergence (uint scanID) const
 Divergence angle of the laser beam in radians.
 
helios::vec3 getHitXYZ (uint index) const
 Get (x,y,z) coordinate of hit point by index.
 
helios::SphericalCoord getHitRaydir (uint index) const
 Get ray direction of hit point in the scan based on its index.
 
double getHitData (uint index, const char *label) const
 Get floating point data value associated with a hit point.
 
void setHitData (uint index, const char *label, double value)
 Set floating point data value associated with a hit point.
 
bool doesHitDataExist (uint index, const char *label) const
 Check if scalar data exists for a hit point.
 
helios::RGBcolor getHitColor (uint index) const
 Get color of hit point.
 
int getHitScanID (uint index) const
 Get the scan with which a hit is associated.
 
int getHitIndex (uint scanID, uint row, uint column) const
 Get the index of a scan point based on its row and column in the hit table.
 
int getHitGridCell (uint index) const
 Get the grid cell in which the hit point resides.
 
void setHitGridCell (uint index, int cell)
 Set the grid cell in which the hit point resides.
 
void coordinateShift (const helios::vec3 &shift)
 Apply a translation to all points in the point cloud.
 
void coordinateShift (uint scanID, const helios::vec3 &shift)
 Apply a translation to all points in a given scan.
 
void coordinateRotation (const helios::SphericalCoord &rotation)
 Rotate all points in the point cloud about the origin.
 
void coordinateRotation (uint scanID, const helios::SphericalCoord &rotation)
 Rotate all points in the point cloud about the origin.
 
void coordinateRotation (float rotation, const helios::vec3 &line_base, const helios::vec3 &line_direction)
 Rotate all points in the point cloud about an arbitrary line.
 
uint getTriangleCount () const
 Get the number of triangles formed by the triangulation.
 
Triangulation getTriangle (uint index) const
 Get hit point corresponding to first vertex of triangle.
 
void loadXML (const char *filename)
 Read an XML file containing scan information.
 
void loadXML (const char *filename, bool load_grid_only)
 Read an XML file containing scan information.
 
size_t loadASCIIFile (uint scanID, const std::string &ASCII_data_file)
 Load point cloud data from a tabular ASCII text file into an existing scan.
 
void exportTriangleNormals (const char *filename)
 Export to file the normal vectors (nx,ny,nz) for all triangles formed.
 
void exportTriangleNormals (const char *filename, int gridcell)
 Export to file the normal vectors (nx,ny,nz) for triangles formed within a single gridcell.
 
void exportTriangleAreas (const char *filename)
 Export to file the area of all triangles formed.
 
void exportTriangleAreas (const char *filename, int gridcell)
 Export to file the area of all triangles formed within a single grid cell.
 
void exportTriangleInclinationDistribution (const char *filename, uint Nbins)
 
void exportTriangleAzimuthDistribution (const char *filename, uint Nbins)
 
void exportLeafAreas (const char *filename)
 Export to file the leaf area within each grid cell. Lines of the file correspond to each grid cell.
 
void exportLeafAreaDensities (const char *filename)
 Export to file the leaf area density within each grid cell. Lines of the file correspond to each grid cell.
 
void exportGtheta (const char *filename)
 Export to file the G(theta) value within each grid cell. Lines of the file correspond to each grid cell.
 
void exportPointCloud (const char *filename)
 Export to file all points in the point cloud to an ASCII text file following the column format specified by the <ASCII_format></ASCII_format> tag in the scan XML file.
 
void exportPointCloud (const char *filename, uint scanID)
 Export to file all points from a given scan to an ASCII text file following the column format specified by the <ASCII_format></ASCII_format> tag in the scan XML file.
 
void exportPointCloudPTX (const char *filename, uint scanID)
 Export to file all points from a given scan to PTX file.
 
void addHitsToVisualizer (Visualizer *visualizer, uint pointsize) const
 Add all hit points to the visualizer plug-in, and color them by their r-g-b color.
 
void addHitsToVisualizer (Visualizer *visualizer, uint pointsize, const helios::RGBcolor &point_color) const
 Add all hit points to the visualizer plug-in, and color them by a specified r-g-b color.
 
void addHitsToVisualizer (Visualizer *visualizer, uint pointsize, const char *color_value) const
 Add all hit points to the visualizer plug-in, and color them by a hit scalar data value.
 
void addGridToVisualizer (Visualizer *visualizer) const
 Add all grid cells to the visualizer plug-in.
 
void addGridWireFrametoVisualizer (Visualizer *visualizer, float linewidth_pixels=1.0f) const
 Add wire frame of the grid to the visualizer plug-in.
 
void addGrid (const helios::vec3 &center, const helios::vec3 &size, const helios::int3 &ndiv, float rotation)
 Add a grid to point cloud instead of reading in from an xml file.
 
void addTrianglesToVisualizer (Visualizer *visualizer) const
 Add all triangles to the visualizer plug-in, and color them by their r-g-b color.
 
void addTrianglesToVisualizer (Visualizer *visualizer, uint gridcell) const
 Add triangles within a given grid cell to the visualizer plug-in, and color them by their r-g-b color.
 
void addLeafReconstructionToVisualizer (Visualizer *visualizer) const
 Add reconstructed leaves (triangles or alpha masks) to the visualizer plug-in.
 
void addTrunkReconstructionToVisualizer (Visualizer *visualizer) const
 Add trunk reconstruction to the visualizer plug-in. Colors reconstructed triangles by hit point color.
 
void addTrunkReconstructionToVisualizer (Visualizer *visualizer, const helios::RGBcolor &trunk_color) const
 Add trunk reconstruction to the visualizer plug-in.
 
std::vector< uintaddLeafReconstructionToContext (helios::Context *context) const
 Add reconstructed leaves (texture-masked patches) to the Context.
 
std::vector< uintaddLeafReconstructionToContext (helios::Context *context, const helios::int2 &subpatches) const
 Add reconstructed leaves (texture-masked patches) to the Context with leaves divided into sub-patches (tiled)
 
std::vector< uintaddReconstructedTriangleGroupsToContext (helios::Context *context) const
 Add triangle groups used in the direct reconstruction to the Context.
 
std::vector< uintaddTrunkReconstructionToContext (helios::Context *context) const
 Add reconstructed trunk triangles to the Context.
 
void getHitBoundingBox (helios::vec3 &boxmin, helios::vec3 &boxmax) const
 Form an axis-aligned bounding box for all hit points in the point cloud.
 
void getGridBoundingBox (helios::vec3 &boxmin, helios::vec3 &boxmax) const
 Form an axis-aligned bounding box for all grid cells in the point cloud.
 
void distanceFilter (float maxdistance)
 Filter scan by imposing a maximum distance from the scanner.
 
void xyzFilter (float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
 overloaded version of xyzFilter that defaults to deleting points outside the provided bounding box
 
void xyzFilter (float xmin, float xmax, float ymin, float ymax, float zmin, float zmax, bool deleteOutside)
 Filter scan with a bounding box.
 
void reflectanceFilter (float minreflectance)
 Filter scan by imposing a minimum reflectance value.
 
void scalarFilter (const char *scalar_field, float threshold, const char *comparator)
 Filter hit points based on a scalar field given by a column in the ASCII data.
 
void maxPulseFilter (const char *scalar)
 Filter full-waveform data according to the maximum scalar value along each pulse. Any scalar value can be used, provided it is a field in the hit point data file. The resulting point cloud will have only one hit point per laser pulse.
 
void minPulseFilter (const char *scalar)
 Filter full-waveform data according to the minimum scalar value along each pulse. Any scalar value can be used, provided it is a field in the hit point data file. The resulting point cloud will have only one hit point per laser pulse.
 
void firstHitFilter ()
 Filter full-waveform data to include only the first hit per laser pulse. The resulting point cloud will have only one hit point per laser pulse (first hits).
 
void lastHitFilter ()
 Filter full-waveform data to include only the last hit per laser pulse. The resulting point cloud will have only one hit point per laser pulse (last hits).
 
void triangulateHitPoints (float Lmax, float max_aspect_ratio)
 Perform triangulation on all hit points in point cloud.
 
void triangulateHitPoints (float Lmax, float max_aspect_ratio, const char *scalar_field, float threshold, const char *comparator)
 Perform triangulation on hit points in point cloud that meet some filtering criteria based on scalar data.
 
void addTrianglesToContext (helios::Context *context) const
 Add triangle geometry to Helios context.
 
uint getGridCellCount () const
 Get the number of cells in the grid.
 
void addGridCell (const helios::vec3 &center, const helios::vec3 &size, float rotation)
 Add a cell to the grid.
 
void addGridCell (const helios::vec3 &center, const helios::vec3 &global_anchor, const helios::vec3 &size, const helios::vec3 &global_size, float rotation, const helios::int3 &global_ijk, const helios::int3 &global_count)
 Add a cell to the grid, where the cell is part of a larger global rectangular grid.
 
helios::vec3 getCellCenter (uint index) const
 Get the (x,y,z) coordinate of a grid cell by its index.
 
helios::vec3 getCellGlobalAnchor (uint index) const
 Get the (x,y,z) coordinate of a grid global anchor by its index.
 
helios::vec3 getCellSize (uint index) const
 Get the size of a grid cell by its index.
 
float getCellRotation (uint index) const
 Get the size of a grid cell by its index.
 
void syntheticScan (helios::Context *context)
 Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)
 
void syntheticScan (helios::Context *context, bool append)
 Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)
 
void syntheticScan (helios::Context *context, bool scan_grid_only, bool record_misses)
 Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)
 
void syntheticScan (helios::Context *context, bool scan_grid_only, bool record_misses, bool append)
 Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold)
 Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold, bool append)
 Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold, bool scan_grid_only, bool record_misses)
 Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold, bool scan_grid_only, bool record_misses, bool append)
 Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)
 
std::vector< float > calculateSyntheticLeafArea (helios::Context *context)
 Calculate the surface area of all primitives in the context.
 
std::vector< float > calculateSyntheticGtheta (helios::Context *context)
 Calculate the G(theta) of all primitives in the context.
 
void setCellLeafArea (float area, uint index)
 Set the leaf area of a grid cell in m^2.
 
float getCellLeafArea (uint index) const
 Get the leaf area of a grid cell in m^2.
 
float getCellLeafAreaDensity (uint index) const
 Get the leaf area density of a grid cell in 1/m.
 
void setCellGtheta (float Gtheta, uint index)
 Set the average G(theta) value of a grid cell.
 
float getCellGtheta (uint index) const
 Get the G(theta) of a grid cell.
 
std::vector< helios::vec3gapfillMisses ()
 For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points for all scans. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.
 
std::vector< helios::vec3gapfillMisses (uint scanID)
 For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.
 
std::vector< helios::vec3gapfillMisses (uint scanID, const bool gapfill_grid_only, const bool add_flags)
 For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.
 
void calculateLeafArea (helios::Context *context)
 Calculate the leaf area for each grid volume.
 
void calculateLeafArea (helios::Context *context, int min_voxel_hits)
 Calculate the leaf area for each grid volume.
 
void calculateLeafAreaGPU (helios::Context *context)
 Calculate the leaf area for each grid volume (DEPRECATED - use calculateLeafArea)
 
void calculateLeafAreaGPU (helios::Context *context, int min_voxel_hits)
 Calculate the leaf area for each grid volume (DEPRECATED - use calculateLeafArea)
 
void enableGPUAcceleration ()
 Enable GPU acceleration in CollisionDetection plugin.
 
void disableGPUAcceleration ()
 Disable GPU acceleration in CollisionDetection plugin (use CPU/OpenMP only)
 
void calculateHitGridCell ()
 Determine which grid cell each hit point resides in.
 
void leafReconstructionAlphaMask (float minimum_leaf_group_area, float maximum_leaf_group_area, float leaf_aspect_ratio, const char *mask_file)
 Perform a leaf reconstruction based on texture-masked Patches within each gridcell. The reconstruction produces Patches for each reconstructed leaf surface, with leaf size automatically estimated algorithmically.
 
void leafReconstructionAlphaMask (float minimum_leaf_group_area, float maximum_leaf_group_area, float leaf_aspect_ratio, float leaf_length_constant, const char *mask_file)
 Perform a leaf reconstruction based on texture-masked Patches within each gridcell. The reconstruction produces Patches for each reconstructed leaf surface, with leaf size set to a constant value.
 
void trunkReconstruction (const helios::vec3 &box_center, const helios::vec3 &box_size, float Lmax, float max_aspect_ratio)
 
std::vector< uintloadTreeQSM (helios::Context *context, const std::string &filename, uint radial_subdivisions, const std::string &texture_file="")
 Read a TreeQSM cylinder file and add tube objects to the context for each branch.
 
std::vector< uintloadTreeQSMColormap (helios::Context *context, const std::string &filename, uint radial_subdivisions, const std::string &colormap_name)
 Read a TreeQSM cylinder file and add tube objects to the context for each branch with colormap-based coloring.
 
void cropBeamsToGridAngleRange (uint source)
 Delete hitpoints that do not pass through / intersect the voxel grid.
 
std::vector< uintpeakFinder (std::vector< float > signal)
 find the indices of the peaks of a vector of floats
 

Static Public Member Functions

static int selfTest (int argc=0, char **argv=nullptr)
 Self-test (unit test) function.
 

Detailed Description

Primary class for terrestrial LiDAR scan.

Definition at line 268 of file LiDAR.h.

Constructor & Destructor Documentation

◆ LiDARcloud()

LiDARcloud::LiDARcloud ( )

LiDAR point cloud constructor.

Definition at line 84 of file LiDAR.cpp.

◆ ~LiDARcloud()

LiDARcloud::~LiDARcloud ( void  )

LiDAR point cloud destructor.

Definition at line 93 of file LiDAR.cpp.

Member Function Documentation

◆ addGrid()

void LiDARcloud::addGrid ( const helios::vec3 center,
const helios::vec3 size,
const helios::int3 ndiv,
float  rotation 
)

Add a grid to point cloud instead of reading in from an xml file.

Parameters
[in]centercenter of the grid.
[in]sizeSize of the grid in each dimension.
[in]ndivnumber of cells in the grid in each dimension.
[in]rotationhorizontal rotation in degrees.

Definition at line 699 of file LiDAR.cpp.

◆ addGridCell() [1/2]

void LiDARcloud::addGridCell ( const helios::vec3 center,
const helios::vec3 global_anchor,
const helios::vec3 size,
const helios::vec3 global_size,
float  rotation,
const helios::int3 global_ijk,
const helios::int3 global_count 
)

Add a cell to the grid, where the cell is part of a larger global rectangular grid.

Parameters
[in]center(x,y,z) coordinate of grid center
[in]global_anchor(x,y,z) coordinate of grid global anchor, i.e., this is the 'center' coordinate entered in the xml file. If grid Nx=Ny=Nz=1, global_anchor=center
[in]sizesize of the grid cell in the x,y,z directions
[in]global_sizesize of the global grid in the x,y,z directions
[in]rotationrotation angle (in radians) of the grid cell about the z-axis
[in]global_ijkindex within the global grid in the x,y,z directions
[in]global_counttotal number of cells in global grid in the x,y,z directions

Definition at line 2548 of file LiDAR.cpp.

◆ addGridCell() [2/2]

void LiDARcloud::addGridCell ( const helios::vec3 center,
const helios::vec3 size,
float  rotation 
)

Add a cell to the grid.

Parameters
[in]center(x,y,z) coordinate of grid center.
[in]sizesize of the grid cell in the x,y,z directions.
[in]rotationrotation angle (in radians) of the grid cell about the z-axis.

Definition at line 2544 of file LiDAR.cpp.

◆ addGridToVisualizer()

void LiDARcloud::addGridToVisualizer ( Visualizer visualizer) const

Add all grid cells to the visualizer plug-in.

Parameters
[in]visualizerPointer to the Visualizer plug-in object.

Definition at line 614 of file LiDAR.cpp.

◆ addGridWireFrametoVisualizer()

void LiDARcloud::addGridWireFrametoVisualizer ( Visualizer visualizer,
float  linewidth_pixels = 1.0f 
) const

Add wire frame of the grid to the visualizer plug-in.

Parameters
[in]visualizerPointer to the Visualizer plug-in object.
[in]linewidth_pixelsWidth of the wire frame lines in pixels (default = 1.0).

Definition at line 739 of file LiDAR.cpp.

◆ addHitPoint() [1/5]

void LiDARcloud::addHitPoint ( uint  scanID,
const helios::vec3 xyz,
const helios::int2 row_column,
const helios::RGBcolor color,
const std::map< std::string, double > &  data 
)

Specify a scan point as a hit by providing the (x,y,z) coordinates and row,column in scan table.

Parameters
[in]scanIDID of scan hit point to which hit point should be added.
[in]xyz(x,y,z) coordinates of hit point.
[in]row_columnrow (theta index) and column (phi index) for point in scan table
[in]colorr-g-b color of the hit point
[in]dataMap data structure containing floating point data values for the hit point. E.g., "reflectance" could be mapped to a value of 965.2.

◆ addHitPoint() [2/5]

void LiDARcloud::addHitPoint ( uint  scanID,
const helios::vec3 xyz,
const helios::SphericalCoord direction 
)

Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.

Parameters
[in]scanIDID of scan hit point to which hit point should be added.
[in]xyz(x,y,z) coordinates of hit point.
[in]directionSpherical coordinate corresponding to the scanner ray direction for the hit point.
Note
If only the (row,column) scan table coordinates are available, use ScanMetadata::rc2direction() to convert them to a spherical scan direction coordinate.

Definition at line 219 of file LiDAR.cpp.

◆ addHitPoint() [3/5]

void LiDARcloud::addHitPoint ( uint  scanID,
const helios::vec3 xyz,
const helios::SphericalCoord direction,
const helios::RGBcolor color 
)

Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.

Parameters
[in]scanIDID of scan hit point to which hit point should be added.
[in]xyz(x,y,z) coordinates of hit point.
[in]directionSpherical coordinate corresponding to the scanner ray direction for the hit point.
[in]colorr-g-b color of the hit point
Note
If only the (row,column) scan table coordinates are available, use ScanMetadata::rc2direction() to convert them to a spherical scan direction coordinate.

Definition at line 238 of file LiDAR.cpp.

◆ addHitPoint() [4/5]

void LiDARcloud::addHitPoint ( uint  scanID,
const helios::vec3 xyz,
const helios::SphericalCoord direction,
const helios::RGBcolor color,
const std::map< std::string, double > &  data 
)

Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.

Parameters
[in]scanIDID of scan hit point to which hit point should be added.
[in]xyz(x,y,z) coordinates of hit point.
[in]directionSpherical coordinate corresponding to the scanner ray direction for the hit point.
[in]colorr-g-b color of the hit point
[in]dataMap data structure containing floating point data values for the hit point. E.g., "reflectance" could be mapped to a value of 965.2.

◆ addHitPoint() [5/5]

void LiDARcloud::addHitPoint ( uint  scanID,
const helios::vec3 xyz,
const helios::SphericalCoord direction,
const std::map< std::string, double > &  data 
)

Specify a scan point as a hit by providing the (x,y,z) coordinates and scan ray direction.

Parameters
[in]scanIDID of scan hit point to which hit point should be added.
[in]xyz(x,y,z) coordinates of hit point.
[in]directionSpherical coordinate corresponding to the scanner ray direction for the hit point.
[in]dataMap data structure containing floating point data values for the hit point. E.g., "reflectance" could be mapped to a value of 965.2.

◆ addHitsToVisualizer() [1/3]

void LiDARcloud::addHitsToVisualizer ( Visualizer visualizer,
uint  pointsize 
) const

Add all hit points to the visualizer plug-in, and color them by their r-g-b color.

Parameters
[in]visualizerPointer to the Visualizer plugin object.
[in]pointsizeSize of scan point in font points.

Definition at line 538 of file LiDAR.cpp.

◆ addHitsToVisualizer() [2/3]

void LiDARcloud::addHitsToVisualizer ( Visualizer visualizer,
uint  pointsize,
const char *  color_value 
) const

Add all hit points to the visualizer plug-in, and color them by a hit scalar data value.

Parameters
[in]visualizerPointer to the Visualizer plugin object.
[in]pointsizeSize of scan point in font points.
[in]color_valueLabel for scalar hit data value to be used for coloring the points based on a pseudocolor mapping (e.g., "reflectance"). If the label does not exist, the function will print a warning and use the default color.

Definition at line 556 of file LiDAR.cpp.

◆ addHitsToVisualizer() [3/3]

void LiDARcloud::addHitsToVisualizer ( Visualizer visualizer,
uint  pointsize,
const helios::RGBcolor point_color 
) const

Add all hit points to the visualizer plug-in, and color them by a specified r-g-b color.

Parameters
[in]visualizerPointer to the Visualizer plugin object.
[in]pointsizeSize of scan point in font points.
[in]point_colorr-g-b color of the hit points.

Definition at line 542 of file LiDAR.cpp.

◆ addLeafReconstructionToContext() [1/2]

std::vector< uint > LiDARcloud::addLeafReconstructionToContext ( helios::Context context) const

Add reconstructed leaves (texture-masked patches) to the Context.

Parameters
[in]contextPointer to the Helios context
Note
This function creates the following primitive data for each patch 1) "gridCell" which indicates the index of the gridcell that contains the patch, 2) "directFlag" which equals 1 if the leaf was part of the direct reconstruction, and 0 if the leaf was backfilled.

Definition at line 854 of file LiDAR.cpp.

◆ addLeafReconstructionToContext() [2/2]

std::vector< uint > LiDARcloud::addLeafReconstructionToContext ( helios::Context context,
const helios::int2 subpatches 
) const

Add reconstructed leaves (texture-masked patches) to the Context with leaves divided into sub-patches (tiled)

Parameters
[in]contextPointer to the Helios context
[in]subpatchesNumber of leaf sub-patches (tiles) in the x- and y- directions.
Note
This function creates the following primitive data for each patch 1) "gridCell" which indicates the index of the gridcell that contains the patch, 2) "directFlag" which equals 1 if the leaf was part of the direct reconstruction, and 0 if the leaf was backfilled.

Definition at line 858 of file LiDAR.cpp.

◆ addLeafReconstructionToVisualizer()

void LiDARcloud::addLeafReconstructionToVisualizer ( Visualizer visualizer) const

Add reconstructed leaves (triangles or alpha masks) to the visualizer plug-in.

Parameters
[in]visualizerPointer to the Visualizer plugin object.

Definition at line 770 of file LiDAR.cpp.

◆ addReconstructedTriangleGroupsToContext()

std::vector< uint > LiDARcloud::addReconstructedTriangleGroupsToContext ( helios::Context context) const

Add triangle groups used in the direct reconstruction to the Context.

Parameters
[in]contextPointer to the Helios context.
Note
This function creates primitive data called "leafGroup" which provides an identifier for each triangle based on the fill group it is in.

Definition at line 898 of file LiDAR.cpp.

◆ addScan()

uint LiDARcloud::addScan ( ScanMetadata newscan)

Add a LiDAR scan to the point cloud.

Parameters
[in]newscanLiDAR scan data structure
Returns
ID for scan that was created

Definition at line 187 of file LiDAR.cpp.

◆ addTrianglesToContext()

void LiDARcloud::addTrianglesToContext ( helios::Context context) const

Add triangle geometry to Helios context.

Parameters
[in]contextPointer to Helios context

Definition at line 2523 of file LiDAR.cpp.

◆ addTrianglesToVisualizer() [1/2]

void LiDARcloud::addTrianglesToVisualizer ( Visualizer visualizer) const

Add all triangles to the visualizer plug-in, and color them by their r-g-b color.

Parameters
[in]visualizerPointer to the Visualizer plug-in object.

Definition at line 667 of file LiDAR.cpp.

◆ addTrianglesToVisualizer() [2/2]

void LiDARcloud::addTrianglesToVisualizer ( Visualizer visualizer,
uint  gridcell 
) const

Add triangles within a given grid cell to the visualizer plug-in, and color them by their r-g-b color.

Parameters
[in]visualizerPointer to the Visualizer plugin object.
[in]gridcellIndex of grid cell.

Definition at line 682 of file LiDAR.cpp.

◆ addTrunkReconstructionToContext()

std::vector< uint > LiDARcloud::addTrunkReconstructionToContext ( helios::Context context) const

Add reconstructed trunk triangles to the Context.

Parameters
[in]contextPointer to the Helios context

Definition at line 928 of file LiDAR.cpp.

◆ addTrunkReconstructionToVisualizer() [1/2]

void LiDARcloud::addTrunkReconstructionToVisualizer ( Visualizer visualizer) const

Add trunk reconstruction to the visualizer plug-in. Colors reconstructed triangles by hit point color.

Parameters
[in]visualizerPointer to the Visualizer plugin object.

Definition at line 818 of file LiDAR.cpp.

◆ addTrunkReconstructionToVisualizer() [2/2]

void LiDARcloud::addTrunkReconstructionToVisualizer ( Visualizer visualizer,
const helios::RGBcolor trunk_color 
) const

Add trunk reconstruction to the visualizer plug-in.

Parameters
[in]visualizerPointer to the Visualizer plugin object.
[in]trunk_colorr-g-b color of trunk.

Definition at line 837 of file LiDAR.cpp.

◆ calculateHitGridCell()

void LiDARcloud::calculateHitGridCell ( )

Determine which grid cell each hit point resides in.

Definition at line 4061 of file LiDAR.cpp.

◆ calculateLeafArea() [1/2]

void LiDARcloud::calculateLeafArea ( helios::Context context)

Calculate the leaf area for each grid volume.

Parameters
[in]contextPointer to the Helios context

Definition at line 3595 of file LiDAR.cpp.

◆ calculateLeafArea() [2/2]

void LiDARcloud::calculateLeafArea ( helios::Context context,
int  min_voxel_hits 
)

Calculate the leaf area for each grid volume.

Parameters
[in]contextPointer to the Helios context
[in]min_voxel_hitsMinimum number of allowable LiDAR hits per voxel

Definition at line 3599 of file LiDAR.cpp.

◆ calculateLeafAreaGPU() [1/2]

void LiDARcloud::calculateLeafAreaGPU ( helios::Context context)

Calculate the leaf area for each grid volume (DEPRECATED - use calculateLeafArea)

Deprecated:
This function has been renamed to calculateLeafArea(). The GPU-specific implementation has been replaced with CollisionDetection plugin integration. Use calculateLeafArea() instead. For GPU acceleration, call enableCDGPUAcceleration() before calculateLeafArea().
Parameters
[in]contextPointer to the Helios context

Definition at line 4041 of file LiDAR.cpp.

◆ calculateLeafAreaGPU() [2/2]

void LiDARcloud::calculateLeafAreaGPU ( helios::Context context,
int  min_voxel_hits 
)

Calculate the leaf area for each grid volume (DEPRECATED - use calculateLeafArea)

Deprecated:
This function has been renamed to calculateLeafArea(). The GPU-specific implementation has been replaced with CollisionDetection plugin integration. Use calculateLeafArea() instead. For GPU acceleration, call enableCDGPUAcceleration() before calculateLeafArea().
Parameters
[in]contextPointer to the Helios context
[in]min_voxel_hitsMinimum number of allowable LiDAR hits per voxel

Definition at line 4045 of file LiDAR.cpp.

◆ calculateSyntheticGtheta()

std::vector< float > LiDARcloud::calculateSyntheticGtheta ( helios::Context context)

Calculate the G(theta) of all primitives in the context.

Parameters
[in]contextPointer to the Helios context

Definition at line 2591 of file LiDAR.cpp.

◆ calculateSyntheticLeafArea()

std::vector< float > LiDARcloud::calculateSyntheticLeafArea ( helios::Context context)

Calculate the surface area of all primitives in the context.

Parameters
[in]contextPointer to the Helios context

Definition at line 4214 of file LiDAR.cpp.

◆ coordinateRotation() [1/3]

void LiDARcloud::coordinateRotation ( const helios::SphericalCoord rotation)

Rotate all points in the point cloud about the origin.

Parameters
[in]rotationSpherical rotation angle

Definition at line 486 of file LiDAR.cpp.

◆ coordinateRotation() [2/3]

void LiDARcloud::coordinateRotation ( float  rotation,
const helios::vec3 line_base,
const helios::vec3 line_direction 
)

Rotate all points in the point cloud about an arbitrary line.

Parameters
[in]rotationSpherical rotation angle
[in]line_base(x,y,z) coordinate of a point on the line about which points will be rotated
[in]line_directionUnit vector pointing in the direction of the line about which points will be rotated

Definition at line 514 of file LiDAR.cpp.

◆ coordinateRotation() [3/3]

void LiDARcloud::coordinateRotation ( uint  scanID,
const helios::SphericalCoord rotation 
)

Rotate all points in the point cloud about the origin.

Parameters
[in]scanIDID of scan to be shifted
[in]rotationSpherical rotation angle

Definition at line 498 of file LiDAR.cpp.

◆ coordinateShift() [1/2]

void LiDARcloud::coordinateShift ( const helios::vec3 shift)

Apply a translation to all points in the point cloud.

Parameters
[in]shiftDistance to translate in x-, y-, and z- direction

Definition at line 460 of file LiDAR.cpp.

◆ coordinateShift() [2/2]

void LiDARcloud::coordinateShift ( uint  scanID,
const helios::vec3 shift 
)

Apply a translation to all points in a given scan.

Parameters
[in]scanIDID of scan to be shifted
[in]shiftDistance to translate in x-, y-, and z- direction

Definition at line 471 of file LiDAR.cpp.

◆ cropBeamsToGridAngleRange()

void LiDARcloud::cropBeamsToGridAngleRange ( uint  source)

Delete hitpoints that do not pass through / intersect the voxel grid.

Parameters
[in]sourcethe scan index

Definition at line 3197 of file LiDAR.cpp.

◆ deleteHitPoint()

void LiDARcloud::deleteHitPoint ( uint  index)

Delete a hit point in the scan.

Parameters
[in]indexIndex of hit point in the point cloud

Definition at line 271 of file LiDAR.cpp.

◆ disableGPUAcceleration()

void LiDARcloud::disableGPUAcceleration ( )

Disable GPU acceleration in CollisionDetection plugin (use CPU/OpenMP only)

Definition at line 4055 of file LiDAR.cpp.

◆ disableMessages()

void LiDARcloud::disableMessages ( )

Disable all print messages to the screen except for fatal error messages.

Definition at line 97 of file LiDAR.cpp.

◆ distanceFilter()

void LiDARcloud::distanceFilter ( float  maxdistance)

Filter scan by imposing a maximum distance from the scanner.

Parameters
[in]maxdistanceMaximum hit point distance from scanner

Definition at line 1030 of file LiDAR.cpp.

◆ doesHitDataExist()

bool LiDARcloud::doesHitDataExist ( uint  index,
const char *  label 
) const

Check if scalar data exists for a hit point.

Parameters
[in]indexHit number.
[in]labelLabel of the data value (e.g., "reflectance").

Definition at line 389 of file LiDAR.cpp.

◆ enableGPUAcceleration()

void LiDARcloud::enableGPUAcceleration ( )

Enable GPU acceleration in CollisionDetection plugin.

Definition at line 4049 of file LiDAR.cpp.

◆ enableMessages()

void LiDARcloud::enableMessages ( )

Enable all print messages to the screen.

Definition at line 154 of file LiDAR.cpp.

◆ exportGtheta()

void LiDARcloud::exportGtheta ( const char *  filename)

Export to file the G(theta) value within each grid cell. Lines of the file correspond to each grid cell.

Parameters
[in]filenameName of file

Definition at line 793 of file fileIO.cpp.

◆ exportLeafAreaDensities()

void LiDARcloud::exportLeafAreaDensities ( const char *  filename)

Export to file the leaf area density within each grid cell. Lines of the file correspond to each grid cell.

Parameters
[in]filenameName of file

Definition at line 773 of file fileIO.cpp.

◆ exportLeafAreas()

void LiDARcloud::exportLeafAreas ( const char *  filename)

Export to file the leaf area within each grid cell. Lines of the file correspond to each grid cell.

Parameters
[in]filenameName of file

Definition at line 753 of file fileIO.cpp.

◆ exportPointCloud() [1/2]

void LiDARcloud::exportPointCloud ( const char *  filename)

Export to file all points in the point cloud to an ASCII text file following the column format specified by the <ASCII_format></ASCII_format> tag in the scan XML file.

Parameters
[in]filenameName of file
Note
If there are multiple scans in the point cloud, each scan will be exported to a different file with the scan ID appended to the filename. This is because different scans may have a different column format.

Definition at line 813 of file fileIO.cpp.

◆ exportPointCloud() [2/2]

void LiDARcloud::exportPointCloud ( const char *  filename,
uint  scanID 
)

Export to file all points from a given scan to an ASCII text file following the column format specified by the <ASCII_format></ASCII_format> tag in the scan XML file.

Parameters
[in]filenameName of file
[in]scanIDIdentifier of scan to be exported

Definition at line 839 of file fileIO.cpp.

◆ exportPointCloudPTX()

void LiDARcloud::exportPointCloudPTX ( const char *  filename,
uint  scanID 
)

Export to file all points from a given scan to PTX file.

Parameters
[in]filenameName of file
[in]scanIDIdentifier of scan to be exported

Definition at line 925 of file fileIO.cpp.

◆ exportTriangleAreas() [1/2]

void LiDARcloud::exportTriangleAreas ( const char *  filename)

Export to file the area of all triangles formed.

Parameters
[in]filenameName of file

Definition at line 576 of file fileIO.cpp.

◆ exportTriangleAreas() [2/2]

void LiDARcloud::exportTriangleAreas ( const char *  filename,
int  gridcell 
)

Export to file the area of all triangles formed within a single grid cell.

Parameters
[in]filenameName of file
[in]gridcellIndex of gridcell to get triangles from

Definition at line 598 of file fileIO.cpp.

◆ exportTriangleAzimuthDistribution()

void LiDARcloud::exportTriangleAzimuthDistribution ( const char *  filename,
uint  Nbins 
)

Export to file discrete azimuthal angle probability distribution based on the triangulation. Azimuthal angles are between 0 and 360 degrees. The probability distribution is normalized such that the integral over all angles is 1. The value of each bin is written as a column in the output file; lines correspond to each voxel grid cell.

Parameters
[in]filenameName of file
[in]NbinsNumber of bins to use for the histogram

Definition at line 684 of file fileIO.cpp.

◆ exportTriangleInclinationDistribution()

void LiDARcloud::exportTriangleInclinationDistribution ( const char *  filename,
uint  Nbins 
)

Export to file discrete area-weighted inclination angle probability distribution based on the triangulation. Inclination angles are between 0 and 90 degrees. The probability distribution is normalized such that the sine-weighted integral over all angles is 1. The value of each bin is written as a column in the output file; lines correspond to each voxel grid cell.

Parameters
[in]filenameName of file
[in]NbinsNumber of bins to use for the histogram

Definition at line 623 of file fileIO.cpp.

◆ exportTriangleNormals() [1/2]

void LiDARcloud::exportTriangleNormals ( const char *  filename)

Export to file the normal vectors (nx,ny,nz) for all triangles formed.

Parameters
[in]filenameName of file

Definition at line 515 of file fileIO.cpp.

◆ exportTriangleNormals() [2/2]

void LiDARcloud::exportTriangleNormals ( const char *  filename,
int  gridcell 
)

Export to file the normal vectors (nx,ny,nz) for triangles formed within a single gridcell.

Parameters
[in]filenameName of file
[in]gridcellIndex of gridcell to get triangles from

Definition at line 544 of file fileIO.cpp.

◆ firstHitFilter()

void LiDARcloud::firstHitFilter ( )

Filter full-waveform data to include only the first hit per laser pulse. The resulting point cloud will have only one hit point per laser pulse (first hits).

Note
This function is only applicable for full-waveform data and requires that the scalar field "target_index" is provided in the hit point data file. The "target_index" values can start at 0 or 1 for first hits as long as it is consistent throughout the point cloud.

Definition at line 1295 of file LiDAR.cpp.

◆ gapfillMisses() [1/3]

std::vector< helios::vec3 > LiDARcloud::gapfillMisses ( )

For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points for all scans. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.

Returns
(x,y,z) of missing points added to the scan from gapfilling

Definition at line 1386 of file LiDAR.cpp.

◆ gapfillMisses() [2/3]

std::vector< helios::vec3 > LiDARcloud::gapfillMisses ( uint  scanID)

For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.

Parameters
[in]scanIDID of scan to gapfill
Returns
(x,y,z) of missing points added to the scan from gapfilling

Definition at line 1395 of file LiDAR.cpp.

◆ gapfillMisses() [3/3]

std::vector< helios::vec3 > LiDARcloud::gapfillMisses ( uint  scanID,
const bool  gapfill_grid_only,
const bool  add_flags 
)

For scans that are missing points (e.g., sky points), this function will attempt to fill in missing points. This increases the accuracy of LAD calculations because it makes sure all pulses are accounted for.

Parameters
[in]scanIDID of scan to gapfill
[in]gapfill_grid_onlyif true, missing points are gapfilled only within the axis-aligned bounding box of the voxel grid. If false missing points are gap filled across the range of phi and theta values specified in the scan xml file.
[in]add_flagsif true, gapfillMisses_code is added as hitpoint data. 0 = original points, 1 = gapfilled, 2 = extrapolated at downward edge, 3 = extrapolated at upward edge
Returns
(x,y,z) of missing points added to the scan from gapfilling

Definition at line 1399 of file LiDAR.cpp.

◆ getCellCenter()

helios::vec3 LiDARcloud::getCellCenter ( uint  index) const

Get the (x,y,z) coordinate of a grid cell by its index.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2555 of file LiDAR.cpp.

◆ getCellGlobalAnchor()

helios::vec3 LiDARcloud::getCellGlobalAnchor ( uint  index) const

Get the (x,y,z) coordinate of a grid global anchor by its index.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2564 of file LiDAR.cpp.

◆ getCellGtheta()

float LiDARcloud::getCellGtheta ( uint  index) const

Get the G(theta) of a grid cell.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2695 of file LiDAR.cpp.

◆ getCellLeafArea()

float LiDARcloud::getCellLeafArea ( uint  index) const

Get the leaf area of a grid cell in m^2.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2666 of file LiDAR.cpp.

◆ getCellLeafAreaDensity()

float LiDARcloud::getCellLeafAreaDensity ( uint  index) const

Get the leaf area density of a grid cell in 1/m.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2675 of file LiDAR.cpp.

◆ getCellRotation()

float LiDARcloud::getCellRotation ( uint  index) const

Get the size of a grid cell by its index.

Parameters
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2582 of file LiDAR.cpp.

◆ getCellSize()

helios::vec3 LiDARcloud::getCellSize ( uint  index) const

Get the size of a grid cell by its index.

 \param[in] index Index of a grid cell.  Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, an

d the last cell's index is Ncells-1.

Definition at line 2573 of file LiDAR.cpp.

◆ getGridBoundingBox()

void LiDARcloud::getGridBoundingBox ( helios::vec3 boxmin,
helios::vec3 boxmax 
) const

Form an axis-aligned bounding box for all grid cells in the point cloud.

Parameters
[out]boxminCoordinates of the bounding box vertex in the (-x,-y,-z) direction.
[out]boxmaxCoordinates of the bounding box vertex in the (+x,+y,+z) direction.

Definition at line 986 of file LiDAR.cpp.

◆ getGridCellCount()

uint LiDARcloud::getGridCellCount ( void  ) const

Get the number of cells in the grid.

Definition at line 2540 of file LiDAR.cpp.

◆ getHitBoundingBox()

void LiDARcloud::getHitBoundingBox ( helios::vec3 boxmin,
helios::vec3 boxmax 
) const

Form an axis-aligned bounding box for all hit points in the point cloud.

Parameters
[out]boxminCoordinates of the bounding box vertex in the (-x,-y,-z) direction.
[out]boxmaxCoordinates of the bounding box vertex in the (+x,+y,+z) direction.

Definition at line 951 of file LiDAR.cpp.

◆ getHitColor()

RGBcolor LiDARcloud::getHitColor ( uint  index) const

Get color of hit point.

Parameters
[in]indexHit number

Definition at line 403 of file LiDAR.cpp.

◆ getHitCount()

uint LiDARcloud::getHitCount ( ) const

Get the number of hit points in the point cloud.

Definition at line 287 of file LiDAR.cpp.

◆ getHitData()

double LiDARcloud::getHitData ( uint  index,
const char *  label 
) const

Get floating point data value associated with a hit point.

Parameters
[in]indexHit number.
[in]labelLabel of the data value (e.g., "reflectance").
Returns
Value of scalar data.

Definition at line 375 of file LiDAR.cpp.

◆ getHitGridCell()

int LiDARcloud::getHitGridCell ( uint  index) const

Get the grid cell in which the hit point resides.

Parameters
[in]indexHit number
Note
If the point does not reside in any grid cells, this function returns ‘-1’.
Calling this function requires that the function calculateHitGridCell[*]() has been called previously.

Definition at line 439 of file LiDAR.cpp.

◆ getHitIndex()

int LiDARcloud::getHitIndex ( uint  scanID,
uint  row,
uint  column 
) const

Get the index of a scan point based on its row and column in the hit table.

Parameters
[in]scanIDID of scan.
[in]rowRow in the 2D scan data table (elevation angle).
[in]columnColumn in the 2D scan data table (azimuthal angle).
Note
If the point was not a hit, the function will return ‘-1’.

Definition at line 421 of file LiDAR.cpp.

◆ getHitRaydir()

helios::SphericalCoord LiDARcloud::getHitRaydir ( uint  index) const

Get ray direction of hit point in the scan based on its index.

Parameters
[in]indexHit number

Definition at line 356 of file LiDAR.cpp.

◆ getHitScanID()

int LiDARcloud::getHitScanID ( uint  index) const

Get the scan with which a hit is associated.

Parameters
[in]indexHit number

Definition at line 412 of file LiDAR.cpp.

◆ getHitXYZ()

helios::vec3 LiDARcloud::getHitXYZ ( uint  index) const

Get (x,y,z) coordinate of hit point by index.

Parameters
[in]indexHit number

Definition at line 347 of file LiDAR.cpp.

◆ getScanBeamDivergence()

float LiDARcloud::getScanBeamDivergence ( uint  scanID) const

Divergence angle of the laser beam in radians.

Parameters
[in]scanIDID of scan.
Returns
Divergence angle of the beam.

Definition at line 333 of file LiDAR.cpp.

◆ getScanBeamExitDiameter()

float LiDARcloud::getScanBeamExitDiameter ( uint  scanID) const

Get the diameter of the laser beam at exit from the instrument.

Parameters
[in]scanIDID of scan.
Returns
Diameter of the beam at exit.

Definition at line 326 of file LiDAR.cpp.

◆ getScanColumnFormat()

std::vector< std::string > LiDARcloud::getScanColumnFormat ( uint  scanID) const

Get the labels for columns in ASCII input/output file.

Parameters
[in]scanIDID of scan.

Definition at line 340 of file LiDAR.cpp.

◆ getScanCount()

uint LiDARcloud::getScanCount ( )

Get number of scans in point cloud.

Definition at line 183 of file LiDAR.cpp.

◆ getScanOrigin()

helios::vec3 LiDARcloud::getScanOrigin ( uint  scanID) const

Get the (x,y,z) scan origin.

Parameters
[in]scanIDID of scan.

Definition at line 291 of file LiDAR.cpp.

◆ getScanRangePhi()

helios::vec2 LiDARcloud::getScanRangePhi ( uint  scanID) const

Get the range of scan directions in the phi (azimuthal) direction.

Parameters
[in]scanIDID of scan.
Returns
vec2.x is the minimum scan azimuthal angle, and vec2.y is the maximum scan azimuthal angle, both in radians

Definition at line 319 of file LiDAR.cpp.

◆ getScanRangeTheta()

helios::vec2 LiDARcloud::getScanRangeTheta ( uint  scanID) const

Get the range of scan directions in the theta (zenithal) direction.

Parameters
[in]scanIDID of scan.
Returns
vec2.x is the minimum scan zenithal angle, and vec2.y is the maximum scan zenithal angle, both in radians

Definition at line 312 of file LiDAR.cpp.

◆ getScanSizePhi()

uint LiDARcloud::getScanSizePhi ( uint  scanID) const

Get the number of scan points in the phi (azimuthal) direction.

Parameters
[in]scanIDID of scan.

Definition at line 305 of file LiDAR.cpp.

◆ getScanSizeTheta()

uint LiDARcloud::getScanSizeTheta ( uint  scanID) const

Get the number of scan points in the theta (zenithal) direction.

Parameters
[in]scanIDID of scan.

Definition at line 298 of file LiDAR.cpp.

◆ getTriangle()

Triangulation LiDARcloud::getTriangle ( uint  index) const

Get hit point corresponding to first vertex of triangle.

Parameters
[in]indexTriangulation index (0 thru Ntriangles-1)
Returns
Hit point index (0 thru Nhits-1)

Definition at line 530 of file LiDAR.cpp.

◆ getTriangleCount()

uint LiDARcloud::getTriangleCount ( ) const

Get the number of triangles formed by the triangulation.

Definition at line 526 of file LiDAR.cpp.

◆ initializeCollisionDetection()

void LiDARcloud::initializeCollisionDetection ( helios::Context context)

Initialize collision detection plugin for unified ray-tracing (called automatically when needed)

Definition at line 101 of file LiDAR.cpp.

◆ lastHitFilter()

void LiDARcloud::lastHitFilter ( )

Filter full-waveform data to include only the last hit per laser pulse. The resulting point cloud will have only one hit point per laser pulse (last hits).

Note
This function is only applicable for full-waveform data and requires that the scalar fields "target_index" and "target_count" are provided in the hit point data file. The "target_index" values can start at 0 or 1 for first hits as long as it is consistent throughout the point cloud.

Definition at line 1335 of file LiDAR.cpp.

◆ leafReconstructionAlphaMask() [1/2]

void LiDARcloud::leafReconstructionAlphaMask ( float  minimum_leaf_group_area,
float  maximum_leaf_group_area,
float  leaf_aspect_ratio,
const char *  mask_file 
)

Perform a leaf reconstruction based on texture-masked Patches within each gridcell. The reconstruction produces Patches for each reconstructed leaf surface, with leaf size automatically estimated algorithmically.

Parameters
[in]minimum_leaf_group_areaMinimum allowable area of leaf triangular fill groups. Leaf fill groups with total areas less than minimum_leaf_group_area are not considered in the reconstruction.
[in]maximum_leaf_group_areaMaximum area of leaf triangular fill groups. Leaf fill groups with total areas greater than maximum_leaf_group_area are not considered in the reconstruction.
[in]leaf_aspect_ratioRatio of length of leaf along midrib to with of leaf perpendicular to leaf midrib. This will generally be the length/width of leaf mask.
[in]mask_filePath to PNG image file to be used with Alpha Mask.

Definition at line 2797 of file LiDAR.cpp.

◆ leafReconstructionAlphaMask() [2/2]

void LiDARcloud::leafReconstructionAlphaMask ( float  minimum_leaf_group_area,
float  maximum_leaf_group_area,
float  leaf_aspect_ratio,
float  leaf_length_constant,
const char *  mask_file 
)

Perform a leaf reconstruction based on texture-masked Patches within each gridcell. The reconstruction produces Patches for each reconstructed leaf surface, with leaf size set to a constant value.

Parameters
[in]minimum_leaf_group_areaMinimum allowable area of leaf triangular fill groups. Leaf fill groups with total areas less than minimum_leaf_group_area are not considered in the reconstruction.
[in]maximum_leaf_group_areaMaximum area of leaf triangular fill groups. Leaf fill groups with total areas greater than maximum_leaf_group_area are not considered in the reconstruction.
[in]leaf_aspect_ratioRatio of length of leaf along midrib to with of leaf perpendicular to leaf midrib. This will generally be the length/width of leaf mask.
[in]leaf_length_constantConstant length of all reconstructed leaves.
[in]mask_filePath to PNG image file to be used with Alpha Mask.

Definition at line 2801 of file LiDAR.cpp.

◆ loadASCIIFile()

size_t LiDARcloud::loadASCIIFile ( uint  scanID,
const std::string &  ASCII_data_file 
)

Load point cloud data from a tabular ASCII text file into an existing scan.

Parameters
[in]scanIDID of the scan to which the point cloud data should be added.
[in]ASCII_data_fileMetadata for point cloud data contained in the ASCII text file.
Returns
Number of points loaded from the file.

Definition at line 403 of file fileIO.cpp.

◆ loadTreeQSM()

std::vector< uint > LiDARcloud::loadTreeQSM ( helios::Context context,
const std::string &  filename,
uint  radial_subdivisions,
const std::string &  texture_file = "" 
)

Read a TreeQSM cylinder file and add tube objects to the context for each branch.

Parameters
[in]contextPointer to the Helios context where tube objects will be added.
[in]filenamePath to the TreeQSM cylinder text file.
[in]radial_subdivisionsNumber of radial subdivisions for the tube objects.
[in]texture_fileOptional path to texture image file for the tube objects. If empty, tubes will be colored red.
Returns
Vector of tube object IDs that were created.

Definition at line 1003 of file fileIO.cpp.

◆ loadTreeQSMColormap()

std::vector< uint > LiDARcloud::loadTreeQSMColormap ( helios::Context context,
const std::string &  filename,
uint  radial_subdivisions,
const std::string &  colormap_name 
)

Read a TreeQSM cylinder file and add tube objects to the context for each branch with colormap-based coloring.

Parameters
[in]contextPointer to the Helios context where tube objects will be added.
[in]filenamePath to the TreeQSM cylinder text file.
[in]radial_subdivisionsNumber of radial subdivisions for the tube objects.
[in]colormap_nameName of the Helios colormap to use for coloring branches (e.g., "hot", "cool", "rainbow").
Returns
Vector of tube object UUIDs that were created.
Note
Each branch will be colored with a color randomly sampled from the colormap based on the branch ID.

Definition at line 1007 of file fileIO.cpp.

◆ loadXML() [1/2]

void LiDARcloud::loadXML ( const char *  filename)

Read an XML file containing scan information.

Parameters
[in]filenamePath to XML file

Definition at line 35 of file fileIO.cpp.

◆ loadXML() [2/2]

void LiDARcloud::loadXML ( const char *  filename,
bool  load_grid_only 
)

Read an XML file containing scan information.

Parameters
[in]filenamePath to XML file
[in]load_grid_onlyif true only the voxel grid defined in the xml file will be loaded, the scans themselves will not be loaded.

Definition at line 39 of file fileIO.cpp.

◆ maxPulseFilter()

void LiDARcloud::maxPulseFilter ( const char *  scalar)

Filter full-waveform data according to the maximum scalar value along each pulse. Any scalar value can be used, provided it is a field in the hit point data file. The resulting point cloud will have only one hit point per laser pulse.

Parameters
[in]scalarName of hit point scalar data in the hit data file.
Note
This function is only applicable for full-waveform data and requires that the scalar field "timestamp" is provided in the ASCII hit point data file.

Definition at line 1153 of file LiDAR.cpp.

◆ minPulseFilter()

void LiDARcloud::minPulseFilter ( const char *  scalar)

Filter full-waveform data according to the minimum scalar value along each pulse. Any scalar value can be used, provided it is a field in the hit point data file. The resulting point cloud will have only one hit point per laser pulse.

Parameters
[in]scalarName of hit point scalar data in the ASCII hit data file.
Note
This function is only applicable for full-waveform data and requires that the scalar field "timestamp" is provided in the hit point data file.

Definition at line 1224 of file LiDAR.cpp.

◆ peakFinder()

std::vector< uint > LiDARcloud::peakFinder ( std::vector< float >  signal)

find the indices of the peaks of a vector of floats

Parameters
[in]signalthe signal we want to detect peaks in

◆ performUnifiedRayTracing()

void LiDARcloud::performUnifiedRayTracing ( helios::Context context,
size_t  N,
int  Npulse,
helios::vec3 ray_origins,
helios::vec3 direction,
float *  hit_t,
float *  hit_fnorm,
int *  hit_ID 
)

Perform unified ray-tracing using collision detection plugin (replaces CUDA kernels)

Definition at line 108 of file LiDAR.cpp.

◆ reflectanceFilter()

void LiDARcloud::reflectanceFilter ( float  minreflectance)

Filter scan by imposing a minimum reflectance value.

Parameters
[in]minreflectanceMiniimum hit point reflectance value
Note
If ‘reflectance’ data was not provided for a hit point when calling LiDARcloud::addHitPoint(), the point will not be filtered.

Definition at line 1050 of file LiDAR.cpp.

◆ scalarFilter()

void LiDARcloud::scalarFilter ( const char *  scalar_field,
float  threshold,
const char *  comparator 
)

Filter hit points based on a scalar field given by a column in the ASCII data.

Parameters
[in]scalar_fieldName of a scalar field defined in the ASCII point cloud data (e.g., "reflectance")
[in]thresholdValue for filter threshold
[in]comparatorPoints will be filtered if "scalar (comparator) threshold", where (comparator) is one of ">", "<", or "="
Note
As an example, imagine we wanted to remove all hit points where the reflectance is less than -10. In this case we would call scalarFilter( "reflectance", -10, "<" );

Definition at line 1068 of file LiDAR.cpp.

◆ selfTest()

int LiDARcloud::selfTest ( int  argc = 0,
char **  argv = nullptr 
)
static

Self-test (unit test) function.

Definition at line 12 of file selfTest.cpp.

◆ setCellGtheta()

void LiDARcloud::setCellGtheta ( float  Gtheta,
uint  index 
)

Set the average G(theta) value of a grid cell.

Parameters
[in]GthetaG(theta) in cell.
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2686 of file LiDAR.cpp.

◆ setCellLeafArea()

void LiDARcloud::setCellLeafArea ( float  area,
uint  index 
)

Set the leaf area of a grid cell in m^2.

Parameters
[in]areaLeaf area in cell in m^2.
[in]indexIndex of a grid cell. Note: the index of a grid cell is given by the order in which it was added to the grid. E.g., the first cell's index is 0, and the last cell's index is Ncells-1.

Definition at line 2657 of file LiDAR.cpp.

◆ setHitData()

void LiDARcloud::setHitData ( uint  index,
const char *  label,
double  value 
)

Set floating point data value associated with a hit point.

Parameters
[in]indexHit number.
[in]labelLabel of the data value (e.g., "reflectance").
[in]valueValue of scalar data.

Definition at line 366 of file LiDAR.cpp.

◆ setHitGridCell()

void LiDARcloud::setHitGridCell ( uint  index,
int  cell 
)

Set the grid cell in which the hit point resides.

Parameters
[in]indexHit number
[in]cellCell number

Definition at line 451 of file LiDAR.cpp.

◆ syntheticScan() [1/8]

void LiDARcloud::syntheticScan ( helios::Context context)

Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)

Parameters
[in]contextPointer to the Helios context

Definition at line 4305 of file LiDAR.cpp.

◆ syntheticScan() [2/8]

void LiDARcloud::syntheticScan ( helios::Context context,
bool  append 
)

Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)

Parameters
[in]contextPointer to the Helios context
[in]appendIf true, new hit points are appended to existing data. If false, existing hit points are cleared before adding new ones.

Definition at line 4309 of file LiDAR.cpp.

◆ syntheticScan() [3/8]

void LiDARcloud::syntheticScan ( helios::Context context,
bool  scan_grid_only,
bool  record_misses 
)

Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]scan_grid_onlyIf true, only record hit points for rays that intersect the voxel grid.
[in]record_missesIf true, "miss" points (i.e., beam did not hit any primitives) are recorded in the scan.
Note
Calling syntheticScan() with scan_grid_only=true can save substantial memory for contexts with large domains.

Definition at line 4313 of file LiDAR.cpp.

◆ syntheticScan() [4/8]

void LiDARcloud::syntheticScan ( helios::Context context,
bool  scan_grid_only,
bool  record_misses,
bool  append 
)

Run a discrete return synthetic LiDAR scan based on scan parameters given in an XML file (returns only one laser hit per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]scan_grid_onlyIf true, only record hit points for rays that intersect the voxel grid.
[in]record_missesIf true, "miss" points (i.e., beam did not hit any primitives) are recorded in the scan.
[in]appendIf true, new hit points are appended to existing data. If false, existing hit points are cleared before adding new ones.
Note
Calling syntheticScan() with scan_grid_only=true can save substantial memory for contexts with large domains.

Definition at line 4317 of file LiDAR.cpp.

◆ syntheticScan() [5/8]

void LiDARcloud::syntheticScan ( helios::Context context,
int  rays_per_pulse,
float  pulse_distance_threshold 
)

Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]rays_per_pulseNumber of ray launches per laser pulse direction.
[in]pulse_distance_thresholdThreshold distance for determining laser hit locations. Hits within pulse_distance_threshold of each other will be grouped into a single hit.
Note
Calling syntheticScan() with rays_per_pulse=1 will effectively run a discrete return synthetic scan.

Definition at line 4321 of file LiDAR.cpp.

◆ syntheticScan() [6/8]

void LiDARcloud::syntheticScan ( helios::Context context,
int  rays_per_pulse,
float  pulse_distance_threshold,
bool  append 
)

Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]rays_per_pulseNumber of ray launches per laser pulse direction.
[in]pulse_distance_thresholdThreshold distance for determining laser hit locations. Hits within pulse_distance_threshold of each other will be grouped into a single hit.
[in]appendIf true, new hit points are appended to existing data. If false, existing hit points are cleared before adding new ones.
Note
Calling syntheticScan() with rays_per_pulse=1 will effectively run a discrete return synthetic scan.

Definition at line 4325 of file LiDAR.cpp.

◆ syntheticScan() [7/8]

void LiDARcloud::syntheticScan ( helios::Context context,
int  rays_per_pulse,
float  pulse_distance_threshold,
bool  scan_grid_only,
bool  record_misses 
)

Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]rays_per_pulseNumber of ray launches per laser pulse direction.
[in]pulse_distance_thresholdThreshold distance for determining laser hit locations. Hits within pulse_distance_threshold of each other will be grouped into a single hit.
[in]scan_grid_onlyIf true, only considers context geometry within the scan grid. scan_grid_only=true can save substantial memory for contexts with large domains.
[in]record_missesIf true, "miss" points (i.e., beam did not hit any primitives) are recorded in the scan.
Note
Calling syntheticScan() with rays_per_pulse=1 will effectively run a discrete return synthetic scan.

Definition at line 4329 of file LiDAR.cpp.

◆ syntheticScan() [8/8]

void LiDARcloud::syntheticScan ( helios::Context context,
int  rays_per_pulse,
float  pulse_distance_threshold,
bool  scan_grid_only,
bool  record_misses,
bool  append 
)

Run a full-waveform synthetic LiDAR scan based on scan parameters given in an XML file (returns multiple laser hits per pulse)

Parameters
[in]contextPointer to the Helios context.
[in]rays_per_pulseNumber of ray launches per laser pulse direction.
[in]pulse_distance_thresholdThreshold distance for determining laser hit locations. Hits within pulse_distance_threshold of each other will be grouped into a single hit.
[in]scan_grid_onlyIf true, only considers context geometry within the scan grid. scan_grid_only=true can save substantial memory for contexts with large domains.
[in]record_missesIf true, "miss" points (i.e., beam did not hit any primitives) are recorded in the scan.
[in]appendIf true, new hit points are appended to existing data. If false, existing hit points are cleared before adding new ones.
Note
Calling syntheticScan() with rays_per_pulse=1 will effectively run a discrete return synthetic scan.

Definition at line 4333 of file LiDAR.cpp.

◆ triangulateHitPoints() [1/2]

void LiDARcloud::triangulateHitPoints ( float  Lmax,
float  max_aspect_ratio 
)

Perform triangulation on all hit points in point cloud.

Parameters
[in]LmaxMaximum allowable length of triangle sides.
[in]max_aspect_ratioMaximum allowable aspect ratio of triangles.

Definition at line 1832 of file LiDAR.cpp.

◆ triangulateHitPoints() [2/2]

void LiDARcloud::triangulateHitPoints ( float  Lmax,
float  max_aspect_ratio,
const char *  scalar_field,
float  threshold,
const char *  comparator 
)

Perform triangulation on hit points in point cloud that meet some filtering criteria based on scalar data.

Parameters
[in]LmaxMaximum allowable length of triangle sides.
[in]max_aspect_ratioMaximum allowable aspect ratio of triangles.
[in]scalar_fieldName of a scalar field defined in the ASCII point cloud data (e.g., "deviation")
[in]thresholdValue for filter threshold
[in]comparatorPoints will not be used in triangulation if "scalar (comparator) threshold", where (comparator) is one of ">", "<", or "="
Note
As an example, imagine we wanted to remove all hit points where the deviation is greater than 15 for the purposes of the triangulation. In this case we would call triangulateHitPoints(Lmax, max_aspect_ratio, "deviation", 15, ">" );

Definition at line 2167 of file LiDAR.cpp.

◆ trunkReconstruction()

void LiDARcloud::trunkReconstruction ( const helios::vec3 box_center,
const helios::vec3 box_size,
float  Lmax,
float  max_aspect_ratio 
)

Reconstruct the trunk of the tree. In order to do this, you must specify the center and size of a rectangular box that encompasses the tree trunk. This routine will then try to find the largest continuous triangle group, which is assumed to correspond to the trunk.

Parameters
[in]box_center(x,y,z) coordinates of the center of a rectangular box that encompasses the tree trunk.
[in]box_sizeDimension of the trunk box in the x-, y-, and z- directions.
[in]Lmaxmaximum dimension of triangles (see also triangulateHitPoints()).
[in]max_aspect_ratioMaximum allowable aspect ratio of triangles (see also triangulateHitPoints())

◆ validateRayDirections()

void LiDARcloud::validateRayDirections ( )

Definition at line 158 of file LiDAR.cpp.

◆ xyzFilter() [1/2]

void LiDARcloud::xyzFilter ( float  xmin,
float  xmax,
float  ymin,
float  ymax,
float  zmin,
float  zmax 
)

overloaded version of xyzFilter that defaults to deleting points outside the provided bounding box

Parameters
[in]xminminimum x coordinate of bounding box
[in]xmaxmaximum x coordinate of bounding box
[in]yminminimum y coordinate of bounding box
[in]ymaxmaximum y coordinate of bounding box
[in]zminminimum z coordinate of bounding box
[in]zmaxmaximum z coordinate of bounding box
Note
points outside the provided bounding box are deleted by default

Definition at line 1098 of file LiDAR.cpp.

◆ xyzFilter() [2/2]

void LiDARcloud::xyzFilter ( float  xmin,
float  xmax,
float  ymin,
float  ymax,
float  zmin,
float  zmax,
bool  deleteOutside 
)

Filter scan with a bounding box.

Parameters
[in]xminminimum x coordinate of bounding box
[in]xmaxmaximum x coordinate of bounding box
[in]yminminimum y coordinate of bounding box
[in]ymaxmaximum y coordinate of bounding box
[in]zminminimum z coordinate of bounding box
[in]zmaxmaximum z coordinate of bounding box
[in]deleteOutsideif true, deletes points outside the bounding box, if false deletes points inside the bounding box
Note
points outside the provided bounding box are deleted

Definition at line 1103 of file LiDAR.cpp.


The documentation for this class was generated from the following files: