Welcome to the TLS workshop Git repository! This repository contains detailed instructions on extracting tree metrics from terrestrial laser scanner (TLS) point clouds using RayCloudTools (RCT) and Python notebooks.
Before cloning this repository and running the Python notebooks, it will be nesessary to install VSCode, WSL and Apptainer. To start, follow the instuctions below.
This markdown will guide you through installing Windows Subsystem for Linux (WSL), Apptainer, and VSCode on a Windows machine.
WSL enables you to run a Linux distribution alongside your Windows operating system without needing a virtual machine. Since a significant amount of scientific research is conducted using Linux, it is an essential skill for learning new technologies.
Apptainer, a container platform optimized for high-performance computing (HPC) environments, offers a convenient way to distribute software and simplify installations for Linux platforms. We use this to package RayCloudTools.
Visual Studio Code (VSCode) is an open-source code editor developed by Microsoft. It supports a wide range of programming languages and frameworks, making it an ideal tool for data analysis. With the Remote - WSL extension, you can seamlessly connect and work within your WSL environment.
- Windows 11 or Windows 10 Version 2004 and higher (Build 19041 and higher)
- Administrative privileges on the Windows machine
- An internet connection
If not already installed on your machine, download the CloudCompare installer for your operating system from here and install using defaults.
-
Open PowerShell as an Administrator. To do this, right-click on the Start button and select "Windows PowerShell (Admin)" or "Command Prompt (Admin)".
-
Enter the following command to enable WSL:
wsl --installThis command will enable the required features and install the default Linux distribution (Ubuntu).
-
Follow the on-screen instructions to complete the installation.
-
Open the installed Linux distribution from the Start menu (Ubuntu).
-
Set up your Linux user account by following the prompts. You will need to provide a username and password.
-
Update the package list and upgrade installed packages by entering the following commands into the WSL terminal:
sudo apt updatesudo apt upgrade -y -
Install Python and other dependencies in WSL
sudo apt install python3 python3-pip ipython3
Install the necessary dependencies for Apptainer by entering the following command into the WSL terminal:
sudo apt install -y software-properties-commonTo install Apptainer we need to add the remote repository, this is the location online that WSL will look to download the software.
sudo add-apt-repository -y ppa:apptainer/ppa
And now that the repository is added, we can download and install Apptainer.
sudo apt -y update && sudo apt install -y apptainerTo verify that Apptainer is installed correctly, run:
apptainer --versionYou should see the installed version of Apptainer (e.g. apptainer version 1.3.2-1).
To download the RayCloudTools container:
apptainer pull docker://tdevereux/raycloudtools:latestTo run and enter the container:
apptainer shell raycloudtools_latest.sifTest the container by running a RayCloudTools command:
rayimportIf all is well, you should see -
Import a point cloud and trajectory file into a ray cloud
usage:
rayimport pointcloudfile trajectoryfile - pointcloudfile can be a .laz, .las or .ply file
trajectoryfile is a text file using 'time x y z' format per line
rayimport pointcloudfile 0,0,0 - use 0,0,0 as the sensor location
rayimport pointcloudfile ray 0,0,-10 - use 0,0,-10 as the constant ray vector from start to point
--max_intensity 100 - specify maximum intensity value (default 100).
0 sets all to full intensity (bounded rays).
--remove_start_pos - translate so first point is at 0,0,0
The output is a .ply file of the same name (or with suffix _raycloud if the input was a .ply file).
To exit the container and return to WSL:
exitVisit the Visual Studio Code download page. Download the installer for Windows and install using defaults.
Open VSCode after installation. Click on the Extensions view icon on the Sidebar or press Ctrl+Shift+X. Search for the Remote - WSL extension and install it by clicking on the green install icon.
Open a WSL terminal (Ubuntu) from the Start menu as before.
In the WSL terminal, input code . to open the current directory in VSCode. This will connect VSCode to your WSL environment.
In VSCode, press Ctrl+Shift+P to open the Command Palette.
Type Git: Clone and select it from the dropdown options.
Enter the repository URL:
https://github.com/tim-devereux/TLS_Workshop.git
Choose a directory where you want to clone the repository, your user directory within WSL is appropriate (/home/username).
Once the cloning process is complete, you will be prompted to open the cloned repository. Click "Open" to open the project in VSCode.
That is everything for need to comtinue! You have successfully installed WSL, Apptainer, and VSCode on your Windows machine. You have cloned a Git repository and configured a software container to run RayCloudTools. In the next workshop we will learn to use what we have installed here to extract tree metrics from point cloud data using RCT and analyse the output using Python.
For additional help or information, refer to the official WSL documentation, Visual Studio Code documentation, and Apptainer documentation.
