Sycomore – an MRI simulation toolkit#
Sycomore is an MRI simulation toolkit providing isochromat simulation and Extended Phase Graph (EPG) (both regular and discrete, including 3D). Sycomore is a Python package in which all computationally-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 with 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
#include <sycomore/epg/Regular.h>
#include <sycomore/Species.h>
#include <sycomore/units.h>
int main()
{
using namespace sycomore::units;
sycomore::Species const species(1000*ms, 100*ms);
auto const TE = 4*ms;
int const train_length = 40;
sycomore::epg::Regular model(species);
sycomore::TensorC<1> signal({train_length}, 0);
model.apply_pulse(90*deg);
for(int echo=0; echo<train_length; ++echo)
{
model.apply_time_interval(TE/2);
model.apply_pulse(180*deg);
model.apply_time_interval(TE/2);
signal[echo] = model.echo();
}
return 0;
}