diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-sycomore.spec | 327 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 329 insertions, 0 deletions
@@ -0,0 +1 @@ +/sycomore-1.3.2.tar.gz diff --git a/python-sycomore.spec b/python-sycomore.spec new file mode 100644 index 0000000..8007387 --- /dev/null +++ b/python-sycomore.spec @@ -0,0 +1,327 @@ +%global _empty_manifest_terminate_build 0 +Name: python-sycomore +Version: 1.3.2 +Release: 1 +Summary: MRI simulation toolkit +License: MIT +URL: https://sycomore.readthedocs.io/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/70/3e/ac6ad805186e9057786e58ee55d0da38618210b078bd844bff1bc15c5b56/sycomore-1.3.2.tar.gz + +Requires: python3-numpy + +%description +# Sycomore — an MRI simulation toolkit + +[](https://pypi.org/project/sycomore/) +[](https://anaconda.org/conda-forge/sycomore) + +Sycomore is an MRI simulation toolkit providing Bloch simulation, Extended Phase Graph (EPG) (both regular and discrete, including 3D), and Configuration Model. 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][]. + +A sample web application, using Sycomore paired with [Bokeh][] is available on [Heroku][]: it presents classical MRI experiments (RARE, RF-spoiling, slice profile with a selective sinc pulse), using the different simulation models of Sycomore. + +## Installation + +Packaged versions of Sycomore are available on [pypi][] and [Anaconda][] for Linux, macOS and Windows. + +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][], [xsimd][] 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][] using [regular EPG][] and plots the transverse magnetization of each echo. + +```python +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() +``` + + + +The features and data structures are described in the documentation: + +- [Common features](https://sycomore.readthedocs.io/en/latest/common_features.html) +- [Bloch simulation](https://sycomore.readthedocs.io/en/latest/bloch.html) +- [Extended Phase Graph](https://sycomore.readthedocs.io/en/latest/epg/index.html) +- [Configuration Model](https://sycomore.readthedocs.io/en/latest/como.html) + +[Anaconda]: https://anaconda.org/conda-forge/dicomifier +[Bokeh]: https://bokeh.org +[Boost.Test]: https://www.boost.org/doc/libs/release/libs/test/ +[CMake]: https://cmake.org/ +[documentation]: https://sycomore.readthedocs.io/en/latest/installation.html +[GitHub]: https://github.com/lamyj/sycomore/ +[Heroku]: https://sycomore.herokuapp.com/ +[MIT license]: https://en.wikipedia.org/wiki/MIT_License +[pybind11]: http://pybind11.readthedocs.io/ +[pypi]: https://pypi.org/project/sycomore/ +[RARE sequence]: https://doi.org/10.1002/mrm.1910030602 +[regular EPG]: https://sycomore.readthedocs.io/en/latest/epg/regular.html +[xsimd]: https://xsimd.readthedocs.io/ + + + + +%package -n python3-sycomore +Summary: MRI simulation toolkit +Provides: python-sycomore +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-sycomore +# Sycomore — an MRI simulation toolkit + +[](https://pypi.org/project/sycomore/) +[](https://anaconda.org/conda-forge/sycomore) + +Sycomore is an MRI simulation toolkit providing Bloch simulation, Extended Phase Graph (EPG) (both regular and discrete, including 3D), and Configuration Model. 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][]. + +A sample web application, using Sycomore paired with [Bokeh][] is available on [Heroku][]: it presents classical MRI experiments (RARE, RF-spoiling, slice profile with a selective sinc pulse), using the different simulation models of Sycomore. + +## Installation + +Packaged versions of Sycomore are available on [pypi][] and [Anaconda][] for Linux, macOS and Windows. + +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][], [xsimd][] 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][] using [regular EPG][] and plots the transverse magnetization of each echo. + +```python +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() +``` + + + +The features and data structures are described in the documentation: + +- [Common features](https://sycomore.readthedocs.io/en/latest/common_features.html) +- [Bloch simulation](https://sycomore.readthedocs.io/en/latest/bloch.html) +- [Extended Phase Graph](https://sycomore.readthedocs.io/en/latest/epg/index.html) +- [Configuration Model](https://sycomore.readthedocs.io/en/latest/como.html) + +[Anaconda]: https://anaconda.org/conda-forge/dicomifier +[Bokeh]: https://bokeh.org +[Boost.Test]: https://www.boost.org/doc/libs/release/libs/test/ +[CMake]: https://cmake.org/ +[documentation]: https://sycomore.readthedocs.io/en/latest/installation.html +[GitHub]: https://github.com/lamyj/sycomore/ +[Heroku]: https://sycomore.herokuapp.com/ +[MIT license]: https://en.wikipedia.org/wiki/MIT_License +[pybind11]: http://pybind11.readthedocs.io/ +[pypi]: https://pypi.org/project/sycomore/ +[RARE sequence]: https://doi.org/10.1002/mrm.1910030602 +[regular EPG]: https://sycomore.readthedocs.io/en/latest/epg/regular.html +[xsimd]: https://xsimd.readthedocs.io/ + + + + +%package help +Summary: Development documents and examples for sycomore +Provides: python3-sycomore-doc +%description help +# Sycomore — an MRI simulation toolkit + +[](https://pypi.org/project/sycomore/) +[](https://anaconda.org/conda-forge/sycomore) + +Sycomore is an MRI simulation toolkit providing Bloch simulation, Extended Phase Graph (EPG) (both regular and discrete, including 3D), and Configuration Model. 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][]. + +A sample web application, using Sycomore paired with [Bokeh][] is available on [Heroku][]: it presents classical MRI experiments (RARE, RF-spoiling, slice profile with a selective sinc pulse), using the different simulation models of Sycomore. + +## Installation + +Packaged versions of Sycomore are available on [pypi][] and [Anaconda][] for Linux, macOS and Windows. + +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][], [xsimd][] 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][] using [regular EPG][] and plots the transverse magnetization of each echo. + +```python +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() +``` + + + +The features and data structures are described in the documentation: + +- [Common features](https://sycomore.readthedocs.io/en/latest/common_features.html) +- [Bloch simulation](https://sycomore.readthedocs.io/en/latest/bloch.html) +- [Extended Phase Graph](https://sycomore.readthedocs.io/en/latest/epg/index.html) +- [Configuration Model](https://sycomore.readthedocs.io/en/latest/como.html) + +[Anaconda]: https://anaconda.org/conda-forge/dicomifier +[Bokeh]: https://bokeh.org +[Boost.Test]: https://www.boost.org/doc/libs/release/libs/test/ +[CMake]: https://cmake.org/ +[documentation]: https://sycomore.readthedocs.io/en/latest/installation.html +[GitHub]: https://github.com/lamyj/sycomore/ +[Heroku]: https://sycomore.herokuapp.com/ +[MIT license]: https://en.wikipedia.org/wiki/MIT_License +[pybind11]: http://pybind11.readthedocs.io/ +[pypi]: https://pypi.org/project/sycomore/ +[RARE sequence]: https://doi.org/10.1002/mrm.1910030602 +[regular EPG]: https://sycomore.readthedocs.io/en/latest/epg/regular.html +[xsimd]: https://xsimd.readthedocs.io/ + + + + +%prep +%autosetup -n sycomore-1.3.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-sycomore -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.2-1 +- Package Spec generated @@ -0,0 +1 @@ +c3cb66d9908ee362dc98bafa39aafe63 sycomore-1.3.2.tar.gz |
