Skip to main content

MR image simulator for teaching purposes

Project description

License: GPL v3

SpinSight MRI simulator

SpinSight is an MRI simulator written in Python and created for educational puposes. It jointly visualizes the imaging parameters, the MRI pulse sequence, the k-space data matrix, and the MR image. These are updated in near real-time when the user changes parameters. The simulator is run as a web browser dashboard. The data is simulated from computational 2D phantoms in vector graphics format (SVG).

Running the Simulator

Install using pip:

pip install spinsight

Then run as a command line tool

spinsight

This serves SpinSight on the local host, so that the simulator can be run by navigating to localhost in the web browser. The same command line tool can be used to deploy the simulator on a local network, or on a web server (run spinsight -h for help). Be aware that several minutes are required upon loading a phantom for the first time.

Phantom construction

To create a new phantom, add a directory with the phantom name under spinsight/phantoms. This directory shall contain specifications in a .toml file with the same name (see brain.toml for reference). The specified .svg file must meet the following specifications:

  • All paths must be closed
  • All paths must have a fill color matching a hexcolor defined in the TISSUES dict in constants.py (this defines the tissue).
  • Only polygons are supported (not Bézier curves etc)

Alternatively a second .toml file can be specified with a list of shapes (see Shepp-Logan_shapes.toml for reference).

Dependencies

See pyproject.toml under heading [tool.poetry.dependencies].

How to cite

If you use this software in your research, please cite:

Berglund J, Jain K, Sousa JM, Hedman K, Fahlström M. “SpinSight – An educational open-source MRI simulator with joint visualization of pulse sequence, k-space, and MR image. In: Proceedings of the Annual Meeting of the International Society of Magnetic Resonance in Medicine, Honolulu 2025, pp. 1968.

License

SpinSight is distributed under the terms of the GNU General Public License. See LICENSE.md.

Contact Information

Johan Berglund, Ph.D.
Uppsala University Hospital,
Uppsala, Sweden
johan.berglund@akademiska.se


Copyright © 2021–2026 Johan Berglund.

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

spinsight-1.3.1.tar.gz (631.0 kB view details)

Uploaded Source

Built Distribution

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

spinsight-1.3.1-py3-none-any.whl (119.9 kB view details)

Uploaded Python 3

File details

Details for the file spinsight-1.3.1.tar.gz.

File metadata

  • Download URL: spinsight-1.3.1.tar.gz
  • Upload date:
  • Size: 631.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spinsight-1.3.1.tar.gz
Algorithm Hash digest
SHA256 5e2712e5a4027b19d225900df495a10471479c80d4136bac195a2cdc3c49e047
MD5 cc8016a2839c98ac04f99f4660724b69
BLAKE2b-256 52fcec7dc45f38ebc311aa89898254559be2b898ef10fe5c354b62bacd0a19de

See more details on using hashes here.

File details

Details for the file spinsight-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: spinsight-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 119.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spinsight-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06afd102457a8604120bdd0f8f103b6ea24094a278c4e3e876f6776087495706
MD5 a16ef33c50f6dd8f9c4238215efbc327
BLAKE2b-256 485bd5af893e8b1b37aed78e194f80e29af265cdd76fd31e6da9a34152f066c5

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