Package: virtual-scanner
Virtual ScannerVirtual Scanner is an end-to-end hybrid Magnetic Resonance Imaging (MRI) simulator/console designed to be zero-footprint, modular, and supported by open-source standards.This project is a winning response to theISMRM 2019 Junior Fellow Challenge (Africa), which poses the task of boosting accessibility to MRI training resources for underserved areas such as sub-Saharan Africa. We designed Virtual Scanner to help develop local expertise in these areas so that sustained deployment of MRI hardware is possible. Importantly, Virtual Scanner will be continually developed as a research tool that provides functionalities for simulating and prototyping MRI acquisition methods as well as services for sharing computational methods and resources with researchers around the world. Please read our publication in the journal of open souce softwarehere.Virtual Scanner consists of two modes: in Standard Mode, a console-like GUI allows users to perform virtual scans and conduct basic analysis; in Advanced Mode, modular simulation/analysis of the entire signal chain may be performed.Quick StartIf you just want to get started with using Virtual Scanner:Install Python 3.6.x.Create and activate a virtual environment of your choice.In your terminal:pip install virtual-scanner, and finally,In macOS, run the command:virtualscanner; in Windows, run this longer command within the main folder where you created your virtual environment:python Lib/site-packages/virtualscanner/coms/coms_ui/coms_server_flask.pyThe browser application should have started running. To access the browser app, there are two ways:Local hosting (only on the laptop running the script): go to the generated link (http://0.0.0.0:5000/) if you are a mac user, and this link (http://127.0.0.1:5000) if you are a windows user.Remote hosting : look up your IP address. Suppose it's 123.45.67.890, then you can go to (http://123.45.67.890:5000) to connect to the server remotely, either on the serving machine or different machines on the same network.Now you can start playing with Virtual Scanner! Log in with your email address, select Standard or Advanced mode, and click "Begin Scan". Instructions for each tab are given in theWiki.Docker StartThis would be a good solution if you don't want to install the large number of dependencies to your host. We have tested Docker on Windows and Mac.If you use a Windows 10 Pro system, first download Docker desktop and then run the following in the command line:$dockerrun-p5000:5000imrframework/virtual-scanner:latestThis downloads the pre-built image from Docker. You can then open up your browser to127.0.0.1:5000to see the interface.If you use a Windows 10 Home system, please use an alternate approach (clone the repository or pip install) because Docker isn't supported on this system and we have not succeeded in using the image with Docker Toolbox.If you use a Mac, you can either download the image as described above or you can locally build a Docker container to run the application in the following way:First, build the container from theDockerfile:$dockerbuild-tvirtualscanner.Then you can run the container and bind port 5000 to expose the application to the host:$dockerrun-p5000:5000virtualscannerAnd open up your browser to0.0.0.0:5000to see the interface.
The container isnot intendedfor a production deployment, but rather is appropriate for local usage.Pro StartIf you want to hack around with the code:Install Python 3.6.x.Create and activate a virtual environment of your choice. Here's atutorialif you are using the
PyCharm IDE, for example.Clone the repo andcdinto it.pip install -e ..Open the repo in your favourite IDE, hack around with the code.Runvirtualscanner/coms/coms_ui/coms_server_flask.pyto run your changes.Read the API documentationhereand run the Python test scripts in each module with more options available than allowed on the GUI.Standard ModeTheRegisterpage allows you to choose a phantom for simulation. Its format is similar to the form for entering information of the subject when conducting real scans. Choose the "Numerical" phantom for all simulations now.TheAcquirepage allows the user to choose either a Gradient Echo (GRE) or a Spin Echo (SE, with optional inversion recovery) sequence, enter the parameters, and simulate them on a cylindrical phantom ("Numerical") containing spheres with different T1, T2, and PD values.TheAnalyzepage allows the user to load a series of data acquired in ISMRM/NIST phantom for T1 or T2 mapping and conduct curve fitting to obtain T1 and T2 maps. In addition, it can detect spheres in the phantom, a feature useful for comparing generated parameter values to literature values.Advanced ModeTheTx(RF transmit) page allows one to calculate and plot SAR from pulseq .seq files.This feature is under development.TheRx(RF receive) page allows one to visualize time-domain MR signal, generated from an arbitrary grayscale image, and see the effects of using different demodulation frequencies and ADC sampling rate.This feature is under development.Other features, including phantom and sequence viewers and reconstruction methods, are in active development.Known IssuesPlease refer to theKnown Issuesdocument.ContributingIf you would like to contribute to Virtual Scanner, please take a look at theCommunity Guidelinesdocument.