Giter Site home page Giter Site logo

lamyj / sycomore Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 4.0 7.04 MB

MRI simulation toolkit

Home Page: https://sycomore.readthedocs.io/

License: MIT License

CMake 1.79% Python 15.60% C++ 82.30% MATLAB 0.21% C 0.10%
mri simulation epg configuration-mo bloch-simulation mri-simulation-toolkit extended-phase-graphs diffusion magnetization-transfer

sycomore's Introduction

Sycomore — an MRI simulation toolkit

Conda Version

Sycomore is an MRI simulation toolkit providing isochromat simulation and Extended Phase Graph (EPG). Sycomore is a Python packge in which all computationnaly-intensive operations are run by a C++ backend, providing a very fast runtime.

Sycomore is free software, released under the MIT license, and its source code is available on GitHub.

Installation

Packaged versions of Sycomore are available on Anaconda for Linux, macOS and Windows.

To install from Anaconda, type conda install -c conda-forge sycomore. Additional details, including building from source, are provided in the documentation.

Usage

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

import numpy
import sycomore
from sycomore.units import *

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

model = sycomore.epg.Regular(species)
signal = numpy.zeros(train_length, dtype=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)
    
    signal[echo] = model.echo

T2 decay in RARE

The features and data structures are described in the documentation:

sycomore's People

Contributors

lamyj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sycomore's Issues

Code running on single core

We are running the code on a Ubuntu Server 18.4 (all the needed dependencies are installed), but we cannot see the code running in multiple cores. Indeed we observed that the code uses just a single core (both with the local built version and with the one installed from pip). Is that the normal behaviour?


Furthermore we wanted to understand if it is right to compute a model for each species, is there any other way to create multiple species?

  • Operating system: Ubuntu Server 18.4
  • Sycomore version: latest
  • Python version: 3.6.9

Concerning documentation of Species

Thanks for sharing this work!

I have a question regarding how to specify dephasing in Specifies. In the documentation dephasing is set with delta_omega=0*rad/s. The use of rad in the units suggests this is an angular frequency, i.e., w = 2pi*f. However, in the code it is treated as a frequency:

auto const angular_frequency =
        2*M_PI * (
            // Field-related dephasing
            delta_omega_Hz
            // FIXME: delta_omega of species 
            // // Species-related dephasing, e.g. chemical shift or susceptibility
            // + species.delta_omega
        )

I'm I missing something, or should the documentation be changed to delta_omega=0*Hz?

Thanks!

Build error in standalone Python wrappers

I am trying to compile the git version of the code, because I would like to use the new off_resonance method, which is not in the released version.

After starting the python setup.py install I receive the following error (after 80%):

epg/simd_api.txx:285:57: error: implicit instantiation of undefined template 'xsimd::batch<std::__1::complex<double>, 4>'
    auto const simd_end = states_count - states_count % Batch::size;

Note that if I build the library with cmake command (as suggested in the documentation) it seems to build the library. Should I use this builded version in my python code?

System configuration

  • Operating system: MACOS
  • Sycomore version: the one in the master branch (not yet released)
  • Python version: 3.7.3
  • Compiler version: Clang version 12.0.0

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.