Code Monkey home page Code Monkey logo

eikonalfm's Introduction

Eikonal Fast Marching

eikonalfm is a Python (C++) extension which implements the Fast Marching method for the eikonal equation
$$\lvert\nabla\tau(x)\rvert^2=\frac{1}{c^2(x)},$$
and the factored eikonal equation
$$\lvert(\tau_0\nabla\tau_1 + \tau_1\nabla\tau_0)(x)\rvert^2=\frac{1}{c^2(x)},$$
where $\tau_0(x)=\lvert x-x_s\rvert$.

References

  • J. Sethian. Fast marching methods. SIAM Review, 41(2):199-235, 1999. doi: 10.1137/S0036144598347059. URL https://doi.org/10.1137/S0036144598347059
  • Eran Treister and Eldad Haber. A fast marching algorithm for the factored eikonal equation. Journal of Computational Physics, 324:210-225, 2016.

Requirements

  • Python 3
  • numpy version 1.7 or higher
  • C++11 compiler

Installation

Installation from PyPi:

pip install eikonalfm

Manual install from the repository:

git clone https://github.com/kevinganster/eikonalfm.git
cd eikonalfm
pip install .

or

pip install git+https://github.com/kevinganster/eikonalfm.git

Examples

import numpy as np
import eikonalfm

c = np.ones((100, 100))
x_s = (0, 0)
dx = (1.0, 1.0)
order = 2

tau_fm = eikonalfm.fast_marching(c, x_s, dx, order)
tau1_ffm = eikonalfm.factored_fast_marching(c, x_s, dx, order)

Note that the source position x_s describes an index-vector.

To visualize the results, matplotlib (https://pypi.org/project/matplotlib/) can be used, for example:

import matplotlib.pyplot as plt

# for the distance-function 'x_s' also describes an index-vector
tau0 = eikonalfm.distance(tau1_ffm.shape, dx, x_s, indexing="ij")
plt.contourf(tau0 * tau1_ffm)
plt.show()

eikonalfm's People

Contributors

kevinganster avatar daarknes avatar tfmoraes 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.