Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Python library that unifies Positron Emission Particle Tracking (PEPT) research, including tracking, simulation, data analysis and visualisation tools.
pept
LibraryA Python library that integrates all the tools necessary to perform research using Positron Emission Particle Tracking (PEPT). It includes algorithms for the location, identification and tracking of particles, in addition to tools for visualisation and analysis, and utilities allowing the realistic simulation of PEPT data.
PEPT is a technique developed at the University of Birmingham which allows the non-invasive, three-dimensional tracking of one or more 'tracer' particles through particulate, fluid or multiphase systems. The technique allows particle or fluid motion to be tracked with sub-millimetre accuracy and sub-millisecond temporal resolution and, due to its use of highly-penetrating 511keV gamma rays, can be used to probe the internal dynamics of even large, dense, optically opaque systems - making it ideal for industrial as well as scientific applications.
PEPT is performed by radioactively labelling a particle with a positron-emitting radioisotope such as fluorine-18 (18F) or gallium-66 (66Ga), and using the back-to-back gamma rays produced by electron-positron annihilation events in and around the tracer to triangulate its spatial position. Each detected gamma ray represents a line of response (LoR).
These instructions will help you get started with PEPT data analysis.
This package supports Python 3.7 and above - it is built and tested for Python 3.7, 3.8 and 3.9 on Windows, Linux and macOS (thanks to conda-forge
, which is awesome!).
You can install it using the batteries-included Anaconda distribution or the bare-bones Python interpreter. You can also check out our Python and pept
tutorials here.
The easiest and quickest installation, if you are using Anaconda:
conda install -c conda-forge pept
You can also install the latest release version of pept
from PyPI:
pip install --upgrade pept
Or you can install the development version from the GitHub repository:
pip install --upgrade git+https://github.com/uob-positron-imaging-centre/pept
Some PEPT analysis example scripts are available on pept.readthedocs.io. A minimal script can read PEPT from an online location (e.g. the experiment shown above - two radioactive tracers rotating at 42 RPM), transform the lines of response into accurate tracer locations and plot them in a browser-based interactive 3D graph (live version available here):
A more complete PEPT analysis script can track multiple tracers at the same time, produce "tight", separate trajectories and create multiple interactive Plotly subplots that are opened in a webpage (example live graph here). The resulting trajectories can then be post-processed to extract system-specific data - e.g. residence time distributions.
You can download some PEPT data samples from the UoB Positron Imaging Centre's Repository:
$> git clone https://github.com/uob-positron-imaging-centre/example_data
An absurd amount of time was spent making sure than every function and class in the pept
library is well-documented (and most have examples) and all code is explained through comments - no dragons shall be dwelling in the pept
source code. The library API / reference can be found here - including a search function for quickly finding what you need.
A very fast-paced introduction to Python is available here; it is aimed at engineers whose background might be a few lines written MATLAB, as well as moderate C/C++ programmers.
A beginner-friendly tutorial for using the pept
package is available here.
The links above point to Google Colaboratory, a Jupyter notebook-hosting website that lets you combine text with Python code, executing it on Google servers. Pretty neat, isn't it?
The main purpose of the pept
library is to provide a common, consistent foundation for PEPT-related algorithms, including tracer tracking, visualisation and post-processing tools - such that they can be used interchangeably, mixed and matched for different systems. Virtually any PEPT processing routine follows these steps:
For these algorithm-agnostic steps, pept
provides five base data structures upon which the rest of the library is built:
pept.LineData
: general 3D line samples, formatted as [time, x1, y1, z1, x2, y2, z2, extra...].pept.PointData
: general 3D point samples, formatted as [time, x, y, z, extra...].pept.Pixels
: single 2D pixellised space with physical dimensions, including fast line traversal.pept.Voxels
: single 3D voxellised space with physical dimensions, including fast line traversal.All the data structures above are built on top of NumPy and integrate natively with the rest of the Python / SciPy ecosystem. The rest of the pept
library is organised into submodules:
pept.scanners
: converters between native scanner data and the base classes.pept.tracking
: radioactive tracer tracking algorithms, e.g. the Birmingham method, PEPT-ML, FPI.pept.plots
: PEPT data visualisation subroutines.pept.utilities
: general-purpose helpers, e.g. read_csv
, traverse3d
.pept.processing
: PEPT-oriented post-processing algorithms, e.g. occupancy2d
.Significant effort has been put into making the algorithms in this package as fast as possible. The most computionally-intensive parts have been implemented in C
/ Cython
and parallelised using joblib
and concurrent.futures.ThreadPoolExecutor
. For example, using the peptml
subpackage, analysing 1,000,000 LoRs on the author's machine (mid 2012 MacBook Pro) takes about 26 s.
The tracking algorithms in pept.tracking
successfully scaled up to hundreds of processors on BlueBEAR, the University of Birmingham's awesome supercomputer.
We recommend you check out our tutorials. If your issue is not suitably resolved there, please check the issues page on our GitHub. Finally, if no solution is available there, feel free to open an issue; the authors will attempt to respond as soon as possible.
The pept
library is not a one-man project; it is being built, improved and extended continuously (directly or indirectly) by an international team of researchers of diverse backgrounds - including programmers, mathematicians and chemical / mechanical / nuclear engineers. Want to contribute and become a PEPTspert yourself? Great, join the team!
There are multiple ways to help:
pept
could benefit from.pept
documentation to help other people in the future.Want to be a superhero and contribute code directly to the library itself? Grand - fork the project, add your code and submit a pull request (if that sounds like gibberish but you're an eager programmer, check this article). We are more than happy to work with you on integrating your code into the library and, if helpful, we can schedule a screen-to-screen meeting for a more in-depth discussion about the pept
package architecture.
Naturally, anything you contribute to the library will respect your authorship - protected by the strong GPL v3.0 open-source license (see the "Licensing" section below). If you include published work, please add a pointer to your publication in the code documentation.
If you used this codebase or any software making use of it in a scientific publication, we ask you to cite the following paper:
Nicuşan AL, Windows-Yule CR. Positron emission particle tracking using machine learning. Review of Scientific Instruments. 2020 Jan 1;91(1):013329.
As pept
is a project bringing together the expertise of many people, it hosts multiple algorithms that were developed and published in other papers. Please check the documentation of the pept
algorithms you are using in your research and cite the original papers mentioned accordingly.
Papers presenting PEPT algorithms included in this library:
[1] Parker DJ, Broadbent CJ, Fowles P, Hawkesworth MR, McNeil P. Positron emission particle tracking-a technique for studying flow within engineering equipment. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment. 1993 Mar 10;326(3):592-607.
[2] Nicuşan AL, Windows-Yule CR. Positron emission particle tracking using machine learning. Review of Scientific Instruments. 2020 Jan 1;91(1):013329.
[3] Wiggins C, Santos R, Ruggles A. A feature point identification method for positron emission particle tracking with multiple tracers. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment. 2017 Jan 21;843:22-8.
The pept
package is GPL v3.0 licensed. In non-lawyer terms, the key points of this license are:
Essentially do whatever you want with the code, but don't try selling it saying it's yours :). This is a community-driven project building upon many other wonderful open-source projects (NumPy, Plotly, even Python itself!) without which pept
simply would not have been possible. GPL v3.0 is indeed a very strong copyleft license; it was deliberately chosen to maintain the openness and transparency of great software and progress, and respect the researchers pushing PEPT forward. Frankly, open collaboration is way more efficient than closed, for-profit competition.
Copyright (C) 2021 the pept
developers. Until now, this library was built directly or indirectly through the brain-time of:
FAQs
A Python library that unifies Positron Emission Particle Tracking (PEPT) research, including tracking, simulation, data analysis and visualisation tools.
We found that pept demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.