Skip to main content

MR image simulator for teaching purposes

Project description

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].

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–2025 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.1.5.tar.gz (104.8 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.1.5-py3-none-any.whl (106.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spinsight-1.1.5.tar.gz
  • Upload date:
  • Size: 104.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.6.0

File hashes

Hashes for spinsight-1.1.5.tar.gz
Algorithm Hash digest
SHA256 3db77c2e3ac0b708bd448200d251c0fae1905793f9d405267298c191dc2dbc95
MD5 1480216f9cb813049c5fe814f879de85
BLAKE2b-256 6649996b0a93a00f664c7c2e8f48fef43f28f49e18813b934fbb8f4f6667bd1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spinsight-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 106.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.6.0

File hashes

Hashes for spinsight-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5fd2e2194e23484ce5b6f63c2276b067413a296cc7a49cd5f21bd1627f9e8040
MD5 c2e9505fe65d0ba708d52b6481686329
BLAKE2b-256 091b2b77f04fd02e77fc7289a3a30c1673564fab49474a1a6d8c7c0fd6292f01

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