Skip to main content

MRI simulation toolkit

Project description

Sycomore — an MRI simulation toolkit

Travis Build Status Appveyor Build status PyPI - Wheel Conda Version

Sycomore is an MRI simulation toolkit providing Bloch simulation, Extended Phase Graphs (EPG) (both regular and discrete, including 3D), and Configuration Models. Sycomore is a Python packge in which all computationnaly-intensive operations are run by a C++ backend, providing a very fast runtime and further acceleration through OpenMP.

Installation

Packaged versions of Sycomore are available on pypi and Anaconda for Linux, macOS and Windows. The following table summarizes the availability of packages according to the version of the Python interpreter.

Operating system conda-forge PyPI
Linux 3.6, 3.7 3.5, 3.6, 3.7
macOS (≥ 9) 3.6, 3.7 3.6, 3.7
Windows not available 3.5, 3.6, 3.7

To install from Anaconda, type conda install -c conda-forge sycomore. To install from pypi, type pip3 install sycomore (or pip install sycomore). If you are installing from pypi and no pre-compiled version is available for your platform, pip will try to install from the source archive.

If you need to install Sycomore from source, you will need a C++11 compiler, CMake_ and pybind11_ to successfully build Sycomore. If you want to validate your build of Sycomore, you should run the unit tests, which require Boost.Test.

Additional details are provided in the documentation.

Usage

The following code simulates a single repetition of a simple RARE sequence and plots the transverse magnetization of each echo.

import matplotlib.pyplot
import numpy
import sycomore
from sycomore.units import *

species = sycomore.Species(1000*ms, 100*ms, 1*um**2/ms)
TE = 4*ms
train_length = 40

model = sycomore.epg.Regular(species)
data = numpy.zeros(train_length, dtype=[("time", sycomore.Quantity), ("signal", complex)])

model.apply_pulse(90*deg)
for echo in range(train_length):
    model.apply_time_interval(TE/2)
    model.apply_pulse(180*deg)
    model.apply_time_interval(TE/2)

    data[echo] = (((1+echo)*TE), model.echo)

times = [x.convert_to(ms) for x in data["time"]]
magnitude = numpy.abs(data["signal"])
matplotlib.pyplot.plot(times, magnitude, ".", label="Simulated")
matplotlib.pyplot.plot(
    times, [numpy.exp(-(x*species.R2).magnitude) for x in data["time"]],
    label="$T_2$ decay")

matplotlib.pyplot.ylim(0,1)
matplotlib.pyplot.xlabel("Time (ms)")
matplotlib.pyplot.ylabel("Magnitude")
matplotlib.pyplot.legend()
matplotlib.pyplot.show()

T2 decay in RARE

