Skip to content

Repository files navigation


PyPI versionDocumentation StatusPython Package TestsPublication

surfalize is a python package for analyzing microscope topography measurement data in terms of surface roughness and other topographic parameters. It is intended primarily for microtextured surfaces and is supposed to replace software packages such as MountainsMap, MultiFileAnalyzer and Gwyddion for the most common tasks.

Surfalize WebApp (beta)

Surfalize is now also available as an interactive webapp under surfalize.com, running entirely clientside powered by pyodide.

Disclaimer

The authors make no guarantees for the correctness of any results obtained using this package. The package is an early work in progress and may introduce changes to both implementation details and public API at any point in time. Any results should be validated against established software to verify their correctness, especially when they are intended to be used for scientific publications.

Some parts of the package are more mature and some are in early development stage.

Cite this library

If you publish data generated with this library, please consider citing this publication:

F. Schell, C. Zwahr, A. F. Lasagni. Surfalize: A Python Library for Surface Topography and Roughness Analysis Designed for Periodic Surface Structures. Nanomaterials. 2024, 13, 1076.

How to install

To install the latest release of surfalize, run the following command:

pip install surfalize

If you want to install from source, clone this git repository and run the following command in the root folder of the cloned repository.

pip install .

While earlier versions used Cython, the current version is pure Python and can be installed without a C-compiler.

Documentation

The documentation is hosted on readthedocs.

Currently supported file formats

ManufacturerFormatReadingWriting
Keyence.vk3, .vk4, .vk6, .vk7YesNo
Keyence.cagOnly extractionNo
Keyence.zonYesNo
Olympus.lextYesNo
Olympus.oir, .poirYesNo
Leica.pluYesNo
Sensofar.plu, .pluxYesNo
Digital Surf.surYesYes
KLA Zeta.zmgYesNo
Wyko.opdYesNo
Nanofocus.nmsYesNo
Alicona.al3dYesYes
Digital Surf.sdfYesYes
Gwyddion.gwyYesNo
Digital Metrology.os3dYesNo
IAU FITS Working Group.fitsYesNo
Zygo.datYesNo
OpenFMC.x3pYesNo
TrueMap.tmdYesYes
General.xyzYesNo

Supported roughness parameters

This package aims to implement all field parameters defined in ISO 25178-2:2021. Currently, the following parameters are supported:

CategoryParameterFull nameValidated against
HeightSaArithmetic mean heightGwyddion, MountainsMap
SqRoot mean square heightGwyddion, MountainsMap
SpMaximum peak heightGwyddion, MountainsMap
SvMaximum valley depthGwyddion, MountainsMap
SzMaximum heightGwyddion, MountainsMap
SskSkewnessGwyddion, MountainsMap
SkuKurtosisGwyddion, MountainsMap
HybridSdr1Developed interfacial area ratioGwyddion2, MountainsMap
SdqRoot mean square gradientMountainsMap
SpatialSalAutocorrelation length-
StrTexture aspect ratio-
StdTexture direction-
SswDominant spatial wavelength-
FunctionalSkCore roughness depthMountainsMap
SpkReduced peak heightMountainsMap
SvkReduced dale heightMountainsMap
SpkxMaximum peak height-
SvkxMaximum pit depth-
Sak1Area of the hills-
Sak2Area of the dales-
Smr1 / Smrk1Material ratio 1MountainsMap
Smr2 / Smrk2Material ratio 2MountainsMap
Smr(c)Areal material ratioMountainsMap
Smc(mr)Inverse areal material ratioMountainsMap
SxpPeak extreme heightMountainsMap
SdcMaterial ratio height difference-
Functional (volume)VmpPeak material volumeMountainsMap
VmcCore material volumeMountainsMap
VvvDale void volumeMountainsMap
VvcCore void volumeMountainsMap
Vm(p)Material volume-
Vv(p)Void volume-
FeatureSpdDensity of peaksMountainsMap
SvdDensity of pitsMountainsMap
SpcArithmetic mean peak curvatureMountainsMap
SvcArithmetic mean pit curvatureMountainsMap
S5pFive-point peak heightMountainsMap
S5vFive-point pit depthMountainsMap
S10zTen-point heightMountainsMap

1 Per default, Sdr calculation uses the algorithm proposed by ISO 25178 and also used by MountainsMap By keyword argument, the Gwyddion algorithm can be used instead.
2 Gwyddion does not support Sdr calculation directly, but calculates surface area and projected area.

The feature parameters are computed by watershed segmentation of the surface into hills and dales, followed by Wolf pruning at a threshold given by the pruning keyword argument (default 5 % of Sz, per ISO 25178-3). By default, motifs that touch the border of the evaluation area are treated as incomplete and excluded from the feature set, matching the default of MountainsMap; this can be switched off with the exclude_edge=False keyword argument. The segmentation can be visualized with Surface.plot_feature_segmentation().

Supported profile roughness parameters

The Profile class supports the calculation of profile roughness parameters. Profiles can be extracted from a Surface (e.g. via get_horizontal_profile, get_vertical_profile or get_oblique_profile) or constructed directly. The peak/valley parameters Rp, Rv and Rz are evaluated per sampling length and averaged over the evaluation length according to ISO 4287, controlled by the n_sections argument (default 5).

CategoryParameterFull name
HeightRa, Rq, Rp, Rv, Rz, RtAmplitude parameters
Rsk, RkuSkewness, kurtosis
HybridRdqRoot mean square slope
FunctionalRk, Rpk, RvkCore / reduced peak / reduced dale
Rpkx, RvkxMaximum peak height / pit depth
Rak1, Rak2Area of the hills / dales
Rmr1 / Rmrk1, Rmr2 / Rmrk2Material ratios
Rmr(c), Rmc(mr)(Inverse) material ratio
Rxp, RdcExtreme height / ratio height diff
Functional (volume)Vmp, Vmc, Vvv, Vvc, Vm(p), Vv(p)Volume parameters

Supported parameters of 1d-periodic surfaces

Additionally, this package supports the calculation of non-standard parameters for periodic textured surfaces with one- dimensional periodic structures. The following parameters can be calculated:

ParameterDescription
PeriodDominant spatial period of the 1d-surface texture
DepthPeak-to-valley depth of the 1d-texture profiles
Aspect ratioRatio of peak-to-valley depth to spatial period
HomogeneityHomogeneity factor (0 < H < 1) calculated from Gini analysis
OrientationClockwise angle of the dominant texture to the vertical axis

Supported operations

OperationDescription
LevelingSubtraction of least squares fit to a plane
ZeroingSets the lowest datapoint of the surface to zero
CenteringSets the average value of the surface elevation to zero
ZoomingMagnifies the surface by a specified factor
CroppingCrops the surface in a specified rectangle
RotationRotates the surface by a specified angle in degrees
AlignmentAligns the surface with the dominant texture direction by rotation
Outlier removalRemoves outliers outside n standard deviation from the mean
ThresholdingThresholding based on areal material ratio
FilteringApplies a Gaussian highpass, lowpass or bandpass filter
MaskingExcludes rectangular, circular or thresholded regions from analysis

About

A python module to analyze surface roughness and periodic texture parameters

Topics

Resources

Stars

68 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages