pyGuidos - Python interface to main GuidosToolbox (GTB) modules
Copyright (C) 2025-2026 European Union / Joint Research Centre

Authors:
  Giovanni Caudullo
  Peter Vogt     (European Commission, Joint Research Centre)
  Pierre Soille  (European Commission, Joint Research Centre)

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version. See the LICENSE file for the full license text, or
<https://www.gnu.org/licenses/>.


Licensing note (dual-licensing history)
========================================
pyGuidos was originally released under the European Union Public Licence
(EUPL-1.2). Starting with version 2.6.0, which incorporates the
GPLv3-licensed miallib MSPA engine, the project is formally distributed
under the GNU General Public License v3 or later. The EUPL-1.2 is listed as
compatible with the GPLv3, and the GPLv3 applies to the package as a whole.


Third-party components and attribution
=======================================

Morphological Spatial Pattern Analysis (MSPA)
---------------------------------------------
The MSPA engine in `pyguidos/_mspa/miallib/` is a vendored subset of the
`miallib` C library (Morphological Image Analysis library), Copyright (C)
Pierre Soille and collaborators, distributed under the GNU General Public
License v3 or later. The MSPA algorithm and its GuidosToolbox implementation
are the work of Pierre Soille and Peter Vogt (European Commission, Joint
Research Centre).

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

Because pyGuidos incorporates and compiles these GPLv3 sources, the pyGuidos
package as a whole is distributed under the GPLv3 (see LICENSE).

The vendored miallib sources retain their original GPL headers and are kept
as close to upstream as possible. The only changes are two cross-platform
portability fixes, both no-ops on Linux/macOS (LP64) that produce identical
results and have been reported to the upstream authors:
  1. 64-bit Windows (LLP64) pointer safety: the FIFO4 queue element type was
     widened from `long int` to a pointer-sized integer (`intptr_t`) in
     `fifo.h`/`fifo.c`, with matching cast updates in `label.c` and `wshed.c`.
  2. MSVC/Windows build: the POSIX-only `<unistd.h>` include in `miallib.h`
     is guarded so it is skipped under MSVC.

The vendored sources track the upstream miallib and were last synchronised
with the version that fixes the MSPA border/corner handling and uses a
64-bit squared Euclidean distance transform for very large images.
