GithubHelp home page GithubHelp logo

kanaricc / syris Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ufo-kit/syris

0.0 0.0 0.0 837 KB

X-ray imaging simulation

License: GNU Lesser General Public License v3.0

Python 85.55% C 14.35% Makefile 0.10%

syris's Introduction

Syris

https://img.shields.io/badge/Python-3.6+-blue https://badge.fury.io/py/syris.png https://github.com/ufo-kit/syris/actions/workflows/tests.yml/badge.svg?branch=master Documentation Status

Syris (synchrotron radiation imaging simulation) is a framework for simulations of X-ray absorption and phase contrast dynamic imaging experiments, like time-resolved radiography, tomography or laminography. It includes X-ray sources, various sample shape creation possibilities, complex refractive index lookup options, motion model and indirect detection model (scintillator combined with a conventional camera). Phase contrast is simulated by the Angular spectrum method, which enables one to include various optical elements in the simulation, e.g. gratings and X-ray lenses.

Compute-intensive algorithms like Fourier transforms, sample shape creation and free-space propagation are implemented by using OpenCL, which enables one to execute the code on graphic cards.

There are numerous examples of how to use syris described below which ship directly with the code. Enjoy!

Usage

The first thing you have to do is to initialize syris by the syris.init() function. After that you only need to do whatever is necessary for your program. A simple white beam propagation example looks like this:

import matplotlib.pyplot as plt
import numpy as np
import quantities as q
import syris
from syris.physics import propagate
from syris.bodies.simple import make_sphere
from syris.materials import make_henke

syris.init()
energies = np.arange(10, 30) * q.keV
n = 1024
pixel_size = 0.4 * q.um
distance = 2 * q.m
material = make_henke('PMMA', energies)

sample = make_sphere(n, n / 4 * pixel_size, pixel_size, material=material)
image = propagate([sample], (n, n), energies, distance, pixel_size).get()
plt.imshow(image)
plt.show()

For more detailed information please see the reference.

Examples

Are stored in the examples directory. Make sure you install their dependencies by pip install -r requirements-examples.txt and then you can run them from the top-level directory of syris repository by e.g. python -m examples.simple.

Citation

If you use this software for publishing your data, we kindly ask to cite the article below.

Faragó, T., Mikulík, P., Ershov, A., Vogelgesang, M., Hänschke, D. & Baumbach, T. (2017). J. Synchrotron Rad. 24, https://doi.org/10.1107/S1600577517012255

syris's People

Contributors

tfarago avatar joeman17 avatar

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.