Skip to main content
Version: 3.4.20 (unreleased)

Hyperspectral Data

A hyperspectral scan records a reflectance spectrum at every point: tens to hundreds of narrow bands across the visible, near-infrared and short-wave infrared. VRGS holds each band as an ordinary attribute layer, knows which layers are bands and at what wavelength, and offers a set of spectral tools on them. Every tool writes ordinary attribute layers, so its results colour, filter, chart, cluster and classify like any other attribute, and they are saved with the project.

The tools work on three kinds of object:

  • a point cloud with spectral bands, such as a hyperspectral cloud exported from CloudCompare as PLY;
  • a triangulated mesh with spectral bands on its vertices;
  • a satellite image imported from an ENVI hyperspectral cube, with one spectrum per pixel.

Getting hyperspectral data in​

A point cloud with bands (PLY)​

Import the cloud from Data tree → Point Clouds → Import → From File… as a Stanford PLY. Each vertex property becomes an attribute. When VRGS finds at least five properties whose names are wavelengths, it tidies them as it imports:

  • each band is renamed to its wavelength, such as 503.757 nm, and filed under a Spectral bands attribute group;
  • NaN values become the layer's null value, so a point with no spectrum is skipped rather than spoiling a statistic;
  • the vertices_x, vertices_y and vertices_z layers that duplicate the positions are removed.

A wavelength name is a number, optionally after scalar_, band_, wl_, wl, b or r_ and optionally followed by nm or um: scalar_503.757, 503.757 nm and b2.205um (2205 nm) are all bands. A small number with a decimal part is read as micrometres. An integer under 300 is a band number, not a wavelength, so band_12, UMAP_1 and PC 3 are not bands; nor is anything outside 300–15000 nm. Once any layer is in the Spectral bands group, only the layers in that group count as bands.

Clouds imported before these tools existed work too: the bands are found by name every time.

An ENVI image cube​

VRGS reads ENVI images: an ASCII .hdr header beside a raw BSQ, BIL or BIP data file (.bsq, .bil, .bip, .img, .dat, .raw or no extension). Pick either the header or the data file. Byte, 16- and 32-bit integer, unsigned and floating-point data are read in either byte order. The header's wavelengths (nm or µm), bad-band list, data ignore value, reflectance scale factor and map info are used.

Import it from either group:

  • Data tree → Satellite Images → Import → From File…, choosing ENVI hyperspectral image. This defaults to a satellite image.
  • Data tree → Point Clouds → Import → From File…, choosing ENVI hyperspectral image. This defaults to a point cloud.
  • Drop the .hdr, .bsq or .bip file onto a 3D view or the project tree. This defaults to a point cloud. Drop a BIL cube by its .hdr: a dropped .bil goes to the elevation-grid reader.

The Import ENVI Hyperspectral Image dialog first says how big the cube is, how many bands it holds over what range, its size on disk and where it will be placed. Then:

SettingWhat it does
Import asSatellite image — a north-up raster, one pixel per kept pixel, drawn on a flat panel at its map position. Point cloud — a point per kept pixel.
Keep every Nth pixelThins the image in both directions. The default keeps the import near 1.5 GB of memory: an airborne cube can be far bigger than memory as floats.
Average N neighbouring bandsBins bands to cut noise and memory. Bins never cross a gap or a bad band. Defaults to 2 on a cube of more than 200 bands.
Bands from (nm), Bands to (nm)Keeps only the bands in this range.
Leave out the bands the header marks badDrops the bands the header's bbl list marks bad, such as the water absorptions. A header with no list keeps every band.
Elevation of the pointsThe height the image or cloud is placed at.

An import that will take more than about 6 GB asks before it goes ahead. Pixels with no valid value in any kept band, such as a mosaic's background, are left out of a point cloud and are null in an image. The image or cloud is placed at the header's map coordinates; an image whose map info is rotated is placed north-up, unrotated, with a warning (import it as a point cloud to keep the rotation). With no map info it is placed in pixel coordinates.

The read runs in the background. Each band becomes a layer under Spectral bands, and a stretched band composite is put on the red, green and blue channels: the header's default bands when it names three, true colour otherwise.

