Documentation  ›  Documentation Library  ›  Spectral Similarity
Spectral Analysis

Spectral Similarity

Spectral Similarity finds pixels whose spectra resemble a reference spectrum selected from a seed ROI.

Correlation • Spectral Angle Mapper (SAM) • Spectral Information Divergence (SID)

Overview

Spectral Similarity finds pixels whose spectra resemble a reference spectrum selected from a seed ROI.

The mean spectrum from the seed region is compared with every pixel spectrum in the current hyperspectral cube.

The result is displayed as a spatial similarity map that can be thresholded and exported as an ROI.

1. Load a hyperspectral cube in IDCubePro.

2. Open Classification > Spectral Similarity.

4. Draw a representative polygon on the main image.

5. Choose Correlation, SAM, or SID.

8. Enable Show threshold overlay if desired.

9. Click Export ROI to save the selected result for other IDCubePro tools.

The seed ROI defines the reference spectrum.

All pixel spectra inside the ROI are averaged to create the seed spectrum.

Use a reasonably homogeneous region with good signal-to-noise whenever possible.

Avoid including unrelated tissues, materials, or saturated pixels in the same seed ROI.

Pearson Spectral Correlation

Correlation measures similarity in spectral shape.

+1 highly similar spectral shape 0 little linear similarity -1 opposite spectral behavior HIGHER correlation = MORE similar Correlation is useful when spectral shape is more important than absolute signal magnitude.

SAM treats each spectrum as a vector and calculates the angle between the pixel spectrum and the seed spectrum.

An identical spectral direction gives an angle near 0 degrees.

SAM is relatively insensitive to overall spectral magnitude and is often useful when illumination or signal amplitude varies.

Spectral Information Divergence (sid)

SID compares normalized spectral distributions using an information-theoretic divergence measure.

Highly similar spectra produce SID values near 0.

LOWER divergence = MORE similar The computed map has the same rows and columns as the original image.

Correlation map: high values indicate similarity.

SAM map: low values indicate similarity.

SID map: low values indicate similarity.

The numerical ranges are method-specific and should not be compared directly between methods.

The threshold controls which pixels are accepted as sufficiently similar to the seed spectrum.

Correlation uses values at or above the threshold.

SAM and SID use values at or below the threshold.

Move the threshold interactively to make the selected region more restrictive or more permissive.

Show threshold overlay displays the currently accepted pixels directly on the map.

This is useful for visually checking whether the selected pixels correspond to the expected structures.

The Min and Max controls change only the displayed color range of the similarity map.

Changing map contrast does NOT change the underlying similarity values, threshold, seed spectrum, or exported ROI.

The seed-spectrum panel displays the mean spectrum calculated from the seed ROI.

When wavelength information is available, the x-axis is wavelength.

Otherwise, the x-axis is spectral band number.

Inspect the seed spectrum before interpreting the similarity map.

Export ROI creates a logical mask from the current thresholded result.

The toolbox also extracts the selected pixel spectra and calculates their mean spectrum.

Application data may include:

spectralSimilaritySeedSpectrum spectralSimilarityROIMeanSpectrum Legacy compatibility variables may include:

Correlation: good starting point for spectral-shape matching.

SAM: useful when overall spectral magnitude varies.

SID: useful for comparing normalized spectral distributions.

For exploratory work, comparing more than one method can be informative.

1. Correct or preprocess the hyperspectral cube as appropriate.

2. Select a representative seed ROI.

3. Inspect the seed spectrum.

4. Compute a Correlation map first.

5. Adjust the threshold and inspect the overlay.

6. Compare SAM and SID when useful.

7. Export the ROI after the result is satisfactory.

Results can be affected by image preprocessing.

Useful preprocessing may include:

  • removal of defective pixels
  • removal of noisy wavelengths
  • normalization when scientifically appropriate

Use consistent preprocessing when comparing samples.

No map appears: confirm that a seed ROI exists and a valid hyperspectral cube is loaded.

Too much of the image is selected: make the threshold more restrictive or choose a more specific seed ROI.

Almost nothing is selected: make the threshold less restrictive and inspect the seed spectrum for noise or saturation.

Map looks noisy: inspect the cube for low-signal or defective bands and consider preprocessing.

Correlation and SAM differ: this is expected because they measure spectral similarity differently.

Important Interpretation Note

Spectral Similarity measures mathematical resemblance to a selected reference spectrum.

It does not by itself establish material identity, tissue identity, pathology, molecular composition, or diagnosis.

Interpret results together with spatial context, controls, reference measurements, and independent validation.