# NOT RUN {
#- import tls data
tls=data.table::fread(system.file("extdata", "Tree_t1.asc", package="VoxR"))
#- keep the tree trunk
tls=tls[z<=0]
#- run filled voxel voxelisation
filled = VoxR::filled_voxel_cloud(tls,0.02)
#- run usual voxelisation
voxels = VoxR::vox(tls,0.02)
#- compare filled voxel cloud to empty voxel cloud
VoxR::plot_voxels(filled,res = 0.02)
VoxR::plot_voxels(voxels,res = 0.02)
#- compare the volume estimate from Vonderach et al. 2012 to estimate based on voxel volume
#- run filled voxel voxelisation with volume estimation
filled = VoxR::filled_voxel_cloud(tls,0.01,estimate_volume = TRUE)
#- compare volumes
filled$estimated_volume # Vonderach
nrow(filled$filled_voxels)*0.01^3 # voxel based
# }
Run the code above in your browser using DataLab