1.3.77
 
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 setProgressCallback (std::function< void(float, const std::string &)> callback)
 Register a callback to receive progress updates during syntheticScan.
 
void setCancelFlag (volatile int *flag)
 Register an external cancellation flag polled during long-running operations.
 
void setSyntheticScanProgressPointer (volatile int *ptr)
 Register an external counter for per-scan syntheticScan progress.
 
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.
 
uint addScanMoving (ScanMetadata scan, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec4 > &traj_quat, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float pulse_rate_hz, double t0=0.0)
 Add a moving-platform (mobile/airborne) LiDAR scan driven by a 6-DOF pose trajectory.
 
uint addScanMoving (ScanMetadata scan, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec3 > &traj_rpy, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float pulse_rate_hz, double t0=0.0)
 Add a moving-platform (mobile/airborne) LiDAR scan with the orientation trajectory given as Euler angles.
 
uint addScanSpinning (const std::vector< float > &beamElevationAngles, float azimuthStep_rad, float pulse_rate_hz, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec4 > &traj_quat, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float exitDiameter, float beamDivergence, float rangeNoiseStdDev, float angleNoiseStdDev, const std::vector< std::string > &columnFormat={"x", "y", "z"}, double t0=0.0)
 Add a continuously-spinning multibeam (Velodyne/Ouster/Hesai-style) scan driven by a 6-DOF platform trajectory.
 
uint addScanSpinning (const std::vector< float > &beamElevationAngles, float azimuthStep_rad, float pulse_rate_hz, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec3 > &traj_rpy, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float exitDiameter, float beamDivergence, float rangeNoiseStdDev, float angleNoiseStdDev, const std::vector< std::string > &columnFormat={"x", "y", "z"}, double t0=0.0)
 Add a continuously-spinning multibeam scan with the orientation trajectory given as Euler angles.
 
uint addScanMovingRaster (uint Ntheta, float thetaMin, float thetaMax, uint Nphi, float phiMin, float phiMax, float pulse_rate_hz, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec4 > &traj_quat, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float exitDiameter, float beamDivergence, float rangeNoiseStdDev, float angleNoiseStdDev, const std::vector< std::string > &columnFormat={"x", "y", "z"}, double t0=0.0)
 Add a moving-platform raster scan: a fixed uniform angular fan swept while the platform moves along a trajectory.
 
uint addScanRisley (const std::vector< RisleyPrism > &prisms, double refractive_index_air, float pulse_rate_hz, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec4 > &traj_quat, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float exitDiameter, float beamDivergence, float rangeNoiseStdDev, float angleNoiseStdDev, const std::vector< std::string > &columnFormat={"x", "y", "z"}, double t0=0.0)
 Add a rotating-Risley-prism (Livox-style rosette) scan from physical instrument parameters.
 
uint addScanRisley (const std::vector< RisleyPrism > &prisms, double refractive_index_air, float pulse_rate_hz, const std::vector< double > &traj_t, const std::vector< helios::vec3 > &traj_pos, const std::vector< helios::vec3 > &traj_rpy, const helios::vec3 &lever_arm, const helios::vec3 &boresight_rpy, float exitDiameter, float beamDivergence, float rangeNoiseStdDev, float angleNoiseStdDev, const std::vector< std::string > &columnFormat={"x", "y", "z"}, double t0=0.0)
 Add a rotating-Risley-prism (Livox-style rosette) scan with the orientation trajectory given as Euler angles.
 
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.
 
ScanPattern getScanPattern (uint scanID) const
 Get the geometric beam pattern of a scan.
 
std::vector< float > getScanBeamZenithAngles (uint scanID) const
 Get the per-channel zenith angles of a spinning multibeam scan.
 
ScanMode getScanMode (uint scanID) const
 Get the high-level acquisition-mode descriptor of a scan.
 
uint getScanStepsPerRev (uint scanID) const
 Get the number of azimuth firing steps per full 360-degree revolution of a spinning multibeam scan.
 
double getScanRotationRate (uint scanID) const
 Get the sensor-head rotation rate of a spinning multibeam scan.
 
double getScanRevolutions (uint scanID) const
 Get the total number of full 360-degree revolutions collected by a spinning multibeam scan.
 
std::vector< RisleyPrismgetScanRisleyPrisms (uint scanID) const
 Get the rotating wedge prisms of a Risley-prism (Livox-style rosette) scan.
 
double getScanRisleyRefractiveIndexAir (uint scanID) const
 Get the refractive index of the medium surrounding the prisms of a Risley-prism scan.
 
float getScanBeamDivergence (uint scanID) const
 Divergence angle of the laser beam in radians.
 
float getScanRangeNoiseStdDev (uint scanID) const
 Standard deviation of Gaussian range (along-beam) measurement noise in meters.
 
float getScanAngleNoiseStdDev (uint scanID) const
 Standard deviation of Gaussian angular (beam-pointing) jitter in radians.
 
ReturnMode getScanReturnMode (uint scanID) const
 Get the return-reporting mode of a scan.
 
void setScanReturnMode (uint scanID, ReturnMode returnMode)
 Set the return-reporting mode of a scan.
 
SingleReturnSelection getScanSingleReturnSelection (uint scanID) const
 Get the single-return selection policy of a scan.
 
void setScanSingleReturnSelection (uint scanID, SingleReturnSelection selection)
 Set the single-return selection policy of a scan.
 
int getScanMaxReturns (uint scanID) const
 Get the maximum number of returns reported per pulse in single/limited-return mode.
 
void setScanMaxReturns (uint scanID, int maxReturns)
 Set the maximum number of returns reported per pulse in single/limited-return mode.
 
float getScanPulseWidth (uint scanID) const
 Get the range resolution (transmit pulse range-extent) of a scan in meters.
 
void setScanPulseWidth (uint scanID, float pulseWidth)
 Set the range resolution (transmit pulse range-extent) of a scan in meters.
 
float getScanDetectionThreshold (uint scanID) const
 Get the detection threshold (minimum return energy fraction) of a scan.
 
void setScanDetectionThreshold (uint scanID, float detectionThreshold)
 Set the detection threshold (minimum return energy fraction) of a scan.
 
float getScanTiltRoll (uint scanID) const
 Get the global scanner tilt roll angle for a scan.
 
float getScanTiltPitch (uint scanID) const
 Get the global scanner tilt pitch angle for a scan.
 
float getScanAzimuthOffset (uint scanID) const
 Get the global scanner azimuth (heading) offset for a scan.
 
helios::vec3 getHitXYZ (uint index) const
 Get (x,y,z) coordinate of hit point by index.
 
helios::vec3 getHitOrigin (uint index) const
 Get the (x,y,z) origin from which the beam producing this hit point was emitted.
 
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.
 
int getHitDataColumnIndex (const char *label) const
 Get the internal column index for a hit-data label.
 
void getHitDataColumn (const char *label, std::vector< double > &data, double absent_value=-9999) const
 Bulk-read a per-hit scalar field across all hits into a contiguous array.
 
bool isHitMiss (uint index) const
 Determine whether a hit point is a "miss" (a fired pulse that returned nothing)
 
bool hasMisses () const
 Determine whether the point cloud contains any miss points.
 
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.
 
std::size_t getTriangulationCandidateCount () const
 
std::size_t getTriangulationDroppedByLmax () const
 
std::size_t getTriangulationDroppedByAspect () const
 
std::size_t getTriangulationDroppedByDegenerate () const
 
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 exportLeafAreaUncertainty (const char *filename)
 Export to file the per-voxel leaf-area inversion sampling uncertainty. Lines of the file correspond to each grid cell.
 
void exportPointCloud (const char *filename, bool write_header=true)
 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, bool write_header=true)
 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 exportScans (const char *filename)
 Export all scans in the point cloud to an XML metadata file plus one ASCII data file per scan.
 
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 multi-return 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 multi-return 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 multi-return 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 multi-return 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 setExternalTriangulation (const std::vector< helios::vec3 > &triangle_vertices, const std::vector< int > &scanIDs)
 Replace the internal triangulation with an externally-supplied world-space mesh.
 
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 rotation angle of a grid cell about the z-axis by its index.
 
void syntheticScan (helios::Context *context)
 Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning one laser hit per pulse.
 
void syntheticScan (helios::Context *context, bool append)
 Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning one laser hit per pulse.
 
void syntheticScan (helios::Context *context, bool scan_grid_only, bool record_misses)
 Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning one laser hit per pulse.
 
void syntheticScan (helios::Context *context, bool scan_grid_only, bool record_misses, bool append)
 Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning one laser hit per pulse.
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold)
 Run a multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning multiple laser hits per pulse.
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold, bool append)
 Run a multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning multiple laser hits per pulse.
 
void syntheticScan (helios::Context *context, int rays_per_pulse, float pulse_distance_threshold, ReturnMode return_mode, bool scan_grid_only=false, bool record_misses=false, bool append=true)
 Run a synthetic LiDAR scan with an explicit return-reporting mode (analytic-waveform processing)
 
void setSyntheticScanMemoryBudget (size_t bytes)
 Set the soft memory budget (in bytes) for the transient ray-tracing buffers used during syntheticScan.
 
size_t getSyntheticScanMemoryBudget () const
 Get the soft memory budget (in bytes) for the transient ray-tracing buffers used during syntheticScan.
 
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.
 
int getCellBeamCount (uint index) const
 Get the number of beams that entered a grid cell during the leaf-area inversion.
 
float getCellRelativeDensityIndex (uint index) const
 Get the relative density index of a grid cell.
 
float getCellMeanPathLength (uint index) const
 Get the mean beam path length through a grid cell in meters.
 
float getCellLADVariance (uint index) const
 Get the sampling variance of leaf area density for a grid cell.
 
bool getCellLeafAreaConfidenceInterval (uint index, float confidence_level, float &lower, float &upper) const
 Get the single-voxel sampling confidence interval on leaf area.
 
bool getGroupLADConfidenceInterval (const std::vector< uint > &indices, float confidence_level, float &mean_lad, float &lower, float &upper) const
 Get the group-scale sampling confidence interval on mean leaf area density - the recommended path.
 
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 forceBruteForceLeafArea (bool force)
 Test/diagnostic hook: force the leaf-area inversion to use the brute-force per-cell slab loop.
 
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 calculateLeafArea (helios::Context *context, int min_voxel_hits, float element_width)
 Calculate the leaf area for each grid volume, with element size for uncertainty estimation.
 
void calculateLeafArea (helios::Context *context, float Gtheta, int min_voxel_hits, float element_width)
 Calculate the leaf area for each grid volume using a caller-supplied G(theta), without requiring triangulation.
 
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)
 
bool isGPUAvailable () const
 Check whether a CUDA-capable GPU is available for acceleration.
 
bool isGPUAccelerationEnabled () const
 Check whether GPU acceleration is currently enabled.
 
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.
 
static float applyRangeIntensityCorrection (float intensity, float distance)
 Normalize a synthetic return intensity for range.
 

Static Public Attributes

static constexpr float LIDAR_MISS_DISTANCE = 20000.f
 Distance (m) at which a "miss" point is placed along its beam direction.
 
static constexpr float LIDAR_RAYTRACE_MISS_T = 1001.f
 Ray-tracer "no hit" parameter (m): the maximum ray length passed to the backend.
 

Detailed Description

Primary class for terrestrial LiDAR scan.

Definition at line 659 of file LiDAR.h.

Constructor & Destructor Documentation

◆ LiDARcloud()

LiDARcloud::LiDARcloud ( )

LiDAR point cloud constructor.

Definition at line 503 of file LiDAR.cpp.

◆ ~LiDARcloud()

LiDARcloud::~LiDARcloud ( void  )

LiDAR point cloud destructor.

Definition at line 516 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 1781 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 4170 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 4166 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 1696 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 1821 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 989 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 1008 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 1620 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 1638 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 1624 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 1936 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 1940 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 1852 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 1980 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 684 of file LiDAR.cpp.

◆ addScanMoving() [1/2]

uint LiDARcloud::addScanMoving ( ScanMetadata  scan,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec3 > &  traj_rpy,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  pulse_rate_hz,
double  t0 = 0.0 
)

Add a moving-platform (mobile/airborne) LiDAR scan with the orientation trajectory given as Euler angles.

Convenience overload of addScanMoving() that takes the per-sample platform orientation as roll/pitch/yaw Euler angles (radians) instead of quaternions. Each traj_rpy entry is converted to a Hamilton body->world quaternion using the same intrinsic Z-Y-X (yaw-pitch-roll) convention as boresight_rpy, then the scan is registered exactly as the quaternion overload. Use this when hand-authoring a trajectory; prefer the quaternion overload when the trajectory comes from an INS/IMU that natively reports quaternions (avoids a round-trip through Euler angles and the associated gimbal-lock ambiguity).

Parameters
[in]scanScan metadata defining the angular sampling grid and beam parameters (origin is ignored; the trajectory supplies position).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_rpyPlatform orientations as roll/pitch/yaw Euler angles in radians (intrinsic Z-Y-X), one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]pulse_rate_hzPulse repetition rate in Hz (must be > 0); sets the time between consecutive pulses.
[in]t0Time of the first pulse in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 780 of file LiDAR.cpp.

◆ addScanMoving() [2/2]

uint LiDARcloud::addScanMoving ( ScanMetadata  scan,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec4 > &  traj_quat,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  pulse_rate_hz,
double  t0 = 0.0 
)

Add a moving-platform (mobile/airborne) LiDAR scan driven by a 6-DOF pose trajectory.

Registers a scan whose scanner pose changes during the sweep. The synthetic scan generator (see syntheticScan()) computes, for each pulse, its acquisition time \(t = t_0 + \mathrm{ordinal}\cdot \mathrm{pulse\_period}\) (where pulse_period = 1/pulse_rate_hz and the ordinal is the pulse's position in the scan-grid firing sequence), interpolates the platform pose at that time via ScanMetadata::poseAt(), and emits a per-pulse origin \(\mathbf{o} = \mathbf{pos} + R(\mathbf{q})\,\mathbf{lever\_arm}\) and direction \(\mathbf{d} = R(\mathbf{q})\,R(\mathbf{boresight})\,\mathbf{d}_{body}\). Every resulting hit and miss stores its own origin (data labels "origin_x"/"origin_y"/"origin_z"), real timestamp ("timestamp"), and firing index ("pulse_id"). The static ScanMetadata::scanTilt_roll / scanTilt_pitch / scanTilt_azimuth fields are not applied in this mode and must be zero (attitude is defined entirely by traj_quat and boresight_rpy).

Parameters
[in]scanScan metadata defining the angular sampling grid and beam parameters (origin is ignored; the trajectory supplies position).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_quatPlatform orientation quaternions (qx,qy,qz,qw), Hamilton body->world, one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]pulse_rate_hzPulse repetition rate in Hz (must be > 0); sets the time between consecutive pulses.
[in]t0Time of the first pulse in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 719 of file LiDAR.cpp.

◆ addScanMovingRaster()

uint LiDARcloud::addScanMovingRaster ( uint  Ntheta,
float  thetaMin,
float  thetaMax,
uint  Nphi,
float  phiMin,
float  phiMax,
float  pulse_rate_hz,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec4 > &  traj_quat,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  exitDiameter,
float  beamDivergence,
float  rangeNoiseStdDev,
float  angleNoiseStdDev,
const std::vector< std::string > &  columnFormat = {"x", "y", "z"},
double  t0 = 0.0 
)

Add a moving-platform raster scan: a fixed uniform angular fan swept while the platform moves along a trajectory.

Convenience wrapper around addScanMoving() for a non-spinning sensor on a moving platform. The caller specifies the per-frame angular fan resolution (Ntheta x Nphi over [thetaMin,thetaMax] x [phiMin,phiMax]) plus the trajectory and PRF, and Helios derives the per-pulse time sampling along the trajectory (t = t0 + ordinal/pulse_rate_hz). Unlike the low-level addScanMoving(), the caller does not pre-build a Scan metadata or compute pulse counts to make the sweep span the flight. Sets the scan's ScanMode to SCAN_MODE_MOVING_RASTER.

Parameters
[in]NthetaNumber of zenith samples in the angular fan.
[in]thetaMinMinimum zenith angle in radians.
[in]thetaMaxMaximum zenith angle in radians.
[in]NphiNumber of azimuth samples in the angular fan.
[in]phiMinMinimum azimuth angle in radians.
[in]phiMaxMaximum azimuth angle in radians.
[in]pulse_rate_hzPulse repetition rate (PRF) in Hz (must be > 0).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_quatPlatform orientation quaternions (qx,qy,qz,qw), Hamilton body->world, one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]exitDiameterDiameter of the laser pulse at exit from the scanner in meters.
[in]beamDivergenceDivergence angle of the laser beam in radians.
[in]rangeNoiseStdDevStandard deviation of Gaussian range (along-beam) measurement noise in meters (0 disables).
[in]angleNoiseStdDevStandard deviation of Gaussian angular (beam-pointing) jitter in radians (0 disables).
[in]columnFormatVector of strings specifying the columns of the scan ASCII file for input/output.
[in]t0Time of the first pulse (pulse ordinal 0) in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 883 of file LiDAR.cpp.