The features and data structures are described in the documentation:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sycomore-0.6.8.tar.gz (581.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sycomore-0.6.8-cp37-cp37m-win_amd64.whl (887.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

sycomore-0.6.8-cp37-cp37m-manylinux1_x86_64.whl (313.8 kB view details)

Uploaded CPython 3.7m

sycomore-0.6.8-cp37-cp37m-macosx_10_9_x86_64.whl (300.9 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

sycomore-0.6.8-cp36-cp36m-win_amd64.whl (887.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

sycomore-0.6.8-cp36-cp36m-manylinux1_x86_64.whl (314.7 kB view details)

Uploaded CPython 3.6m

sycomore-0.6.8-cp36-cp36m-macosx_10_9_x86_64.whl (300.9 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

sycomore-0.6.8-cp35-cp35m-win_amd64.whl (887.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

sycomore-0.6.8-cp35-cp35m-manylinux1_x86_64.whl (314.7 kB view details)

Uploaded CPython 3.5m

sycomore-0.6.8-cp27-cp27mu-manylinux1_x86_64.whl (314.1 kB view details)

Uploaded CPython 2.7mu

sycomore-0.6.8-cp27-cp27m-macosx_10_9_x86_64.whl (301.5 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

Details for the file sycomore-0.6.8.tar.gz.

File metadata

  • Download URL: sycomore-0.6.8.tar.gz
  • Upload date:
  • Size: 581.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8.tar.gz
Algorithm Hash digest
SHA256 3a1ba6c30dea210db9671a60b3dedc429b0fbc7f1f82c5e8e07a67dd809369ef
MD5 5af2512c6d273b73307649c06cbb384e
BLAKE2b-256 1588f25c9a3ea9be20642976e7fd7d40a448f8c8dbfa66b1a891b824c763a0e5

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 887.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 47d4cc91f21f2d9c575da82730f19b64d2f0c5e00a60825105f06c53d870c6d6
MD5 3b678acfc43e974f647f69ec6c65bddd
BLAKE2b-256 c2d5eaf061e303700215cb3ff61acdced4207897da92fb180a067225aca9927a

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 313.8 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 755513a80460f4162cce3d610b45cc2f128229c5a911d21083fc00ca365d478a
MD5 b0f664ed6fbb65c2ffbddb17a741377e
BLAKE2b-256 00fb8d45d97c2594bbb411274e3a9a964aaacefeefc4626e79054f8643f2a907

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 300.9 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a025c97f5edd1b1f1c9af7ee92b4f5a55f1612d9d7ea694f5eae47556cb85196
MD5 78c71d503f4408b49e60ad22436846c2
BLAKE2b-256 56aa3fca8f69ed088cd5407e37fdc7a4498f1df71267140b2cbf5563ce01e362

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 887.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 450cbb315155754d654b13a08fb161b016c5f17e130239ac561e8c134c18756d
MD5 4cf347105cde5faccc4009f2d2e1e2c5
BLAKE2b-256 fe2f8245a442f20d4e05fa12fed290d00c7d2cb1d0386702061fcf19a2635572

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 314.7 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 32e876e64fa51fcf6fd75acd43ef4b4fd7b8a5e590a4490decd398f238f79ff8
MD5 6bda09a9f4fc7d97e80f21fdc45037c0
BLAKE2b-256 600f9616cd6ca55c6f10bfd88b3670b48d361af2d718f26fc46d1eac18e9631b

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 300.9 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0bd38d3624ec4100e83f36183431ac4bfa1342d7d9342ef78d28e6cb3a4be718
MD5 b6bb8d14a734f58e710d4a7bf433035e
BLAKE2b-256 81d355f359c7796ea52bcd6564897b80c3c32dc0a1a462d957bdf1f5cc3aea28

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 887.0 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e29674381498b39eefa325fa887445078483386ebfa81f59936edc8aa5ec0a66
MD5 cd59ab3cc572f5b5b02e974700421e6a
BLAKE2b-256 e7f24a06636cc0f657f6145cbb6f0c18a60ff849e28300e138aae5209edd61aa

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 314.7 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 78f6cd1fb519b2d73eb28a8ed864a51781f963bf13396c3abb9c4c7f98097e43
MD5 21c3ff76458f5503f6652ff243e80cc3
BLAKE2b-256 f1629143b82aa73ed7402ee600febd370949caca9f21005ecb87370012c35d0b

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 314.1 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b9dfe3f0ce7787bb156f7403d1eb0d6723d417ef34bc0b43183ec93be0fdaf59
MD5 37c73f8987128ee3334dc7c0933bbdac
BLAKE2b-256 56a5bfe108940c3e8cf62a1dca8de60f094b3f95939738886ec19059d40ea84f

See more details on using hashes here.

File details

Details for the file sycomore-0.6.8-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: sycomore-0.6.8-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 301.5 kB
  • Tags: CPython 2.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for sycomore-0.6.8-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 35ff8edc3be22a14c744fff6190e170bb412c7f69d6fad3df7e388705e2e4586
MD5 85b615b1305b434f0a208bd43403cd63
BLAKE2b-256 5efc2e29044a02570a7c11110b41c43380fe4882c43d53dd03c8b30c0d7e5084

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page