Documentation  ›  Documentation Library  ›  Manual Background Removal
Filtering & Corrections

Manual Background Removal

Manual Background Removal estimates a spectral baseline from a user-selected background-only image region and subtracts that baseline from every pixel spectrum in the hyperspectral cube.

Manual Background / Baseline Removal

IDCubePro 2026 - Manual Background / Baseline Removal

Overview

Manual Background Removal estimates a spectral baseline from a user-selected background-only image region and subtracts that baseline from every pixel spectrum in the hyperspectral cube.

The workflow is interactive because the user chooses both the spatial background ROI and the spectral points used to define the baseline.

The procedure has two stages.

First, you draw a rectangular ROI that should contain only background.

IDCubePro averages all spectra inside that ROI to obtain one representative background spectrum.

Second, you manually select points along the baseline of that average spectrum.

The selected points are interpolated to create a complete baseline across the wavelength range.

That baseline is then subtracted from every pixel spectrum in the full dataset.

WHY USE MANUAL BACKGROUND REMOVAL?

Some hyperspectral datasets contain a broad additive spectral background or baseline that is not part of the signal of interest.

Examples can include detector offset, fluorescence background, additive scattering contributions, environmental background, or slowly varying spectral baseline components.

Subtracting an estimated baseline can make narrower spectral features easier to compare.

Important - This Is Additive Correction

The current implementation performs subtraction:

Corrected spectrum = Original spectrum - Baseline This is fundamentally different from multiplicative normalization or continuum removal.

Use this tool only when an additive baseline model is scientifically appropriate.

Step 1 - Select Background Roi

Click Select ROI & Define Baseline.

Draw a rectangular region containing background only, then double-click the ROI to confirm it.

The ROI should avoid sample signal, boundaries, glare, shadows, saturation, or other structures that should not contribute to the estimated background.

Choosing A Good Background Roi

A good ROI should be spatially representative of the unwanted background component.

Whenever possible, choose a homogeneous region with adequate signal-to-noise ratio.

Avoid very small ROIs because a few noisy pixels can dominate the average.

Avoid very large ROIs if the background is spatially nonuniform.

This method assumes that one background spectrum is sufficiently representative for the entire cube.

If the additive background varies strongly across the image, subtracting one global baseline may over-correct some regions and under-correct others.

In that case, consider a spatially varying background-correction method.

After ROI selection, IDCubePro averages the spectra across all pixels in the selected rectangle.

Averaging reduces random pixel-level noise and produces the spectrum used for manual baseline definition.

Step 2 - Define Baseline Points

The spectrum window displays the average spectrum from the selected background ROI.

Move the mouse over the spectrum and click points that you believe lie along the underlying baseline.

Press Enter when the baseline points are complete.

WHAT COUNTS AS A BASELINE POINT?

A baseline point should represent the slowly varying background trend rather than an absorption peak, emission peak, or other localized spectral feature.

Select points on portions of the spectrum that you believe define the underlying broad background.

At least two unique wavelength positions are required.

With exactly two unique points, IDCubePro uses linear interpolation.

With three or more unique points, IDCubePro uses pchip interpolation.

pchip is a shape-preserving piecewise cubic interpolation.

It provides a smooth baseline while generally reducing the strong overshoot that can occur with an unconstrained cubic spline.

HOW MANY POINTS SHOULD I USE?

Use enough points to capture the broad baseline curvature without forcing the interpolation to follow noise or narrow spectral features.

Too few points may miss real baseline curvature.

Too many points can make the baseline follow local noise or genuine spectral structure that should remain in the corrected data.

Distribute baseline points across the wavelength range when the baseline extends across the full spectrum.

If a region contains a real feature of interest, avoid placing a baseline point directly on that feature unless it is genuinely part of the background.

If multiple points are selected at the same or nearly identical wavelength position, the current implementation consolidates duplicate x-positions and averages their y-values before interpolation.

Interpolation Outside Selected Points

The baseline is evaluated over the complete wavelength vector using extrapolation at the ends.

Therefore, the baseline outside the first and last selected points is less constrained by direct user input.

For this reason, place reasonable baseline points near both ends of the scientifically relevant spectral range when possible.

After the baseline is defined, the lower plot shows the average ROI spectrum after baseline subtraction.

Inspect this corrected spectrum before applying the correction to the entire dataset.

What To Look For Before Applying

Check that the corrected background spectrum is centered appropriately around the expected residual level.

Make sure important spectral peaks or absorption features have not been removed accidentally.

Watch for large artificial slopes, edge excursions, or oscillatory baseline behavior.

Click Apply to Entire Dataset only after the baseline looks scientifically reasonable.

The same interpolated baseline vector is subtracted from every pixel spectrum in the cube.

The same baseline is applied to all pixels.

This assumes that the unwanted additive background has approximately the same spectral shape and magnitude throughout the image.

If that assumption is not valid, use a different correction strategy.

After application, myData.Images is replaced by the baseline-corrected working cube.

The number of rows, columns, bands, and wavelength vector are preserved.

The function marks the working filtered cube as active.

The corrected cube becomes the active dataset used by subsequent IDCubePro processing and analysis tools.

This function updates the working myData.Images dataset.

It does not intentionally redefine the original acquisition itself.