◆ addScanRisley() [1/2]

uint LiDARcloud::addScanRisley ( const std::vector< RisleyPrism > &  prisms,
double  refractive_index_air,
float  pulse_rate_hz,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec3 > &  traj_rpy,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  exitDiameter,
float  beamDivergence,
float  rangeNoiseStdDev,
float  angleNoiseStdDev,
const std::vector< std::string > &  columnFormat = {"x", "y", "z"},
double  t0 = 0.0 
)

Add a rotating-Risley-prism (Livox-style rosette) scan with the orientation trajectory given as Euler angles.

Convenience overload of addScanRisley() that takes the per-sample platform orientation as roll/pitch/yaw Euler angles (radians, intrinsic Z-Y-X) instead of quaternions; it converts each to a quaternion and delegates to the quaternion overload.

Parameters
[in]prismsRotating wedge prisms in the order the beam passes through them (see RisleyPrism).
[in]refractive_index_airRefractive index of the medium surrounding the prisms (typically 1.0 for air).
[in]pulse_rate_hzPulse repetition rate (PRF) in Hz (must be > 0).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_rpyPlatform orientations as roll/pitch/yaw Euler angles in radians, one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]exitDiameterDiameter of the laser pulse at exit from the scanner in meters.
[in]beamDivergenceDivergence angle of the laser beam in radians.
[in]rangeNoiseStdDevStandard deviation of Gaussian range (along-beam) measurement noise in meters (0 disables).
[in]angleNoiseStdDevStandard deviation of Gaussian angular (beam-pointing) jitter in radians (0 disables).
[in]columnFormatVector of strings specifying the columns of the scan ASCII file for input/output.
[in]t0Time of the first pulse (pulse ordinal 0) in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 972 of file LiDAR.cpp.

◆ addScanRisley() [2/2]

uint LiDARcloud::addScanRisley ( const std::vector< RisleyPrism > &  prisms,
double  refractive_index_air,
float  pulse_rate_hz,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec4 > &  traj_quat,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  exitDiameter,
float  beamDivergence,
float  rangeNoiseStdDev,
float  angleNoiseStdDev,
const std::vector< std::string > &  columnFormat = {"x", "y", "z"},
double  t0 = 0.0 
)

Add a rotating-Risley-prism (Livox-style rosette) scan from physical instrument parameters.

Sets up a non-repetitive rosette scan produced by a stack of continuously rotating wedge prisms (the optical mechanism used by Livox rosette-pattern sensors such as the Mid-40, Mid-70, and Avia). Each pulse fires a single beam that is refracted through the rotating prisms; with the prisms rotating at different (and generally incommensurate) rates the beam traces a non-repetitive pattern that fills a circular field of view, denser toward the center. The body-frame beam direction of each pulse is computed by full Snell's-law refraction through the prisms at that pulse's time, then composed with the boresight and platform-trajectory orientation exactly as in addScanMoving(). The scan is stored as an Ntheta=1, Nphi=Npulses table (one direction per pulse), where Npulses = round(pulse_rate_hz * trajectory_duration). The ScanPattern is set to SCAN_PATTERN_RISLEY_PRISM and the ScanMode to SCAN_MODE_RISLEY_PRISM.

Like a spinning scan, a Risley-prism scan is always trajectory-driven. A stationary capture (e.g. on a tripod) is expressed as a trajectory of two coincident poses with the same position and orientation, separated in time by the desired acquisition duration; the duration determines how many pulses (and how much of the rosette) are collected.

Note
Only the rotating-Risley-prism rosette mechanism is modeled. Livox's deterministic line-scan mode and the newer non-Risley (MEMS/galvanometer) non-repetitive patterns are different mechanisms not covered by this entry point.
The field of view is an emergent property of the prism wedge angles and refractive indices; it is not specified directly. The beam direction is computed by non-paraxial ray tracing through the rotating wedges (vector-form Snell's law at each face).
Parameters
[in]prismsRotating wedge prisms in the order the beam passes through them (see RisleyPrism). At least one is required; a Livox sensor uses two counter-rotating prisms.
[in]refractive_index_airRefractive index of the medium surrounding the prisms (typically 1.0 for air).
[in]pulse_rate_hzPulse repetition rate (PRF) in Hz (must be > 0).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_quatPlatform orientation quaternions (qx,qy,qz,qw), Hamilton body->world, one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]exitDiameterDiameter of the laser pulse at exit from the scanner in meters.
[in]beamDivergenceDivergence angle of the laser beam in radians.
[in]rangeNoiseStdDevStandard deviation of Gaussian range (along-beam) measurement noise in meters (0 disables).
[in]angleNoiseStdDevStandard deviation of Gaussian angular (beam-pointing) jitter in radians (0 disables).
[in]columnFormatVector of strings specifying the columns of the scan ASCII file for input/output.
[in]t0Time of the first pulse (pulse ordinal 0) in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 896 of file LiDAR.cpp.

◆ addScanSpinning() [1/2]

uint LiDARcloud::addScanSpinning ( const std::vector< float > &  beamElevationAngles,
float  azimuthStep_rad,
float  pulse_rate_hz,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec3 > &  traj_rpy,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  exitDiameter,
float  beamDivergence,
float  rangeNoiseStdDev,
float  angleNoiseStdDev,
const std::vector< std::string > &  columnFormat = {"x", "y", "z"},
double  t0 = 0.0 
)

Add a continuously-spinning multibeam scan with the orientation trajectory given as Euler angles.

Convenience overload of addScanSpinning() that takes the per-sample platform orientation as roll/pitch/yaw Euler angles (radians, intrinsic Z-Y-X) instead of quaternions. Each traj_rpy entry is converted to a Hamilton body->world quaternion, then the scan is registered exactly as the quaternion overload.

Parameters
[in]beamElevationAnglesPer-channel beam elevation angles above the horizon, in radians.
[in]azimuthStep_radAzimuth angular resolution in radians per firing step. Must be > 0.
[in]pulse_rate_hzPulse repetition rate (PRF) in Hz (must be > 0).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_rpyPlatform orientations as roll/pitch/yaw Euler angles in radians (intrinsic Z-Y-X), one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]exitDiameterDiameter of the laser pulse at exit from the scanner in meters.
[in]beamDivergenceDivergence angle of the laser beam in radians.
[in]rangeNoiseStdDevStandard deviation of Gaussian range (along-beam) measurement noise in meters (0 disables).
[in]angleNoiseStdDevStandard deviation of Gaussian angular (beam-pointing) jitter in radians (0 disables).
[in]columnFormatVector of strings specifying the columns of the scan ASCII file for input/output.
[in]t0Time of the first pulse (pulse ordinal 0) in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 866 of file LiDAR.cpp.

◆ addScanSpinning() [2/2]

uint LiDARcloud::addScanSpinning ( const std::vector< float > &  beamElevationAngles,
float  azimuthStep_rad,
float  pulse_rate_hz,
const std::vector< double > &  traj_t,
const std::vector< helios::vec3 > &  traj_pos,
const std::vector< helios::vec4 > &  traj_quat,
const helios::vec3 lever_arm,
const helios::vec3 boresight_rpy,
float  exitDiameter,
float  beamDivergence,
float  rangeNoiseStdDev,
float  angleNoiseStdDev,
const std::vector< std::string > &  columnFormat = {"x", "y", "z"},
double  t0 = 0.0 
)

Add a continuously-spinning multibeam (Velodyne/Ouster/Hesai-style) scan driven by a 6-DOF platform trajectory.

Sets up a rotating multi-channel sensor from its physical instrument parameters; Helios derives the internal sampling grid, rotation rate, and revolution count rather than requiring the caller to hand-flatten them into an Ntheta x Nphi grid. A spinning sensor rotates continuously through 360 degrees while the platform moves along the trajectory, so there is no partial-arc azimuth range: the only azimuth control is the angular resolution (azimuthStep_rad). The number of points is dictated by the pulse repetition rate and the total trajectory duration: n_pulses = pulse_rate_hz * (traj_t.back() - traj_t.front()), distributed across the channels and the derived number of azimuth steps.

From the physical parameters Helios derives: steps_per_rev = round(2*pi / azimuthStep_rad); rotation_rate = pulse_rate_hz / (channels * steps_per_rev); n_revolutions = rotation_rate * duration; Nphi = round(steps_per_rev * n_revolutions); Ntheta = number of channels. The per-pulse timestamp, origin, and orientation are produced exactly as in addScanMoving(), and each pulse fires at the EXACT per-channel elevation (not a resampled uniform grid).

Note
This is the only way to set up a spinning scan. A stationary "spin in place" capture (e.g. a tripod) is expressed as a trajectory of two coincident poses with the same position and orientation, separated in time by the desired acquisition duration; the duration determines the number of revolutions, exactly as for a moving capture.
Parameters
[in]beamElevationAnglesPer-channel beam elevation angles above the horizon, in radians (zenith = pi/2 - elevation). Its size sets the channel count.
Note
This is ELEVATION, unlike the zenith-angle Scan metadata spinning constructor.
Parameters
[in]azimuthStep_radAzimuth angular resolution in radians per firing step (e.g. 0.2 degrees = 0.2*pi/180). Must be > 0.
[in]pulse_rate_hzPulse repetition rate (PRF) in Hz (must be > 0).
[in]traj_tMonotonically increasing trajectory sample times in seconds (size M).
[in]traj_posPlatform positions in world coordinates, one per traj_t entry (size M).
[in]traj_quatPlatform orientation quaternions (qx,qy,qz,qw), Hamilton body->world, one per traj_t entry (size M).
[in]lever_armSensor optical center in the platform body frame (meters).
[in]boresight_rpyFixed sensor rotational misalignment as roll/pitch/yaw in radians (body frame).
[in]exitDiameterDiameter of the laser pulse at exit from the scanner in meters.
[in]beamDivergenceDivergence angle of the laser beam in radians.
[in]rangeNoiseStdDevStandard deviation of Gaussian range (along-beam) measurement noise in meters (0 disables).
[in]angleNoiseStdDevStandard deviation of Gaussian angular (beam-pointing) jitter in radians (0 disables).
[in]columnFormatVector of strings specifying the columns of the scan ASCII file for input/output.
[in]t0Time of the first pulse (pulse ordinal 0) in seconds (relative time; defaults to 0).
Returns
ID for scan that was created

Definition at line 798 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 4145 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 1749 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 1764 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 2010 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 1900 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 1919 of file LiDAR.cpp.

◆ applyRangeIntensityCorrection()

float LiDARcloud::applyRangeIntensityCorrection ( float  intensity,
float  distance 
)
static

Normalize a synthetic return intensity for range.

Helios reports range-normalized intensity: the range-independent return amplitude \(\rho\,\cos\theta\) (per-primitive reflectivity times the incidence-angle cosine), as if the geometric \(1/R^2\) loss of the LiDAR range equation had been measured and then divided back out ( \((\rho\,\cos\theta/R^2)\cdot R^2 = \rho\,\cos\theta\)). Two identical surfaces at different ranges therefore return the same intensity. Because syntheticScan() generates intensity directly as \(\rho\,\cos\theta\) without ever applying the \(1/R^2\) loss, this normalization is the identity on the value; the helper exists to make the convention explicit and is the single place to change should the raw (range-dependent) convention be wanted instead. Partial-footprint attenuation of sub-footprint returns (in multi-return mode) is carried separately by the fraction of beam sub-rays that strike the target and is deliberately preserved, as it reflects a target property rather than a range-geometry loss.

Parameters
[in]intensityReturn intensity ( \(\rho\,\cos\theta\)).
[in]distanceMeasured range from the scanner to the return, in meters (accepted for interface symmetry and future raw-mode use).
Returns
Range-normalized intensity.

Definition at line 604 of file LiDAR.cpp.

◆ calculateHitGridCell()

void LiDARcloud::calculateHitGridCell ( )

Determine which grid cell each hit point resides in.

Definition at line 6001 of file LiDAR.cpp.

◆ calculateLeafArea() [1/4]

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

Calculate the leaf area for each grid volume.

Parameters
[in]contextPointer to the Helios context
Note
Requires that the point cloud contains miss points (transmitted beams); see hasMisses() and gapfillMisses(). Throws if no misses are present.

Definition at line 5265 of file LiDAR.cpp.

◆ calculateLeafArea() [2/4]

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

Calculate the leaf area for each grid volume using a caller-supplied G(theta), without requiring triangulation.

Beam-based leaf-area inversion for scans that cannot be triangulated - in particular moving-platform (mobile/airborne) scans (see addScanMoving()), whose pulses do not lie on a fixed theta-phi grid and so cannot be Delaunay-triangulated. Triangulation is normally required only to estimate the per-voxel mean leaf-projection coefficient G(theta); this overload takes G(theta) directly instead, so it does NOT require triangulateHitPoints() to have been called.

The inversion uses the per-pulse beam origin recorded on each hit (see getHitOrigin()) when classifying beams against voxels, so it is geometrically correct for a scanner that moved during acquisition. For a static scan the per-hit origin equals the scan origin, so this overload also works (with a supplied G(theta)) there.

Parameters
[in]contextPointer to the Helios context
[in]GthetaMean leaf-projection coefficient G(theta), applied to every voxel. Must be in (0,1]. Use 0.5 for a spherical (random) leaf-angle distribution; supply a measured/assumed value otherwise.
[in]min_voxel_hitsMinimum number of allowable LiDAR hits per voxel
[in]element_widthCharacteristic vegetation element width [m]; see the three-argument overload. Pass <= 0 to report sampling-only uncertainty.
Note
Requires miss points (transmitted beams), like the other overloads; supply a miss-retaining scan format or call gapfillMisses() first.

Definition at line 5281 of file LiDAR.cpp.

◆ calculateLeafArea() [3/4]

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
Note
Requires that the point cloud contains miss points (transmitted beams), which count the beams transmitted through each voxel for the transmission-probability inversion. Supply them via a miss-retaining scan format or gapfillMisses(); throws (fail-fast) if no misses are present. Misses are identified by the per-hit is_miss flag (see isHitMiss()). Handles single- and multi-return data with a unified beam-based equal-weighting algorithm.

Definition at line 5269 of file LiDAR.cpp.

◆ calculateLeafArea() [4/4]

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

Calculate the leaf area for each grid volume, with element size for uncertainty estimation.

Parameters
[in]contextPointer to the Helios context
[in]min_voxel_hitsMinimum number of allowable LiDAR hits per voxel
[in]element_widthCharacteristic vegetation element width [m] (e.g. mean leaf width), used by the per-voxel LAD sampling-uncertainty estimate (the element-position variance term; Pimont et al. 2018, Appendix A). Pass a value <= 0 to omit that term and report SAMPLING-ONLY uncertainty. The leaf-area point estimate is identical regardless of this argument.
Note
Requires miss points; see the two-argument overload. After calling, per-voxel sampling uncertainty is available via getCellLADVariance, getCellBeamCount, getCellLeafAreaConfidenceInterval, and getGroupLADConfidenceInterval.