The spectrum at a point​

With Interrogate on (Home tab), click a point of a hyperspectral cloud or a pixel of a hyperspectral satellite image. Its spectrum is drawn against wavelength in the Charts panel, broken at the gaps where bands are missing (the water absorptions and the detector joins) rather than bridged across them.

  • A click replaces the last spectrum. Shift+click pins it, so several spectra can be compared; up to eight are kept, the oldest pinned one going first.
  • The property bar shows the clicked point's index and attribute values, with the bands summarised in one Spectral bands row rather than hundreds.
  • The plotted spectra are copies: deleting the cloud leaves the chart as it is.

The Spectral submenu (below) has the chart's commands:

  • Plot Mean Spectrum of Shown Points — the mean spectrum of every point the object's attribute filters leave shown, pinned on the chart. Filter by an index first to see the average spectrum of, say, the strongest Al-OH absorptions.
  • Chart: Continuum Removed — divides each spectrum by its upper convex hull, so the absorption features stand out at a common scale whatever the brightness. Click again for raw reflectance.
  • Chart: Export Spectra (CSV)… — a wavelength column and one column per plotted spectrum.
  • Chart: Clear — removes every spectrum from the chart.

The Spectral submenu​

Right-click any attribute layer or attribute group of an object that has spectral bands and choose Spectral. The submenu appears only when the object has at least five bands, and a point cloud or mesh must be loaded. On a cloud or mesh the tools run in the background, and the object is busy until they finish; on a satellite image they run straight away. Each tool files its results under a group of its own and reports what it wrote in the messages panel, with a warning for anything it had to skip.

Band composites​

Band Composite… puts three bands, or three derived layers, on the object's red, green and blue channels and shows the colour in place of the active attribute.

CompositeRed, green, blueShows
True colour640, 550, 470 nmRoughly what the eye sees.
Colour infrared860, 650, 550 nmVegetation in red.
SWIR false colour2340, 2200, 2100 nmCarbonate and Al-OH absorptions as shifts of colour.
Mineral featuresAl-OH 2200, Fe-OH 2250 and carbonate 2335 band depthsWhite mica and clays in red, chlorite and epidote in green, carbonate in blue. The depths are computed into Spectral indices if they are not there yet.
CustomThe three wavelengths you type

Each wavelength takes the nearest band within 50 nm; a composite whose bands are not covered is not applied, and says which are missing. Stretch each channel between its 2 % and 98 % values (on by default) fixes each channel's display range so the colours fill the range rather than sitting in a dull middle. The channel choice is saved with the project.

Mineral indices​

Mineral Indices… writes one layer per ticked index under Spectral indices.

IndexWavelengths (nm)Picks out
Al-OH 2200 depth2120 / 2205 / 2250White mica, illite, smectite, kaolinite
Kaolinite 2160 depth2120 / 2165 / 2185The short-wavelength shoulder of the kaolinite and dickite doublet
Fe-OH 2250 depth2230 / 2250 / 2270Chlorite, epidote, jarosite
Carbonate / Mg-OH 2335 depth2290 / 2335 / 2380Calcite, dolomite, chlorite, talc, amphibole
Ferric iron ratio R750/R550750, 550Hematite and goethite (the red slope of ferric iron)
NDVI800, 670Vegetation, high: use it to filter plants out
Mean albedoevery bandOverall brightness

A band depth is 1 − R(centre) / continuum, where the continuum is the straight line between the two shoulders: 0 for no absorption, 0.2 for a feature that takes away a fifth of the light. Each wavelength is read as the mean of the nearest band and its neighbours, which damps noise. Also a custom band depth adds a depth at your own left shoulder, centre and right shoulder.

An index is skipped, with a warning naming it, when one of its wavelengths is more than 15 nm from any band: a wavelength in a gap, or outside what the sensor covers. A point with a null band gives a null index.

Minimum wavelength mapping​

Minimum Wavelength Mapping… finds the deepest absorption in a window of each spectrum and records where it is and how deep. The position of the Al-OH feature moves with mica and clay chemistry (shorter for Na- and Al-rich white mica, longer for phengitic mica), so it maps composition as well as abundance.

  • Absorption window — Al-OH (2120–2250 nm), Fe-OH (2220–2280 nm), Carbonate (2280–2380 nm) or a custom range.
  • Smallest depth kept — shallower features are left null. Default 0.02.

For each point, the bands in the window plus one shoulder band on each side are continuum-removed, the lowest is found, and a parabola through it and its two neighbours places the minimum between band centres. A minimum on the window's edge is not a feature and is left null. It writes MWL window position (nm) and MWL window depth under Spectral MWL. Colour by the position and filter by the depth to see the chemistry only where the feature is strong.

Principal components​

Principal Components… reduces hundreds of correlated bands to a few components, in order of how much of the variation each explains.

  • Number of components — default 10.
  • Bands from (nm), Bands to (nm) — for example the SWIR alone.
  • Remove each spectrum's continuum first — compares the shapes of the spectra, not their brightness.
  • Standardise each band — correlation rather than covariance, so a noisy band with a large range does not dominate.

It writes PC 1 to PC n under Spectral PCA and lists the share of the variance each explains in the messages panel. Points with any null band are left out of the statistics and get null components. Run K-Means Clustering, ANN Classify or UMAP Projection on the first few components rather than on hundreds of bands; see Attributes.

Reference spectra​

The spectral angle mapper compares every point with named reference spectra kept on the object and saved with the project. Add them from the Spectral submenu:

  • Add Reference from Last Plotted Spectrum… — the most recent spectrum on the chart, such as a point you interrogated on a known lithology.
  • Add Reference from Mean of Shown Points… — the mean spectrum of the points the object's filters leave shown.
  • Add References from USGS Mineral Library… — laboratory spectra of 13 minerals that ship with VRGS: kaolinite, illite, muscovite, montmorillonite, calcite, dolomite, Fe-clinochlore, epidote, gypsum, alunite, hematite, goethite and jarosite, from the USGS Spectral Library version 7 (Kokaly et al., 2017, USGS Data Series 1035). Minerals already added start unticked.
  • Import Reference Library (CSV)… — a CSV of your own: a header row, then a row per wavelength, with the wavelength (nm, or µm when every value is under 30) in the first column and one spectrum per further column, named by its header. Commas, semicolons or tabs separate; lines starting with # are comments.
  • Remove Reference Spectra… — tick the ones to remove.

A reference with the name of one already kept replaces it. A reference need not have the same bands as the data: it is resampled to the object's wavelengths.

Spectral angle mapper​

Spectral Angle Mapper… measures the angle between each point's spectrum and each chosen reference, treating the spectra as vectors. The angle ignores overall brightness, so a shadowed face and a sunlit one of the same rock match the same reference.

  • Reference spectra to compare with — tick the references to use.
  • Bands from (nm), Bands to (nm) — compare over part of the range only.
  • Compare continuum-removed spectra — compare the absorption shapes alone.
  • Largest angle for a match (degrees) — default 10.

It writes SAM reference (deg) for each reference, smaller meaning more alike, and an integer SAM class layer under Spectral SAM: the number of the closest reference within the largest angle, counting the ticked references from 1 in the order the dialog lists them, or 0 when none is close enough. Colour by SAM class with a discrete colour map to see the classes.

A typical workflow​

  1. Import the cloud or image. Check the messages panel: it names the band count and wavelength range.
  2. Interrogate a few points on different rocks and compare their spectra, with Chart: Continuum Removed on to see the absorptions.
  3. Run Band Composite… with SWIR false colour or Mineral features for a first look at where the minerals are.
  4. Run Mineral Indices… and Minimum Wavelength Mapping…, and colour by the depth and position layers.
  5. Add references from points you know, or from the USGS library, and run the Spectral Angle Mapper…; or run Principal Components… and cluster the first few components.
  6. Save the project: the bands, every result layer, the groups, the composite and the reference spectra are kept.

Memory​

Each band costs 4 bytes per point or pixel, so a cloud of 1 million points with 200 bands needs about 0.8 GB for its bands alone, and 10 million points about 8 GB. Thin a large ENVI cube with Keep every Nth pixel and Average N neighbouring bands when you import it, and narrow the wavelength range to the features you need.

See also​