Logo der PTB - Messen, Forschen, Wissen

Software

PTB Working Group 8.42 provides software implementations within the scope of scientific publications. The software can be downloaded free of charge for noncommercial use. The corresponding publications should be cited when publishing results produced by the software.

Disclaimer: All applications were developed at Physikalisch-Technische Bundesanstalt (PTB). PTB assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, safety, suitability or any other characteristic. In no event will PTB be liable for any direct, indirect or consequential damage arising in connection with the use of this software.

Measurement uncertainty

Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting

Magnetic Resonance Fingerprinting (MRF) is a promising method in quantitative magnetic resonance (MR) imaging. MRF is based on a sequence of highly undersampled MR images which are analyzed with a pre-computed dictionary leading to estimates of the relaxation times T1 and T2. To calculate uncertainties for these dictionary-based MRF estimates, the Working Group 8.42 has developed a Bayesian uncertainty quantification, which assumes a homoscedastic Gaussian model for the reconstructed magnetization images. The proposed approach was validated by simulated as well as phantom and in vivo data. 

Opens external link in new windowSoftware

Related Publication: Selma Metzner, Gerd Wübbeler, Sebastian Flassbeck, Constance Gatefait, Christoph Kolbitsch and Clemens Elster (2021). Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting. Physics in Medicine & Biology (2021), 66(7), 075006 [DOI: 10.1088/1361-6560/abeae7].

Expert: Selma Metzner

Bayesian sample size planning in type A uncertainty evaluation

An easy-to-use GUI for sample size planning and inference based on Bayesian statistics and a method developed in the working group 8.42. No foreknowledge  in Bayesian statistics is required.

Opens external link in new windowSoftware

Related Publication: J.Martin and C. Elster. GUI for Bayesian sample size planning in type A uncertainty evaluation. Measurement Science and Technology (Opens external link in new windowaccepted manuscript).

Expert: Jörg Martin

A simple method for Bayesian uncertainty evaluation in linear models

Metrologists often possess useful prior knowledge about the measurand which cannot be accounted for by the GUM uncertainty framework. PTB Working Group 8.42 has developed a simple Bayesian uncertainty evaluation scheme which accounts for prior knowledge about the measurand and the employed measurement device. The proposed approach can be applied to a class of linear models as often encountered in metrology, and it provides a coherent treatment of small numbers of observations, including the case of a single observation only. The calculation of the posterior distribution is carried out by means of a simple Monte Carlo sampling scheme avoiding the application of Markov Chain Monte Carlo methods. In order to ease the application of the proposed Bayesian uncertainty evaluation, corresponding Python software is made available.

Opens external link in new windowSoftware

Related Publication: G. Wübbeler, M. Marschall and C. Elster (2020). A simple method for Bayesian uncertainty evaluation in linear models. Metrologia [DOI: 10.1088/1681-7575/aba3b8]

Experts: Gerd WübbelerManuel Marschall

An introductory example for Markov chain Monte Carlo (MCMC)

When the Guide to the Expression of Uncertainty in Measurement (GUM) and methods from its supplements are not applicable, the Bayesian approach may be a valid and welcome alternative. Evaluating the posterior distribution, estimates or uncertainties involved in Bayesian inferences often requires numerical methods to avoid high-dimensional integrations. Markov chain Monte Carlo (MCMC) sampling is such a method—powerful, flexible and widely applied. PTB Working Group 8.42 has developed a concise introduction, illustrated by a simple, typical example from metrology. Accompanied with few lines of software code to implement the most basic and yet flexible MCMC method, interested readers are invited to get started. MATLAB as well as R source code are available in the related publication.

Opens external link in new windowSoftware (in publication)