Definition at line 5276 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 5971 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 5975 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 4213 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 6186 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 1548 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]rotationRotation angle in radians
[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 1579 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 1562 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 1520 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 1532 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 4936 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 1081 of file LiDAR.cpp.

◆ disableGPUAcceleration()

void LiDARcloud::disableGPUAcceleration ( )

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

Definition at line 5985 of file LiDAR.cpp.

◆ disableMessages()

void LiDARcloud::disableMessages ( )

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

Definition at line 520 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 2112 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 1398 of file LiDAR.cpp.

◆ enableGPUAcceleration()

void LiDARcloud::enableGPUAcceleration ( )

Enable GPU acceleration in CollisionDetection plugin.

Definition at line 5979 of file LiDAR.cpp.

◆ enableMessages()

void LiDARcloud::enableMessages ( )

Enable all print messages to the screen.

Definition at line 621 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 1308 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 1288 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 1268 of file fileIO.cpp.

◆ exportLeafAreaUncertainty()

void LiDARcloud::exportLeafAreaUncertainty ( const char *  filename)

Export to file the per-voxel leaf-area inversion sampling uncertainty. Lines of the file correspond to each grid cell.

Columns: cell_index leaf_area beam_count I_rdi LAD_std_error ci_valid. The standard error column reports the SAMPLING standard error of LAD [1/m] (sqrt of the per-voxel variance); undefined values are written as the sentinel -1. This is statistical sampling uncertainty conditional on the beams that entered each voxel and does NOT capture occlusion/coverage bias.

Parameters
[in]filenameName of file

Definition at line 1328 of file fileIO.cpp.

◆ exportPointCloud() [1/2]

void LiDARcloud::exportPointCloud ( const char *  filename,
bool  write_header = true 
)

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
[in]write_header[optional] If true (default), a leading comment line beginning with '#' that lists the column field names is written at the top of each file. The loader ignores '#' comment lines, so headered files round-trip through loadXML().
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 1353 of file fileIO.cpp.

◆ exportPointCloud() [2/2]

void LiDARcloud::exportPointCloud ( const char *  filename,
uint  scanID,
bool  write_header = true 
)

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
[in]write_header[optional] If true (default), a leading comment line beginning with '#' that lists the column field names is written at the top of the file. The loader ignores '#' comment lines, so headered files round-trip through loadXML().

Definition at line 1379 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 1744 of file fileIO.cpp.

◆ exportScans()

void LiDARcloud::exportScans ( const char *  filename)

Export all scans in the point cloud to an XML metadata file plus one ASCII data file per scan.

Parameters
[in]filenameName of the XML metadata file to write (e.g. "output/scans.xml")
Note
One ASCII point cloud data file is auto-generated per scan, named by stripping the extension of filename and appending "_\<scanID>.xyz". For example, passing "output/scans.xml" with three scans produces "output/scans_0.xyz", "output/scans_1.xyz", and "output/scans_2.xyz" alongside the XML. The ASCII column format follows the per-scan <ASCII_format></ASCII_format> tag, and the XML output can be re-loaded with LiDARcloud::loadXML() when invoked from the same working directory used at export time.

Definition at line 1527 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 1091 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 1113 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 1199 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 1138 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 1030 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 1059 of file fileIO.cpp.

◆ firstHitFilter()

void LiDARcloud::firstHitFilter ( )

Filter multi-return 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 multi-return 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 2429 of file LiDAR.cpp.

◆ forceBruteForceLeafArea()

void LiDARcloud::forceBruteForceLeafArea ( bool  force)
inline

Test/diagnostic hook: force the leaf-area inversion to use the brute-force per-cell slab loop.

By default calculateLeafArea() uses a fast per-beam 3D-DDA traversal of the voxel lattice. When this is set true, the slower brute-force per-cell path is used instead (it produces identical results). This exists so the self-tests can verify the two paths agree; it is not needed in normal use.

Parameters
[in]forceTrue to force the brute-force path, false (default) to use the fast DDA path when applicable.

Definition at line 2477 of file LiDAR.h.

◆ 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 2707 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 2716 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 2720 of file LiDAR.cpp.

◆ getCellBeamCount()

int LiDARcloud::getCellBeamCount ( uint  index) const

Get the number of beams that entered a grid cell during the leaf-area inversion.

Parameters
[in]indexIndex of a grid cell.
Returns
Beam count N, or -1 if calculateLeafArea() has not been run for this cell.

Definition at line 4326 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 4177 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 4186 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 4317 of file LiDAR.cpp.

◆ getCellLADVariance()

float LiDARcloud::getCellLADVariance ( uint  index) const

Get the sampling variance of leaf area density for a grid cell.

Parameters
[in]indexIndex of a grid cell.
Returns
Sampling variance of LAD in (1/m)^2, or -1 if undefined (too few beams, etc.).

Definition at line 4354 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 4288 of file LiDAR.cpp.

◆ getCellLeafAreaConfidenceInterval()

bool LiDARcloud::getCellLeafAreaConfidenceInterval ( uint  index,
float  confidence_level,
float &  lower,
float &  upper 
) const

Get the single-voxel sampling confidence interval on leaf area.

Returns the interval centered on the cell's leaf-area point estimate. Returns false (no interval written) when the voxel falls outside the Pimont (2018) Table-3 validity envelope, rather than emitting an untrustworthy interval.

Parameters
[in]indexIndex of a grid cell.
[in]confidence_levelConfidence level in (0,1), e.g. 0.95.
[out]lowerLower bound of the leaf-area confidence interval [m^2].
[out]upperUpper bound of the leaf-area confidence interval [m^2].
Returns
True if a valid confidence interval was produced, false otherwise.

Definition at line 4363 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 4297 of file LiDAR.cpp.

◆ getCellMeanPathLength()

float LiDARcloud::getCellMeanPathLength ( uint  index) const

Get the mean beam path length through a grid cell in meters.

Parameters
[in]indexIndex of a grid cell.
Returns
Mean per-beam path length through the voxel [m].

Definition at line 4344 of file LiDAR.cpp.

◆ getCellRelativeDensityIndex()

float LiDARcloud::getCellRelativeDensityIndex ( uint  index) const

Get the relative density index of a grid cell.

The relative density index is RDI = 1 - P, where P is the transmission probability.

Parameters
[in]indexIndex of a grid cell.
Returns
RDI between 0 and 1 (the fraction of beams intercepted within the voxel).

Definition at line 4335 of file LiDAR.cpp.

◆ getCellRotation()

float LiDARcloud::getCellRotation ( uint  index) const

Get the rotation angle of a grid cell about the z-axis 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.
Returns
Rotation angle of the cell about the z-axis, in radians.

Definition at line 4204 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 4195 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 2068 of file LiDAR.cpp.

◆ getGridCellCount()

uint LiDARcloud::getGridCellCount ( void  ) const

Get the number of cells in the grid.

Definition at line 4162 of file LiDAR.cpp.

◆ getGroupLADConfidenceInterval()

bool LiDARcloud::getGroupLADConfidenceInterval ( const std::vector< uint > &  indices,
float  confidence_level,
float &  mean_lad,
float &  lower,
float &  upper 
) const

Get the group-scale sampling confidence interval on mean leaf area density - the recommended path.

Computes the confidence interval on the mean LAD over a set of voxels, assuming voxel independence (Pimont et al. 2018, Eq. 39): mean_LAD +- z * sqrt(sum(sigma^2)) / n_v. Voxels outside the Table-3 validity envelope are skipped (not counted in n_v).

Parameters
[in]indicesIndices of the grid cells in the group.
[in]confidence_levelConfidence level between 0 and 1, e.g. 0.95.
[out]mean_ladMean leaf area density over the valid voxels in the group, in 1/m.
[out]lowerLower bound of the mean-LAD confidence interval, in 1/m.
[out]upperUpper bound of the mean-LAD confidence interval, in 1/m.
Returns
True if at least one valid voxel contributed and an interval was produced.

Definition at line 4396 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 2033 of file LiDAR.cpp.

◆ getHitColor()

RGBcolor LiDARcloud::getHitColor ( uint  index) const

Get color of hit point.

Parameters
[in]indexHit number

Definition at line 1443 of file LiDAR.cpp.

◆ getHitCount()

uint LiDARcloud::getHitCount ( ) const

Get the number of hit points in the point cloud.

Definition at line 1103 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 1382 of file LiDAR.cpp.

◆ getHitDataColumn()

void LiDARcloud::getHitDataColumn ( const char *  label,
std::vector< double > &  data,
double  absent_value = -9999 
) const

Bulk-read a per-hit scalar field across all hits into a contiguous array.

This is the fast path for extracting a whole scalar field from a large cloud: it is a single cache-linear pass over the field's storage column, equivalent in cost to getHitXYZ over all hits, rather than N separate getHitData lookups. The output has one entry per hit, in hit-index order; hits that have no value for the label receive absent_value.

Parameters
[in]labelLabel of the data value (e.g., "intensity").
[out]dataFilled with one value per hit (resized to getHitCount()).
[in]absent_valueValue written for hits that lack the label (default -9999, matching the sentinel used by ASCII export).

Definition at line 1416 of file LiDAR.cpp.

◆ getHitDataColumnIndex()

int LiDARcloud::getHitDataColumnIndex ( const char *  label) const

Get the internal column index for a hit-data label.

Per-hit scalar data is stored column-wise (see getHitDataColumn()). This returns the column slot for a label, which is useful for repeated bulk access without re-resolving the label.

Parameters
[in]labelLabel of the data value (e.g., "intensity").
Returns
Column index for the label, or -1 if the label has never been set on any hit.

Definition at line 1408 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 1479 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 1461 of file LiDAR.cpp.

◆ getHitOrigin()

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

Get the (x,y,z) origin from which the beam producing this hit point was emitted.

For moving-platform scans (see addScanMoving()) each hit stores its own per-pulse emission origin in the data labels "origin_x"/"origin_y"/"origin_z"; this function returns that origin. For static scans (which store no per-hit origin) it falls back to the single scan origin getScanOrigin() of the hit's scan.

Parameters
[in]indexHit number
Returns
(x,y,z) world-coordinate origin of the beam that produced this hit.

Definition at line 1342 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 1357 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 1452 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 1333 of file LiDAR.cpp.

◆ getScanAngleNoiseStdDev()

float LiDARcloud::getScanAngleNoiseStdDev ( uint  scanID) const

Standard deviation of Gaussian angular (beam-pointing) jitter in radians.

Parameters
[in]scanIDID of scan.
Returns
Standard deviation of the beam-pointing jitter applied during synthetic scan generation, in radians (0 if disabled).

Definition at line 1163 of file LiDAR.cpp.

◆ getScanAzimuthOffset()

float LiDARcloud::getScanAzimuthOffset ( uint  scanID) const

Get the global scanner azimuth (heading) offset for a scan.

Parameters
[in]scanIDID of scan.
Returns
Scanner azimuth offset (right-hand rotation about the world z-axis) applied during synthetic scan generation, in radians (0 if none).

Definition at line 1263 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, in radians.

Definition at line 1149 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 1142 of file LiDAR.cpp.

◆ getScanBeamZenithAngles()

std::vector< float > LiDARcloud::getScanBeamZenithAngles ( uint  scanID) const

Get the per-channel zenith angles of a spinning multibeam scan.

Parameters
[in]scanIDID of scan.
Returns
Vector of per-channel zenith angles in radians (one per row). Empty for a SCAN_PATTERN_RASTER scan.

Definition at line 1284 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 1270 of file LiDAR.cpp.

◆ getScanCount()

uint LiDARcloud::getScanCount ( )

Get number of scans in point cloud.

Definition at line 680 of file LiDAR.cpp.

◆ getScanDetectionThreshold()

float LiDARcloud::getScanDetectionThreshold ( uint  scanID) const

Get the detection threshold (minimum return energy fraction) of a scan.

Parameters
[in]scanIDID of scan.
Returns
Minimum return energy fraction below which a return is discarded (0 if suppression is disabled).

Definition at line 1232 of file LiDAR.cpp.

◆ getScanMaxReturns()

int LiDARcloud::getScanMaxReturns ( uint  scanID) const

Get the maximum number of returns reported per pulse in single/limited-return mode.

Parameters
[in]scanIDID of scan.
Returns
Maximum returns per pulse used when getScanReturnMode is RETURN_MODE_SINGLE (1 = single-return, 2 = dual-return, N = N-return). Ignored in RETURN_MODE_MULTI.

Definition at line 1198 of file LiDAR.cpp.

◆ getScanMode()

ScanMode LiDARcloud::getScanMode ( uint  scanID) const

Get the high-level acquisition-mode descriptor of a scan.

Parameters
[in]scanIDID of scan.
Returns
SCAN_MODE_STATIC_RASTER, SCAN_MODE_MOVING_RASTER, SCAN_MODE_SPINNING, or SCAN_MODE_RISLEY_PRISM.

Definition at line 1291 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 1107 of file LiDAR.cpp.

◆ getScanPattern()

ScanPattern LiDARcloud::getScanPattern ( uint  scanID) const

Get the geometric beam pattern of a scan.

Parameters
[in]scanIDID of scan.
Returns
SCAN_PATTERN_RASTER for a uniform angular grid, or SCAN_PATTERN_SPINNING_MULTIBEAM for a rotating multi-channel sensor.

Definition at line 1277 of file LiDAR.cpp.

◆ getScanPulseWidth()

float LiDARcloud::getScanPulseWidth ( uint  scanID) const

Get the range resolution (transmit pulse range-extent) of a scan in meters.

Parameters
[in]scanIDID of scan.
Returns
Range resolution used to merge sub-ray hits into discrete returns, in meters (0 if the syntheticScan pulse_distance_threshold argument is used instead).

Definition at line 1215 of file LiDAR.cpp.

◆ getScanRangeNoiseStdDev()

float LiDARcloud::getScanRangeNoiseStdDev ( uint  scanID) const

Standard deviation of Gaussian range (along-beam) measurement noise in meters.

Parameters
[in]scanIDID of scan.
Returns
Standard deviation of the range measurement noise applied during synthetic scan generation, in meters (0 if disabled).

Definition at line 1156 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 1135 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 1128 of file LiDAR.cpp.

◆ getScanReturnMode()

ReturnMode LiDARcloud::getScanReturnMode ( uint  scanID) const

Get the return-reporting mode of a scan.

Parameters
[in]scanIDID of scan.
Returns
RETURN_MODE_MULTI or RETURN_MODE_SINGLE used during analytic-waveform synthetic scan generation.

Definition at line 1170 of file LiDAR.cpp.

◆ getScanRevolutions()

double LiDARcloud::getScanRevolutions ( uint  scanID) const

Get the total number of full 360-degree revolutions collected by a spinning multibeam scan.

Parameters
[in]scanIDID of scan.
Returns
Number of revolutions (may be fractional). 0 for non-spinning scans.

Definition at line 1312 of file LiDAR.cpp.

◆ getScanRisleyPrisms()

std::vector< RisleyPrism > LiDARcloud::getScanRisleyPrisms ( uint  scanID) const

Get the rotating wedge prisms of a Risley-prism (Livox-style rosette) scan.

Parameters
[in]scanIDID of scan.
Returns
The prism stack in beam-traversal order (see RisleyPrism). Empty for scans that are not SCAN_MODE_RISLEY_PRISM.

Definition at line 1319 of file LiDAR.cpp.

◆ getScanRisleyRefractiveIndexAir()

double LiDARcloud::getScanRisleyRefractiveIndexAir ( uint  scanID) const

Get the refractive index of the medium surrounding the prisms of a Risley-prism scan.

Parameters
[in]scanIDID of scan.
Returns
Refractive index of air (typically 1.0). Returns 1.0 for non-Risley scans.

Definition at line 1326 of file LiDAR.cpp.

◆ getScanRotationRate()

double LiDARcloud::getScanRotationRate ( uint  scanID) const

Get the sensor-head rotation rate of a spinning multibeam scan.

Parameters
[in]scanIDID of scan.
Returns
Rotation rate in revolutions per second (PRF / (channels * steps_per_rev)). 0 for non-spinning scans.

Definition at line 1305 of file LiDAR.cpp.

◆ getScanSingleReturnSelection()

SingleReturnSelection LiDARcloud::getScanSingleReturnSelection ( uint  scanID) const

Get the single-return selection policy of a scan.

Parameters
[in]scanIDID of scan.
Returns
The SingleReturnSelection used when getScanReturnMode is RETURN_MODE_SINGLE.

Definition at line 1184 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 1121 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 1114 of file LiDAR.cpp.

◆ getScanStepsPerRev()

uint LiDARcloud::getScanStepsPerRev ( uint  scanID) const

Get the number of azimuth firing steps per full 360-degree revolution of a spinning multibeam scan.

Parameters
[in]scanIDID of scan.
Returns
Azimuth steps per revolution. 0 for scans that are not SCAN_MODE_SPINNING.

Definition at line 1298 of file LiDAR.cpp.

◆ getScanTiltPitch()

float LiDARcloud::getScanTiltPitch ( uint  scanID) const

Get the global scanner tilt pitch angle for a scan.

Parameters
[in]scanIDID of scan.
Returns
Scanner tilt pitch angle (rotation about the world y-axis) applied during synthetic scan generation, in radians (0 if level).

Definition at line 1256 of file LiDAR.cpp.

◆ getScanTiltRoll()

float LiDARcloud::getScanTiltRoll ( uint  scanID) const

Get the global scanner tilt roll angle for a scan.

Parameters
[in]scanIDID of scan.
Returns
Scanner tilt roll angle (rotation about the world x-axis) applied during synthetic scan generation, in radians (0 if level).

Definition at line 1249 of file LiDAR.cpp.

◆ getSyntheticScanMemoryBudget()

size_t LiDARcloud::getSyntheticScanMemoryBudget ( ) const

Get the soft memory budget (in bytes) for the transient ray-tracing buffers used during syntheticScan.

Returns
The explicitly configured budget in bytes, or 0 if using the automatic path-dependent default (8 GiB on a GPU build, 4 GiB otherwise; see setSyntheticScanMemoryBudget).

Definition at line 636 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 1612 of file LiDAR.cpp.

◆ getTriangleCount()

uint LiDARcloud::getTriangleCount ( ) const

Get the number of triangles formed by the triangulation.

Definition at line 1592 of file LiDAR.cpp.

◆ getTriangulationCandidateCount()

std::size_t LiDARcloud::getTriangulationCandidateCount ( ) const

Number of candidate triangles the Delaunay pass produced in the most recent triangulateHitPoints() call, before edge-length/aspect/degenerate filtering. Zero if triangulation has not been run.

Definition at line 1596 of file LiDAR.cpp.

◆ getTriangulationDroppedByAspect()

std::size_t LiDARcloud::getTriangulationDroppedByAspect ( ) const

Number of candidate triangles dropped by the aspect-ratio test (and, for multi-return data, the adaptive separation-ratio test) in the most recent triangulateHitPoints() call. Triangles already dropped by Lmax are not double-counted here.

Definition at line 1604 of file LiDAR.cpp.

◆ getTriangulationDroppedByDegenerate()

std::size_t LiDARcloud::getTriangulationDroppedByDegenerate ( ) const

Number of candidate triangles dropped because their computed area was degenerate (NaN) in the most recent triangulateHitPoints() call.

Definition at line 1608 of file LiDAR.cpp.

◆ getTriangulationDroppedByLmax()

std::size_t LiDARcloud::getTriangulationDroppedByLmax ( ) const

Number of candidate triangles dropped because an edge exceeded Lmax in the most recent triangulateHitPoints() call.

Definition at line 1600 of file LiDAR.cpp.

◆ hasMisses()

bool LiDARcloud::hasMisses ( ) const

Determine whether the point cloud contains any miss points.

Leaf-area inversion (calculateLeafArea()) requires misses to count the beams transmitted through each voxel.

Returns
True if at least one hit is a miss (see isHitMiss()).

Definition at line 6111 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 524 of file LiDAR.cpp.

◆ isGPUAccelerationEnabled()

bool LiDARcloud::isGPUAccelerationEnabled ( ) const

Check whether GPU acceleration is currently enabled.

Definition at line 5995 of file LiDAR.cpp.

◆ isGPUAvailable()

bool LiDARcloud::isGPUAvailable ( ) const

Check whether a CUDA-capable GPU is available for acceleration.

Returns true only if the CollisionDetection plugin was compiled with CUDA support, a CUDA device is present at runtime, and the GPU path is not disabled via the HELIOS_NO_GPU environment variable. Reports capability; use isGPUAccelerationEnabled() to query whether GPU acceleration is currently toggled on.

Definition at line 5991 of file LiDAR.cpp.

◆ isHitMiss()

bool LiDARcloud::isHitMiss ( uint  index) const

Determine whether a hit point is a "miss" (a fired pulse that returned nothing)

A miss represents a laser beam transmitted through the scene to the sky. Misses are stored as points placed along the beam direction at LIDAR_MISS_DISTANCE.

Parameters
[in]indexHit point index
Returns
True if the hit is flagged as a miss (per-hit is_miss data == 1), or, for legacy data lacking the flag, if its range reaches LIDAR_MISS_DISTANCE.

Definition at line 6091 of file LiDAR.cpp.

◆ lastHitFilter()

void LiDARcloud::lastHitFilter ( )

Filter multi-return 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 multi-return 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 2469 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 4535 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 4539 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 896 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 1829 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 1833 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 127 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 131 of file fileIO.cpp.

◆ maxPulseFilter()

void LiDARcloud::maxPulseFilter ( const char *  scalar)

Filter multi-return 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 multi-return data and requires that the scalar field "timestamp" is provided in the ASCII hit point data file.

Definition at line 2307 of file LiDAR.cpp.

◆ minPulseFilter()

void LiDARcloud::minPulseFilter ( const char *  scalar)

Filter multi-return 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 multi-return data and requires that the scalar field "timestamp" is provided in the hit point data file.

Definition at line 2367 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 595 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 2132 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 2150 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.

◆ setCancelFlag()

void LiDARcloud::setCancelFlag ( volatile int *  flag)

Register an external cancellation flag polled during long-running operations.

When the pointed-to int becomes non-zero, the current long-running operation aborts at the next poll point. syntheticScan() stops its parallel ray loop and returns early with whatever hits were recorded so far; triangulateHitPoints() discards any partial mesh and returns an empty triangulation. The flag is owned by the caller (e.g. a ctypes int shared with Python) and must outlive the operation; pass nullptr to clear. Set this before calling the operation to be cancelled.

Parameters
[in]flagPointer to a 0/non-zero cancellation flag, or nullptr.

Definition at line 535 of file LiDAR.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 4308 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 4279 of file LiDAR.cpp.

◆ setExternalTriangulation()

void LiDARcloud::setExternalTriangulation ( const std::vector< helios::vec3 > &  triangle_vertices,
const std::vector< int > &  scanIDs 
)

Replace the internal triangulation with an externally-supplied world-space mesh.

Bypasses the internal Constrained-Delaunay triangulation so a mesh produced elsewhere (e.g. a re-used Helios triangulation, or a per-scan open3d Ball-Pivot mesh) can drive leaf-area inversion. Leaf-area inversion only consumes triangulation through the per-voxel G(theta) leaf-angle term (see calculateLeafArea()), which needs each triangle's three vertices, its source scan (to recover the ray zenith from getScanOrigin()), and the grid cell its centroid falls in – nothing about the triangulation topology. This method supplies exactly that, then sets the triangulation-computed flag so calculateLeafArea() runs unchanged.

A grid must already be defined (see addGrid()). Each triangle's grid cell is determined by centroid containment; triangles whose centroid lies outside every cell are kept but contribute to no cell (same as the internal path). Degenerate (zero/NaN-area) triangles are dropped. Any previously-computed triangulation is discarded.

Parameters
[in]triangle_verticesFlat list of triangle vertices in world coordinates, three consecutive entries (v0, v1, v2) per triangle. Size must be a multiple of 3.
[in]scanIDsSource scan index for each triangle (size = triangle_vertices.size()/3). Used to recover the ray direction for G(theta); every entry must be a valid scan index in [0, getScanCount()). Per-scan provenance is required – a merged mesh with no scan association is not a valid input for leaf-area inversion.

Definition at line 3687 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 1369 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 1491 of file LiDAR.cpp.

◆ setProgressCallback()

void LiDARcloud::setProgressCallback ( std::function< void(float, const std::string &)>  callback)

Register a callback to receive progress updates during syntheticScan.

progress_fraction is in [0, 1]. message describes the current operation phase. Pass an empty std::function to clear the callback.

Parameters
[in]callbackFunction that receives (progress_fraction, message_string).

Definition at line 625 of file LiDAR.cpp.

◆ setScanDetectionThreshold()

void LiDARcloud::setScanDetectionThreshold ( uint  scanID,
float  detectionThreshold 
)

Set the detection threshold (minimum return energy fraction) of a scan.

Parameters
[in]scanIDID of scan.
[in]detectionThresholdMinimum return energy fraction in [0,1]; returns weaker than this are discarded. 0 disables suppression.

Definition at line 1239 of file LiDAR.cpp.

◆ setScanMaxReturns()

void LiDARcloud::setScanMaxReturns ( uint  scanID,
int  maxReturns 
)

Set the maximum number of returns reported per pulse in single/limited-return mode.

Parameters
[in]scanIDID of scan.
[in]maxReturnsMaximum returns per pulse (must be >= 1): 1 = single-return, 2 = dual-return, N = N-return. The kept returns are the subset chosen by setScanSingleReturnSelection. Ignored in RETURN_MODE_MULTI.

Definition at line 1205 of file LiDAR.cpp.

◆ setScanPulseWidth()

void LiDARcloud::setScanPulseWidth ( uint  scanID,
float  pulseWidth 
)

Set the range resolution (transmit pulse range-extent) of a scan in meters.

Parameters
[in]scanIDID of scan.
[in]pulseWidthRange resolution in meters; surfaces closer than this merge into one return. 0 falls back to the syntheticScan pulse_distance_threshold argument.

Definition at line 1222 of file LiDAR.cpp.

◆ setScanReturnMode()

void LiDARcloud::setScanReturnMode ( uint  scanID,
ReturnMode  returnMode 
)

Set the return-reporting mode of a scan.

Parameters
[in]scanIDID of scan.
[in]returnModeRETURN_MODE_MULTI to report all detected returns, or RETURN_MODE_SINGLE for one return per pulse.

Definition at line 1177 of file LiDAR.cpp.

◆ setScanSingleReturnSelection()

void LiDARcloud::setScanSingleReturnSelection ( uint  scanID,
SingleReturnSelection  selection 
)

Set the single-return selection policy of a scan.

Parameters
[in]scanIDID of scan.
[in]selectionWhich return to report in single-return mode (SINGLE_RETURN_STRONGEST, SINGLE_RETURN_FIRST, SINGLE_RETURN_LAST, or SINGLE_RETURN_STRONGEST_PLUS_LAST).

Definition at line 1191 of file LiDAR.cpp.

◆ setSyntheticScanMemoryBudget()

void LiDARcloud::setSyntheticScanMemoryBudget ( size_t  bytes)

Set the soft memory budget (in bytes) for the transient ray-tracing buffers used during syntheticScan.

syntheticScan fans each laser pulse out into rays_per_pulse sub-rays; for a large multi-return scan the total number of simultaneously-traced sub-rays (beams x rays_per_pulse) can demand tens of gigabytes if traced in one batch. To bound this, the per-scan beam fan-out is processed in chunks sized so that the live trace buffers stay near this budget, independent of the scan resolution. Larger rays_per_pulse automatically yields fewer beams per chunk. The budget bounds only the transient scratch buffers, not the output point cloud (which grows with the number of recorded returns). A very small budget is clamped up internally so each chunk still contains at least one beam and stays large enough for efficient batched ray tracing.

If never called, the budget is automatic and path-dependent: SYNTHETIC_SCAN_DEFAULT_BUDGET_GPU (8 GiB) on a GPU build and SYNTHETIC_SCAN_DEFAULT_BUDGET_CPU (4 GiB) otherwise. Call this to override that with a fixed cap (typically to lower peak memory on a constrained host).

Parameters
[in]bytesSoft cap in bytes on the live ray-tracing scratch buffers. Must be > 0.

Definition at line 629 of file LiDAR.cpp.

◆ setSyntheticScanProgressPointer()

void LiDARcloud::setSyntheticScanProgressPointer ( volatile int *  ptr)

Register an external counter for per-scan syntheticScan progress.

syntheticScan writes the 0-based index of the scan it is currently ray-tracing into the pointed-to int, updated at the start of each scan, and sets it to getScanCount() when the batch finishes. The counter is owned by the caller (e.g. a ctypes int shared with Python) and must outlive the scan; pass nullptr to clear. Set this before calling syntheticScan().

Parameters
[in]ptrPointer to a caller-owned progress counter, or nullptr.

Definition at line 542 of file LiDAR.cpp.

◆ syntheticScan() [1/9]

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

Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning one laser hit per pulse.

Parameters
[in]contextPointer to the Helios context
Note
This overload does NOT record miss points (transmitted beams). The resulting cloud cannot be used with calculateLeafArea(), which requires misses. To record misses, use the overload with the record_misses argument: syntheticScan(context, scan_grid_only, record_misses).
Any non-standard label listed in the scan column format is used to label each hit point with that scalar data field of the intersected primitive. The value is taken from the primitive's own primitive data when present, otherwise from the object data of the primitive's parent compound object (per-primitive data takes precedence). See Generating Synthetic (Simulated) LiDAR Data.

Definition at line 6464 of file LiDAR.cpp.

◆ syntheticScan() [2/9]

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

Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 6468 of file LiDAR.cpp.

◆ syntheticScan() [3/9]

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

Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 6472 of file LiDAR.cpp.

◆ syntheticScan() [4/9]

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

Run a single-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 6476 of file LiDAR.cpp.

◆ syntheticScan() [5/9]

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

Run a multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 single-return synthetic scan.
This overload does NOT record miss points (transmitted beams). The resulting cloud cannot be used with calculateLeafArea(), which requires misses. To record misses, use the overload with the record_misses argument: syntheticScan(context, rays_per_pulse, pulse_distance_threshold, scan_grid_only, record_misses).

Definition at line 6480 of file LiDAR.cpp.

◆ syntheticScan() [6/9]

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

Run a multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 single-return synthetic scan.

Definition at line 6484 of file LiDAR.cpp.

◆ syntheticScan() [7/9]

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

Run a multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 single-return synthetic scan.

Definition at line 6488 of file LiDAR.cpp.

◆ syntheticScan() [8/9]

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 multi-return synthetic LiDAR scan based on scan parameters given in an XML file, returning 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 single-return synthetic scan.

Definition at line 6507 of file LiDAR.cpp.

◆ syntheticScan() [9/9]

void LiDARcloud::syntheticScan ( helios::Context context,
int  rays_per_pulse,
float  pulse_distance_threshold,
ReturnMode  return_mode,
bool  scan_grid_only = false,
bool  record_misses = false,
bool  append = true 
)

Run a synthetic LiDAR scan with an explicit return-reporting mode (analytic-waveform processing)

Fires rays_per_pulse sub-rays per pulse and forms an analytic (sum-of-Gaussians) waveform whose detected returns are reported according to return_mode. With RETURN_MODE_MULTI all detected returns are reported; with RETURN_MODE_SINGLE up to the scan's getScanMaxReturns returns per pulse are reported (see setScanSingleReturnSelection), and (in single-return mode, maxReturns=1) two surfaces within the pulse range-resolution blend into one return at an intermediate range (a "ghost"/"mixed pixel" point). The range-resolution used to merge returns is the scan's getScanPulseWidth when set, otherwise pulse_distance_threshold; the noise floor is the scan's getScanDetectionThreshold. This overrides each scan's stored getScanReturnMode for this call only (the stored value is restored afterward); the per-scan getScanMaxReturns and selection policy still apply.

Parameters
[in]contextPointer to the Helios context.
[in]rays_per_pulseNumber of ray launches per laser pulse direction. A value of 1 produces an idealized exact-intersection scan regardless of return_mode.
[in]pulse_distance_thresholdRange-resolution distance used to merge sub-ray hits into returns when the scan's pulse width is 0. Hits within this distance merge into one return.
[in]return_modeRETURN_MODE_MULTI to report all detected returns, or RETURN_MODE_SINGLE for one return per pulse.
[in]scan_grid_onlyIf true, only considers context geometry within the scan grid. [optional]
[in]record_missesIf true, "miss" points (beam did not hit any primitives) are recorded in the scan. [optional]
[in]appendIf true, new hit points are appended to existing data; if false, existing hit points are cleared first. [optional]

Definition at line 6492 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.
Note
This call honors the cancellation flag registered via setCancelFlag(): if the flag becomes non-zero (set from another thread) the triangulation aborts, discards any partial mesh, and returns an empty triangulation (getTriangleCount() == 0) rather than running to completion.

Definition at line 3277 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, ">" );
This call honors the cancellation flag registered via setCancelFlag(): if the flag becomes non-zero (set from another thread) the triangulation aborts, discards any partial mesh, and returns an empty triangulation (getTriangleCount() == 0) rather than running to completion.

