Giter VIP home page Giter VIP logo

pymatchseries's Introduction

Actions Status PyPI Coverage Status Code style: black DOI

Description

This is a tool for non-rigid registration, primarily for atomic resolution STEM images, and is a python wrapper of the match-series code developed by B. Berkels. When using this tool, please cite the papers mentioned in that repository and the Zenodo reference at the top of this repo.

The goal of match-series is to remove slow and fast scan noise in STEM image stacks by comparing the various images against each other. The output of the code are X and Y deformation fields for each image in the stack. These deformations can then be applied to stacks of images or to EDX/EELS spectum maps that were acquired frame by frame. The goal of pymatchseries is to facilitate the set-up of the calculation and to work with the results in python. It is intended to use this tool mainly semi-interactively in a Jupyter notebook, see the example.

Try it out here: Binder

To install, simply pip install:

$ pip install --user pyMatchSeries

Note that, since it directly tries to call the matchSeries binary in a subprocess, you must compile and/or install match-series on your own. The program is available via conda install:

$ conda install -c conda-forge match-series

Usage

The tool is intended to work well with hyperspy and relies on it to some extent. The simplified workflow would be:

import hyperspy.api as hs
from pymatchseries import MatchSeries

data = hs.load("path/to/data/file")             # load the image stack
calculation = MatchSeries(data)                 # initialize the calculation
calculation.configuration["lambda"] = 20        # edit configuration
calculation.run()                               # start the calculation
defdata = calculation.get_deformed_images()     # get the "corrected" image stack

Supported data inputs are numpy arrays, dask arrays and hyperspy Signal2D objects, both lazy and non-lazy loaded. The deformations can also be loaded in as a Hyperspy dataset (ComplexSignal2D), and can also be applied to other image datasets and even spectral map time series. For more details check out the example.

Changelog

v0.1.0

  • Significantly simplified the API and made code more future proof
  • Trying out CI/CD pipelines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.