Related Publication: K. Klauenberg und C. Elster Markov chain Monte Carlo methods: an introductory example. Metrologia, 53(1), S32, 2016. [DOI: Opens external link in new window10.1088/0026-1394/53/1/S32

Expert: Katy Klauenberg

WinBUGS software for the analysis of immunoassay data

For the analysis of immunoassay data, PTB Working Group 8.42 has developed WinBUGS software code to perform MCMC sampling from the posterior distribution for the calibration parameters and the unknown concentration. This software is available in Opens external link in new windowA Guide to Bayesian Inference for Regression Problems.

Opens external link in new windowSoftware (in publication)

Expert: Katy Klauenberg

MCMC implementation for the analysis of magnetic field fluctuation thermometry

For the analysis in magnetic field fluctuation thermometry, PTB Working Group 8.42 has developed a MATLAB software package to perform MCMC sampling from the posterior distribution of the calibration parameters and to subsequently estimate temperatures. This software is available in the electronic supplement to the related Opens external link in new windowpublication.

Opens external link in new windowSoftware (electronic supplement to the paper)

Related Publication: G. Wübbeler, F. Schmähling, J. Beyer, J. Engert and C. Elster Analysis of magnetic field fluctuation thermometry using Bayesian inference. Measurement Science and Technology, 23(12), 125004, 2012. [DOI: Opens external link in new window10.1088/0957-0233/23/12/125004]

Expert: Gerd Wübbeler

Large-scale data analysis

A smoothness informed Low-Rank reconstruction method

Performing high-resolution measurements is an important and challenging task, which often involves long measurement times. To reduce the time-consuming measurement process, the Working Group 8.42 has developed a new “Low-Rank” reconstruction method, which incorporates smoothness information of the dataset, to recover the full data from a smaller set of observations. In a cooperation with Working Group 7.11 and the FU-Berlin, the algorithm was applied to FTIR measurements of complex biological specimens. With only 5% of the original data, a successful reconstruction of the complete dataset was observed. In order to make this algorithm accessible, a corresponding Python software is made available, which can be easily adjusted to various types of data and application.

Opens external link in new windowSoftware

Related Publication: M. Marschall, Andrea Hornemann, Gerd Wübbeler, Arne Hoehl, Eckart Rühl, Bernd Kästner and Clemens Elster (2020). Compressed FTIR spectroscopy using low-rank matrix reconstruction. Optics Express, Vol. 28, Issue 26, pp. 38762-38772 (2020) [DOI: 10.1364/OE.404959].

Expert: Manuel Marschall

Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting

Magnetic Resonance Fingerprinting (MRF) is a promising method in quantitative magnetic resonance (MR) imaging. MRF is based on a sequence of highly undersampled MR images which are analyzed with a pre-computed dictionary leading to estimates of the relaxation times T1 and T2. To calculate uncertainties for these dictionary-based MRF estimates, the Working Group 8.42 has developed a Bayesian uncertainty quantification, which assumes a homoscedastic Gaussian model for the reconstructed magnetization images. The proposed approach was validated by simulated as well as phantom and in vivo data. 

Opens external link in new windowSoftware

Related Publication: Selma Metzner, Gerd Wübbeler, Sebastian Flassbeck, Constance Gatefait, Christoph Kolbitsch and Clemens Elster (2021). Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting. Physics in Medicine & Biology (2021), 66(7), 075006 [DOI: 10.1088/1361-6560/abeae7].

Expert: Selma Metzner

Deep learning

Inspecting adversarial examples using the fisher information

This software implements a method for the detection of adversarial examples based on the Fisher information, presented in the Neurocomputing article "Inspecting adversarial examples using the fisher information". Written in python.

Opens external link in new windowSoftware

Related Publication: J. Martin and C. Elster Inspecting adversarial examples using the fisher information. Neurocomputing, 382 80--86, 2020. [DOI: 10.1016/j.neucom.2019.11.052].

Expert: Jörg Martin

Sampling procedures in legal metrology

Hypothesis-based acceptance sampling for the MID

This R Shiny app is an interactive web-application to calculate optimal sampling plans for statistical conformity assessment according to the modules F and F1 of the European Measuring Instruments Directive (MID).

Opens external link in new windowSoftware

Related Publication: K. Klauenberg, C. A. Müller and C. Elster Hypothesis-based acceptance sampling for modules F and F1 of the European Measuring Instruments Directive. Statistics and Public Policy, 2021. [DOI: Opens external link in new window10.1080/2330443X.2021.1900762].

Expert: Katy Klauenberg

Shapiro-Wilk test

To support the statistical verification of the Normal distribution, PTB working group 8.42 has developed an Excel application, which implements the Shapiro-Wilk test for multiple samples. This application was designed specifically for the Opens external link in new windowqualification procedure in legal metrology and includes the so-called Bonferroni correction.

[more]

Initiates file downloadSoftware (Microsoft Excel (created under Office 365 ProPlus Version 16.0.11328.20420))

Related Publication: K. Klauenberg and C. Elster Testing normality - An introduction with sample size calculation in legal metrology. tm - Technisches Messen,(online), 2019. [DOI: Opens external link in new window10.1515/teme-2019-0148]

Expert: Katy Klauenberg

Regression

Calibration of a torque measuring system - GUM uncertainty evaluation for least-squares versus Bayesian inference

This R Markdown code shall enable metrologists to perform straight-line regression of measurement data by applying (i) ordinary and weighted least-squares estimation in combination with an uncertainty evaluation following the GUM and (ii) Bayesian inference. This is done for a show case example, but can be adapted to new measurement data.

Opens external link in new windowSoftware (R markdown)

Related Publication: Steffen Martens; Katy Klauenberg and Clemens Elster (2020). EMUE-D6-2-Calibration Uncertainty GUM vs Bayesian. [DOI: 10.5281/zenodo.3858120].

Expert: Katy Klauenberg

Quantifying uncertainty when comparing measurement methods – Haemoglobin concentration as an example of correlation in straight-line regression

In metrology, often two methods measuring the same quantity are to be judged whether or not they are in agreement. For measurements across a whole range of values, this can be done by comparing their straight-line fit to the identity line. Such a comparison is only meaningful, when uncertainties are available. Furthermore, the estimates of the straight-line fit and their uncertainties are only reliable when all sources of uncertainty have been accounted for. When fitting a straight-line relation, the weighted total least-squares (WTLS) method accounts for correlation and uncertainties in both variables. This R code does so for a show case example, but can be adapted to new measurement data.

Opens external link in new windowSoftware (R markdown)

Related Publication: Steffen Martens; Katy Klauenberg; Jörg Neukammer; Simon Cowen; Stephen L. R. Ellison and Clemens Elster (2020). EMUE-D5-4-Method Comparison With Correlation. [DOI: 10.5281/zenodo.3911583].

Ansprechperson: Katy Klauenberg

Calibration of a sonic nozzle as an example for quantifying all uncertainties involved in straight-line regression

When calibrating a sonic nozzle, it is recommended to estimate the straight-line relationship between the discharge coefficient of the nozzle and the square root of the inverse Reynolds number for a gas. This example emphasizes the importance of accounting for correlation for a reliable uncertainty evaluation. To show this, a measurement model based on the weighted total least-squares (WTLS) method is applied and its input quantities are fully characterized. In particular, we demonstrate in detail how to jointly evaluate the correlation, uncertainties and estimates for the input quantities of least-squares methods applying the Monte Carlo method. This R code does so for a show case example, but can be adapted to new measurement data.

Opens external link in new windowSoftware (R markdown)

Related Publication: Steffen Martens; Katy Klauenberg; Bodo Mickan; Catherine Yardin; Nicolas Fischer and Clemens Elster (2020). EMUE-D4-3-Quantify Uncertainties In Calibration. [DOI: 10.5281/zenodo.4016915].

Ansprechperson: Katy Klauenberg

Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting

Magnetic Resonance Fingerprinting (MRF) is a promising method in quantitative magnetic resonance (MR) imaging. MRF is based on a sequence of highly undersampled MR images which are analyzed with a pre-computed dictionary leading to estimates of the relaxation times T1 and T2. To calculate uncertainties for these dictionary-based MRF estimates, the Working Group 8.42 has developed a Bayesian uncertainty quantification, which assumes a homoscedastic Gaussian model for the reconstructed magnetization images. The proposed approach was validated by simulated as well as phantom and in vivo data. 

Opens external link in new windowSoftware

Related Publication: Selma Metzner, Gerd Wübbeler, Sebastian Flassbeck, Constance Gatefait, Christoph Kolbitsch and Clemens Elster (2021). Bayesian Uncertainty Quantification for Magnetic Resonance Fingerprinting. Physics in Medicine & Biology (2021), 66(7), 075006 [DOI: 10.1088/1361-6560/abeae7].

Expert: Selma Metzner

A smoothness informed Low-Rank reconstruction method

Performing high-resolution measurements is an important and challenging task, which often involves long measurement times. To reduce the time-consuming measurement process, the Working Group 8.42 has developed a new “Low-Rank” reconstruction method, which incorporates smoothness information of the dataset, to recover the full data from a smaller set of observations. In a cooperation with Working Group 7.11 and the FU-Berlin, the algorithm was applied to FTIR measurements of complex biological specimens. With only 5% of the original data, a successful reconstruction of the complete dataset was observed. In order to make this algorithm accessible, a corresponding Python software is made available, which can be easily adjusted to various types of data and application.

Opens external link in new windowSoftware

Related Publication: M. Marschall, Andrea Hornemann, Gerd Wübbeler, Arne Hoehl, Eckart Rühl, Bernd Kästner and Clemens Elster (2020). Compressed FTIR spectroscopy using low-rank matrix reconstruction. Optics Express, Vol. 28, Issue 26, pp. 38762-38772 (2020) [DOI: 10.1364/OE.404959].

Expert: Manuel Marschall

An introductory example for Markov chain Monte Carlo (MCMC)

When the Guide to the Expression of Uncertainty in Measurement (GUM) and methods from its supplements are not applicable, the Bayesian approach may be a valid and welcome alternative. Evaluating the posterior distribution, estimates or uncertainties involved in Bayesian inferences often requires numerical methods to avoid high-dimensional integrations. Markov chain Monte Carlo (MCMC) sampling is such a method—powerful, flexible and widely applied. PTB Working Group 8.42 has developed a concise introduction, illustrated by a simple, typical example from metrology. Accompanied with few lines of software code to implement the most basic and yet flexible MCMC method, interested readers are invited to get started. MATLAB as well as R source code are available in the related publication. 

Opens external link in new windowSoftware (in publication)

Related Publication: K. Klauenberg und C. Elster Markov chain Monte Carlo methods: an introductory example. Metrologia, 53(1), S32, 2016. [DOI: Opens external link in new window10.1088/0026-1394/53/1/S32].

Expert: Katy Klauenberg

Bayesian Normal linear regression

In connection with a tutorial, PTB Working Group 8.42 provides software to calculate the posterior distribution of all regression parameters, the regression curve, predictions as well as for estimates, most uncertainties and credible intervals, and also graphically represent these quantities. [more]

Initiates file downloadSoftware in Matlab

Initiates file downloadSoftware in R

Related Publication: K. Klauenberg, G. Wübbeler, B. Mickan, P. Harris and C. Elster A tutorial on Bayesian Normal linear regression. Metrologia, 52(6), 878--892, 2015. [DOI: Opens external link in new window10.1088/0026-1394/52/6/878]

Experts: Katy KlauenbergGerd Wübbeler

WinBUGS software for the analysis of immunoassay data

For the analysis of immunoassay data, PTB Working Group 8.42 has developed WinBUGS software code to perform MCMC sampling from the posterior distribution for the calibration parameters and the unknown concentration. This software is available in Opens external link in new windowA Guide to Bayesian Inference for Regression Problems.

Opens external link in new windowSoftware (in publication)

Expert: Katy Klauenberg

MCMC implementation for the analysis of magnetic field fluctuation thermometry

For the analysis in magnetic field fluctuation thermometry, PTB Working Group 8.42 has developed a MATLAB software package to perform MCMC sampling from the posterior distribution of the calibration parameters and to subsequently estimate temperatures. This software is available in the electronic supplement to the related Opens external link in new windowpublication.

Opens external link in new windowSoftware (electronic supplement to the paper)

Related Publication: G. Wübbeler, F. Schmähling, J. Beyer, J. Engert and C. Elster Analysis of magnetic field fluctuation thermometry using Bayesian inference. Measurement Science and Technology, 23(12), 125004, 2012. [DOI: Opens external link in new window10.1088/0957-0233/23/12/125004]

Expert: Gerd Wübbeler

Analysis of key comparisons

Bayesian hypothesis testing for key comparisons

The assessment of the calibration and measurement capabilities of a laboratory based on a key comparison can often be viewed as carrying out a classical hypothesis test. PTB Working Group 8.42 has developed an alternative Bayesian approach for hypothesis testing which has the advantage that it can include prior assessment about the capabilities of the laboratories participating in the key comparison. In order to ease the application of the proposed Bayesian hypothesis testing for key comparisons, corresponding MATLAB and R software is made available. The software is able to take into account correlations within the key comparison results as well as different prior probabilities of the laboratories. The software also provides routines to enter the key comparison data as well as a graphical representation of the results.

Initiates file downloadSoftware

Related Publication: G. Wübbeler, O. Bodnar and C. Elster (2016). Bayesian hypothesis testing for key comparisons. Metrologia 53(4), [DOI: 10.1088/0026-1394/53/4/1131].

Expert: Gerd Wübbeler

Analysis of dynamic measurements

Evaluation of uncertainties in the application of the DFT

The Fourier transform and its counterpart for discrete time signals, the DFT, are common tools in measurement science and application. Although almost every scientific software package offers ready-to-use implementations of the DFT, the propagation of uncertainties in line with GUM is typically neglected. This is of particular importance in dynamic metrology, when input estimation is carried out by deconvolution in the frequency domain. To this end, we present the new open-source software tool GUM2DFT, which utilizes closed formulas for the efficient propagation of uncertainties for the application of the DFT, inverse DFT and input estimation in the frequency domain. It handles different frequency domain representations, accounts for autocorrelation and takes advantage of the symmetry inherent in the DFT result for real-valued time domain signals.

The methods from this software are also part of the larger Python package PyDynamic, which is hosted on GitHub: Opens external link in new windowhttps://github.com/PTB-PSt1/PyDynamic 

Initiates file downloadSoftware

Related Publication: S. Eichstädt and V. Wilkens "GUM2DFT -- A software tool for uncertainty evaluation of transient signals in the frequency domain". Meas. Sci. Technol. 27(5), 055001, 2016 [DOI: 10.1088/0957-0233/27/5/055001].

Expert: Sascha Eichstädt

PyDynamic - Software for the analysis of dynamic measurements

As part of the EMPIR project 14SIP08 Dynamic the PTB working group 8.42 together with the National Physical Laboratory (UK) develops a comprehensive Python software package, which contains a large variety of methods for the analysis of dynamic measurements.

Opens external link in new windowSoftware

Expert: Sascha Eichstädt

Spectral deconvolution with Richardson-Lucy

The correction of deviations in spectra measured with a spectrometer is often necessary in order to obtain accurate results. The classical approach for such a correction is based on a method by Stearns. However, it has been demonstrated that the Richardson-Lucy method can produce much better results here. Therefore, the PTB Working Group has written a software implementation of an adapted Richardson-Lucy method with an automatic stopping rule. This software includes MATLAB code, a Python code as well as a graphical user interface written in Python.

Initiates file downloadSoftware

Related Publication: S. Eichstädt F. Schmähling G. Wübbeler, K. Anhalt, L. Bünger, K. Krüger and C. Elster (2013). Comparison of the Richardson-Lucy method and a classical approach for spectrometer bandpass correction. Metrologia 50, 107-118 [DOI: 10.1088/0026-1394/50/2/107].

Experts: Sascha EichstädtFranko Schmähling

Monte Carlo for dynamic measurements

The propagation of measurement uncertainties for dynamic measurements using the Monte Carlo propagation of distributions requires efficient implementation in order to achieve a high degree of accuracy, since the computer memory requirement for a standard implementation is very high. In the working group 8.42 a MATLAB software package has been developed to carry out Monte Carlo for dynamic measurements with high accuracy on standard desktop computers.

Initiates file downloadSoftware

Related Publication: S. Eichstädt, A. Link, P. Harris and C. Elster (2012). Efficient implementation of a Monte Carlo method for uncertainty evaluation in dynamic measurements. Metrologia 49, 401-410 [DOI: 10.1088/0026-1394/49/3/401].

Expert: Sascha Eichstädt