When the broader IDCubePro original-data copy is available, Reset Preprocessing can be used to restore the unprocessed cube.

IDCubePro records Manual Background Removal in processing history.

The history includes the number of manually selected baseline points and the dimensions of the corrected cube.

When This Method Is Appropriate

  • A meaningful background-only spatial region exists.
  • The unwanted contribution is primarily additive.
  • One representative baseline can reasonably be applied across the image.
  • Manual scientific judgment is appropriate for defining the baseline.
  • No true background-only region exists.
  • The background changes spatially across the sample.
  • Background intensity changes substantially from pixel to pixel.
  • The baseline overlaps strongly with real spectral features.
  • The ROI contains mixed sample and background pixels.

Do not use manual additive background subtraction merely to make spectra look flatter.

The correction should correspond to a defensible measurement model.

If the issue is multiplicative illumination, scattering, broad continuum shape, or reference calibration, another preprocessing method may be more appropriate.

Background Removal Versus Reference Correction

Reference correction typically uses white and/or dark references to convert raw detector values into a calibrated or normalized measurement.

Manual Background Removal instead subtracts a user-defined additive spectral baseline.

These operations address different physical problems.

Background Removal Versus Continuum Removal

Manual Background Removal subtracts a baseline.

Continuum removal divides each spectrum by its own interpolated convex-hull continuum.

Continuum removal is therefore a multiplicative, spectrum-specific normalization, whereas this tool uses one additive baseline for the full dataset.

Background Removal Versus Normalization

Vector normalization, standard normal variate, area normalization, and similar methods rescale spectra.

This tool does not rescale the spectrum; it subtracts a wavelength-dependent offset.

Baseline subtraction can produce negative corrected values.

Negative values are not automatically an error.

They indicate that the original intensity at that wavelength was below the estimated baseline.

Whether negative values are physically meaningful or problematic depends on the acquisition and downstream analysis.

A noisy background ROI can produce a noisy baseline estimate.

Averaging across a larger homogeneous ROI can reduce random noise.

However, do not increase ROI size so much that the ROI becomes spatially heterogeneous.

Bright artifacts, dead pixels, saturated pixels, or isolated contamination inside the ROI can distort the averaged background spectrum.

Inspect the ROI carefully and exclude known artifacts when possible.

Baseline interpolation near the beginning and end of the wavelength range can be less constrained.

Use baseline points near the spectral edges when those regions are scientifically important and suitable baseline locations exist.

Manual baseline selection introduces operator judgment.

For reproducible studies, document:

  • The background ROI location and selection criteria.
  • The number of baseline points.
  • The approximate wavelengths of selected baseline points.
  • The preprocessing steps performed before and after correction.

If several users perform manual baseline correction, define explicit rules for ROI selection and baseline-point placement.

Operator-dependent differences can otherwise become a source of analytical variability.

1. Inspect the current hyperspectral image and spectra.

2. Confirm that additive background subtraction is scientifically appropriate.

3. Open Manual Background Removal.

4. Draw a clean background-only rectangular ROI.

5. Inspect the average background spectrum.

6. Click baseline points along the broad background trend.

8. Inspect the interpolated baseline and corrected average spectrum.

9. Redefine the points if genuine features are being removed.

10. Apply the baseline to the entire dataset.

11. Inspect several corrected spectra from different image regions.

12. Continue downstream analysis only after verifying that correction is spatially and spectrally reasonable.

Quality Control After Correction

After applying the correction, inspect spectra from:

  • The original background ROI.
  • Representative sample regions.
  • Regions known to contain important spectral features.

The correction should improve the intended baseline problem without creating new artifacts.

COMMON PROBLEM - CORRECTED BACKGROUND IS NOT NEAR EXPECTED LEVEL The manually selected baseline points may not represent the true background trend.

Repeat the workflow and select different baseline points.

Common Problem - Real Features Disappear

One or more baseline points may have been placed on genuine spectral features.

Move the baseline points to regions that better represent the underlying background.

Common Problem - Large Edge Excursions

The baseline may be poorly constrained near the spectral boundaries.

Add suitable baseline points closer to the edges or restrict interpretation to the well-supported spectral range.

Common Problem - Different Image Regions Are Over-corrected

The assumption of one global additive baseline may not hold across the full field of view.

Consider a spatially varying correction strategy.

Common Problem - Roi Is Not Pure Background

If the selected ROI contains sample signal, that signal becomes part of the estimated baseline and will be subtracted from every spectrum.

Choose a cleaner ROI and repeat the correction.

Background correction can improve classification when the unwanted additive component varies independently of the classes of interest.

However, if correction removes class-discriminating information or introduces artifacts, model performance can worsen.

Evaluate preprocessing choices using proper validation rather than assuming that baseline correction is always beneficial.

Subtracting a manually estimated baseline changes the measured intensity scale.

Any quantitative interpretation after correction should be compatible with the baseline-subtraction model and should use the same preprocessing consistently across samples.

Important

Manual background removal is an operator-guided preprocessing transformation.

Its validity depends on the quality of the background ROI, the selected baseline points, the assumption of an additive background, and the assumption that one baseline is appropriate for the entire cube.

Always inspect corrected spectra before using the result for quantitative analysis or predictive modeling.

Manual Background / Baseline Removal Close Manual Background Removal help.