Definition at line 3749 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 649 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 2180 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 2185 of file LiDAR.cpp.

Field Documentation

◆ LIDAR_MISS_DISTANCE

constexpr float LiDARcloud::LIDAR_MISS_DISTANCE = 20000.f
staticconstexpr

Distance (m) at which a "miss" point is placed along its beam direction.

A fired pulse that returns nothing (transmitted to the sky) is represented as a point at this distance from the scan origin along the beam. The value is far beyond any real target so misses are unambiguously classified as transmitted beams in the leaf-area inversion. Shared by gapfillMisses(), syntheticScan(), and the miss classification (see isHitMiss()). This is the distance at which the miss POINT is positioned in the cloud; it is distinct from LIDAR_RAYTRACE_MISS_T, the ray-tracer's internal no-hit parameter.

Definition at line 1651 of file LiDAR.h.

◆ LIDAR_RAYTRACE_MISS_T

constexpr float LiDARcloud::LIDAR_RAYTRACE_MISS_T = 1001.f
staticconstexpr

Ray-tracer "no hit" parameter (m): the maximum ray length passed to the backend.

A traced ray that intersects nothing returns this value as its hit distance t. The synthetic-scan miss detection compares the returned t against this sentinel to decide whether a beam hit a primitive. This is an internal ray-tracing threshold and is NOT the distance at which a miss point is placed in the cloud (that is LIDAR_MISS_DISTANCE). Used by performUnifiedRayTracing() and syntheticScan().

Definition at line 1660 of file LiDAR.h.


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