European Commission logo

Description           Download          Workflow            MSPA-Parameters     MSPA-Examples  


MSPA (Morphological Spatial Pattern Analysis) is a customized sequence of mathematical morphological operators targeted at the description of the geometry and connectivity of the image components. Based on geometric concepts only, this methodology can be applied at any scale and to any type of digital images in any application field. The foreground area of a binary image is divided into seven visually distinguished MSPA classes: Core, Islet, Perforation, Edge, Loop, Bridge, and Branch. The MSPA segmentation results in 25 mutually exclusive feature classes which, when merged, exactly correspond to the initial foreground area. More details are illustrated in the MSPA-Guide and the morphology product sheet

The following image illustrates the MSPA segmentation procedure of a binary mask:

The key features of MSPA include:
1. Detection of connecting pathways,
2. Distinction of external versus internal background (detection of holes),
3. User-driven analysis scale.

Further details on MSPA can be found in Morphological Segmentation of Binary Patterns. Additional MSPA related publications are Mapping Spatial PatternsMapping Landscape CorridorsMapping Functional ConnectivityScale Analysis, Neutral Model Analysis (1) and (2), Green InfrastructureDetecting Key ConnectorsRanking Riparian CorridorsLandscapeRestoration, Classifying Zooplankton.

MSPA benefits from expertise in mathematical morphology by Pierre Soille, EC-JRC.


  • MSPA and additional image processing software is included in the free software GTB (GuidosToolbox) and GWB (GuidosToolbox Workbench).
  • GIS-plugin with documentation and installation info for ArcGISQGIS3 and R. Note: These plugins are do not provide the full feature set, please use GTB or GWB instead.

If you use MSPA, please add the following reference: 
Soille P, Vogt P, 2009. Morphological segmentation of binary patterns. Pattern Recognition Letters 30, 4:456-459, DOI: 10.1016/j.patrec.2008.10.015

IMPORTANT: MSPA results in 25 feature classes, see page 6 in the MSPA-Guide. In many cases, fewer classes are sufficient, which can be derived with the Simplified Pattern Analysis (SPA), see page 9 in the MSPA-Guide.


  1. Preparation of the binary foreground/background mask: The expert (user) selects the appropriate input data which must provide the features of interest to be detected. The input data is then pre-processed by the expert into a binary foreground/background map, where foreground corresponds to the target of interest and background is the complement to foreground. Examples for landcover binary masks could be a forest/nonforest mask, a wetland/non-wetland mask, a grassland/non-grassland mask, etc.
  2. MSPA analysis: The user can apply the default settings for the 4 MSPA parameters or modify them in order to fine-tune the edge-width of the resulting classes and/or detect connecting elements of a pre-defined width. More information on these 4 settings can be found in the MSPA-Guide or below.
  3. Interpretation of the MSPA segmentation: The generic naming scheme of the MSPA classes may need to be amended to match the nature of the input data. For example the class Perforation is the surrounding of a foreground hole. For a forest mask, such a foreground hole could be called a forest 'opening' while for a wetland mask such a hole is an 'island' (= a hole in a lake).

The MSPA-parameters can be amended to increase the edge-width of the resulting classes, or the user could perform a second analysis using a revised definition of foreground/background. 



The following images show the effects of changing the 4 MSPA-parameters Foreground ConnectivityEdgeWidthTransition, and Intext. More details on these 4 MSPA-parameters can be found in the MSPA-Guide within GuidosToolbox.

MSPA-parameter 1: Foreground Connectivity: the white circles show the difference when using 8- (left image) or 4-connectivity (right image) for Foreground Connectivity.

MSPA-parameter 2: EdgeWidth: increasing the EdgeWidth will increase the non-core area at the expense of the core-area and may change the pattern class (white circles). Changing the EdgeWidth has no impact on the total foreground coverage.

MSPA-parameter 3: Transition: transition can be set to either show connecting elements into core area (white circles, left image) or hide these transition pixels to maintain closed perimeters for the classes perforation and edge.

MSPA-parameter 4: Intext: Intext can be used to add a second layer of classes inside perforations to the 7 basic classes (see the pixel value examples). When Intext is on (1) a pixel offset of 100 is added to the feature classes in the internal areas of the foreground objects. More details on Intext including a detailed table with pixel values can be found in the MSPA-Guide included in GuidosToolbox. 

Parameter 4: Intext (811 <Intext>).
Left: Intext on (8111). Right: Intext off (8110)

The image above shows the difference in foreground pixel values only. In addition, and when using the default setting Intext=1 the internal Background is segmented into the two categories Core-Opening and Border-Opening (see below).


MSPA examples:

The following images illustrate MSPA examples for

1) MSPA detecting connecting structures: a water mask in Finland:
lakes (blue), rivers connecting more than one lake (red), rivers feeding one lake only (green), islands (yellow).

2) MSPA detecting connecting structures: Lost in a maze? No problem, let MSPA find the way out!


3) MSPA detecting external/internal background (holes): Example of deforestation in the Amazon, Rondonia, Brazil. Forest perforations (blue) and other pattern classes; exported as Google Earth image overlay using GuidosToolbox.


4) MSPA in manufacturing quality control: Example of simulated manufacturing defects on a circuit board:
Upper circle: introduction of a hole and a mis-aligned via. Bottom circle: opening the left ring structure changes the class loop into branch. Filling the right ring structure changes the class loop into core and bridge. 
The comparison of a MSPA image against a MSPA-template can be used to detect incorrectly-sized, misplaced, insufficient, damaged, or missing components in manufacturing.

5) MSPA in medical images: Example of X-ray of Homer Simpson:
Brain showing impact of too much Duff but the connection to the brain is still active... Similarly, deviations from a pre-defined thickness can be detected, e.g., thinning or thickening of arteries.


6) MSPA for climate change analysis: Spatial pattern of Sea-Ice showing openings (yellow) in a large ice-field (ENVISAT-Meris, 29/08/2006).

7) MSPA in oceanography: Identification of zooplankton.

Contact: peter.vogt[at]