RadioGraphics
HOME HELP FEEDBACK SUBSCRIPTIONS ARCHIVE SEARCH
 QUICK SEARCH:   [advanced]


     


Published online September 7, 2007, 10.1148/rg.e27

(RadioGraphics 2007;27:e27.)

A more recent version of this article appeared on November 1, 2007
This Article
Right arrow Abstract Freely available
Right arrow Figures Only
Right arrow Full Text (PDF)
Right arrow CME Test (opens in a new window)
Right arrow MPEG Movies
Right arrow All Versions of this Article:
e27v5
27/6/e27    most recent
Right arrow Submit a response
Right arrow Alert me when this article is cited
Right arrow Alert me when eLetters are posted
Right arrow Alert me if a correction is posted
Services
Right arrow Email this article to a friend
Right arrow Similar articles in this journal
Right arrow Similar articles in PubMed
Right arrow Alert me to new issues of the journal
Right arrow Download to citation manager
Right arrow reprints & permissions
Citing Articles
Right arrow Citing Articles via Google Scholar
Google Scholar
Right arrow Articles by Hanson, L. G.
Right arrow Search for Related Content
PubMed
Right arrow PubMed Citation
Right arrow Articles by Hanson, L. G.
© RSNA, 2007

Online Only

A Graphical Simulator for Teaching Basic and Advanced MR Imaging Techniques1

Lars G. Hanson, MSc, PhD

1 From the Danish Research Center for Magnetic Resonance, Copenhagen University Hospital Hvidovre, Dept 340, Kettegård Allé 30, DK-2650 Hvidovre, Denmark. Presented as an education exhibit at the 2006 RSNA Annual Meeting. Received July 17, 2007; revision requested August 9; revision received and accepted August 10. Address correspondence to the author (email: larsh{at}drcmr.dk).


    Abstract
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
Teaching of magnetic resonance (MR) imaging techniques typically involves considerable handwaving, literally, to explain concepts such as resonance, rotating frames, dephasing, refocusing, sequences, and imaging. A proper understanding of MR contrast and imaging techniques is crucial for radiologists, radiographers, and technical staff alike, but it is notoriously challenging to explain spin dynamics by using traditional teaching tools. The author developed a freely available graphical simulator based on the Bloch equations to aid in the teaching of topics ranging from precession and relaxation to advanced concepts such as stimulated echoes, spin tagging, and k-space-methods. A graphical user interface provides the user with a three-dimensional view of spin isochromates that can be manipulated by selecting radiofrequency pulses and gradient events. Even complicated sequences can be visualized in an intuitive way. The cross-platform software is primarily designed for use in lectures, but is also useful for self studies and student assignments.

Movies available at http://radiographics.rsnajnls.org/cgi/content/full/e27/DC1.


    Introduction
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
Most important concepts of magnetic resonance (MR) imaging rely on spin dynamics in radiofrequency (RF) and magnetic fields changing in time and space. Mathematically, the situation is described by the Bloch equations (1), which describe the time evolution of a magnetization and the effects of relaxation. The equations themselves are difficult to interpret for the non-expert. Their remarkable consequences, reflected in the multitude of MR imaging techniques, are hard to grasp for non-experts and experts alike. The equations, nevertheless, express nothing but common sense, and an intuitive understanding of the techniques are within reach of even the most nontechnical minds. This view may seem provocative, since many have spent years studying MR techniques without getting an intuitive feel for them. It is a common view among those enlightened, however, that MR imaging physics is not nearly as complicated as we all believe it is when we start studying it.

For students of MR imaging, the understanding of spin dynamics is often perceived as being on a steep part of the learning curve. The MR imaging teacher is, however, left with rather limited means of communicating this aspect of the topic. Use of blackboards or slides is useful, but the dynamic aspects are difficult and time-consuming to illustrate with static pictures. Often the result is confusing with regard to the long sequences of gradient and RF pulses used in MR imaging. The basics are typically illustrated with handwaving and use of sticks to represent magnetic fields and magnetizations. Teachers face an anatomic limit because dephasing and refocusing of spins are aspects difficult to illustrate with just two arms. Even the important basic concept of MR itself is dauntingly hard to illustrate with hand motions. This could be a reason it is often left unexplained or wrongly described as a quantum effect (ie, as a nonclassical phenomenon). Teaching more complex issues such as phase rolls and stimulated echoes to nontechnical students is a challenge that few can overcome without casualties.

Considerable simulation and presentation resources are available on the Web (eg, animated GIF [2] or MPEG formatted (3) files that illustrate concepts such as precession or spin echoes). The need for additional animations has been pointed out and examples have been presented (4,5). Prerecorded animations are of significant value but deprive presentations of spontaneity and leave the teacher unprepared to answer all the "what if" questions. Furthermore, the preparation of new animations is time-consuming and requires software tools. Multimedia players such as Flash and Shockwave (Adobe Systems, San Jose, Calif) offer interactivity that can enhance the learning experience (6,7). The e-MRI site described in reference 7 is a valuable resource for students as well as teachers. However, the available e-learning tools for MR imaging are fairly limited, as they show only specific facets chosen by the programmer. They do not, for example, offer the teacher or student the possibility of exploring pulse sequences beyond those preprogrammed, and thereby an important motivating factor is missed.

The need for flexibility is instead met by simulators such as those previously described that calculate simulated images (810). If sufficiently fast, such programs can be useful in a teaching context, but they do not illustrate the basics of MR imaging, rather the result. Reference 10 describes SIMRI, a versatile Bloch equation solver that also contains a module called SpinPlayer (not part of the current SIMRI 2.0 release available on the Internet), which can illustrate spin dynamics during a preprogrammed sequence. Hence, it has some of the elements needed for teaching basic MR imaging, but the real-time aspects are apparently limited. It could be useful for creating educational animations. The same applies to Matlab software (MathWorks, Natick, Mass), available on the Internet, for solving the Bloch equations (11). This educational tool is not targeted at nontechnical students but is suitable for exercises for students capable of programming.

The purpose of this article is to present a unique, simple, and powerful interactive tool to help teach basic and advanced MR imaging. More specifically, graphical freeware that illustrates spin dynamics is provided for common PC platforms. The software allows the user to manipulate and monitor the magnetization of a number of isochromates (ensembles of spins experiencing the same field) in the laboratory and in rotating frames. The magnetic and RF field strengths are adjustable in the software. Gradient and RF events can be played out and the resulting MR signals monitored. Downloading and installation procedures are described in reference 12.

The software is designed for real-time use during lectures and has been tested extensively in this context. It can also be used to record movies for lectures or home pages on the Web. With adequate introduction, it can be used for student assignments that allow, for example, solutions to be presented to the class or saved as movies.

The technical Methods section describes the design of the software and the equations that it simulates. Reading of this section is not necessary for using or understanding the developed program. The Results section presents example animations that illustrate the visualization capabilities of the software. Finally, the user experience is discussed.


    Methods
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
The Bloch equations (1) are the basis of all MR imaging techniques. They are the equations of motion for macroscopic magnetization M(t) (isochromate) in a magnetic field B(t) that is typically composed of a strong static field B0 (conventionally chosen to define the z axis) and a weaker RF field B1(t) orthogonal to B0. The RF field has time-varying amplitude and is chosen to have circular polarization. Such a field is generated by a normal quadrature transmit coil. The Bloch equations include the influence of the surrounding thermal bath by the presence of relaxation terms expressing exponential loss of phase coherence (T2 relaxation) and return to thermal equilibrium, M = (0,0,M0) (T1 relaxation). The component-wise Bloch equations can be combined in a single vector equation that describes precession in the stationary and rotating fields as well as relaxation:


Formula

For specific applications, the Bloch equations are sometimes used in extended forms (eg, including effects of diffusion [13]). These forms are not significant for typical MR applications and are not considered here. In contrast, spatial and temporal field variations are important for basically all MR applications, and the representation of multiple spin isochromates is a significant feature of teaching software.

Design goals of the software were defined as follows:

The scientific programming language Interactive Data Language (IDL; ITT Visual Information Systems, Boulder, Colo) was chosen for the implementation for several reasons. It is a high-level language used in many imaging laboratories; it is supported on multiple platforms, including Windows, Linux, and Macintosh; it supports two-dimensional and three-dimensional (3D) graphics without the need for extra software libraries; and it has a "direct graphics" mode that is sufficiently fast for real-time visualizations and supports the export of GIF animations. For the present application, it is important that a "virtual machine" version of IDL be provided for free by the vendor. This allows users to run the developed software without a costly license. Compared to stand-alone software with the necessary libraries linked statically, the chosen strategy requires more disk space (~200 MB for a virtual machine installed with standard settings). Also, the software developer is required to have an IDL license.


    Views and Program Interaction
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
The developed software is installed and executed as described on the download page (12). An important part of the user interface is a large 3D view of the magnetizations of the spin isochromates. Each is shown as a (colored) vector (Mx,My,Mz) together with its projections in the (Mx,My) and (Mz,My) planes. These "shadows on the floor and wall" of the 3D coordinate system enhance the depth perception and underline the importance of the transverse and longitudinal components of the magnetizations. The view also shows how each isochromate is influenced by RF fields that exert a time-varying "push" orthogonally to the direction of magnetization (the torque). The torque vector is shown in red, together with its wall and floor projections. The resonance condition is fulfilled when this push consistently changes the angle between the magnetization and the B0 field.

In two smaller two-dimensional coordinate systems that are also part of the user interface, "sliding window" representations of the time evolution of relevant parameters are provided (a 5-second history with "present" at the right side of the graph). One graph is chosen to show a transverse component of the magnetization (proportional to the voltage that would be induced in a surface coil) and a transverse component of the RF field. If the two curves oscillate with the same frequency, the resonance condition is fulfilled. Another graph shows the magnitude of the transverse magnetization, which is proportional to the MR signal amplitude.

The opening view after program initiation is a single precessing dipole. The three graphs are updated approximately 20 times per second, so the user gets an immediate impression of the dynamic character of the displays. The user can proceed in several ways:

The Scene menu is responsible for much of the flexibility of the program, as a wide range of initial conditions can be chosen:

Simplicity was a main design criterion for the user interface. Field and relaxation properties of the isochromates therefore cannot be varied independently by use of the sliders. There is, for example, just one B0 slider and one T2 slider, although the isochromates can experience different environments. B0 is chosen as a field offset, so changing it will adjust the overall precession frequency and leave field differences unchanged. In contrast, the T2 slider sets the transverse relaxation rate of all isochromates to the same value. This choice was made to keep the interface simple while allowing important concepts to be demonstrated in an intuitive way.

The effects of B0 on the equilibrium magnetization and on signal amplitude are not modeled by the software. They could be included, but it would be confusing and would interfere with the use of B0 and RF frequency transformations for shifting to and from the rotating frame of reference. These field effects, which are not included in the Bloch equations either, are omitted because they are better explained independently. The shown magnetizations and signals can be thought of as being scaled by their field-dependent counterparts.

No units are given for the parameters entering the simulation. This choice was made for several reasons. First, it would be difficult to guarantee that a relaxation time given in seconds would actually be in seconds for slow hardware. Second, whereas it makes sense to give the relaxation times in seconds and the RF frequency in hertz, it would be awkward to specify the magnetic fields in, for example, nanotesla, as that would introduce a nonintuitive scaling between magnetic fields and RF frequencies (only fields of such low amplitude give precession frequencies suitable for visualizations). Instead equal settings of the field and frequency slider bars are chosen to reflect resonance, which corresponds to choosing a gyromagnetic ratio of 1. The intuitive choice of letting relaxation times correspond approximately to seconds is made silently though not guaranteed in general (not true on slow hardware). The frequencies do not have units approximating hertz, however, as they would then have awkwardly low numerical values in most simulations. Instead, scalings are chosen so that most relevant values are near unity. As the actual frequencies are about eight orders of magnitude different anyway, this choice of units is made for maximum convenience. As the effects of changing the fields are directly visible, the units are somewhat irrelevant and were left out to avoid confusion about their meaning.

In addition to the three help pages "General info," "Buttons and windows," and "Challenges" triggered by the "Help" button, hints about usage are presented as text one-liners updated on button or slider activation. Button and slider events are also reflected in the main window, as their activation triggers the brief appearance of a message about the event. This helps an audience follow the actions chosen via the interface, and it facilitates understanding of recorded animations.


    Implementation Details
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
In order to get the needed flexibility, arrays of data records were chosen as the data structures representing different environments and spin isochromates. A view is represented as a list of magnetic environments. Each of these contains a pointer to an array of magnetization properties for isochromates experiencing that environment.

Use of hardware-supported accelerated graphics is not well supported by the IDL software, and it would impose unnecessary graphics card requirements. Hence, the "direct vector graphics mode" of IDL was chosen for the implementation, as this allows fast and limited screen updates. It supports binary "exclusive-or" drawing, meaning that when new graphics are added to an existing display, the binary operator is used to merge the two. This provides a simple and fast method for letting one graphical object move another without the latter being permanently distorted. To add an object and later restore the original scene, the object simply has to be drawn twice in each position. This method is excellent for vector graphics. Flickering displays are avoided by showing only complete images on screen. Hence, drawing is done in a hidden "pixmap" that, when ready, is copied to the visual display between screen updates.

The component-wise differential Bloch equations were solved by using a fast first-order Runge-Kutta method (14) with time steps much smaller than the characteristic time scales. For field values that are relevant to visualization, this method is sufficiently precise to ensure that deviations from exact behavior are insignificant.

Program execution is chosen to be event driven, with events generated by button presses, menu selections, slider activations, and timers. The timer events are used to trigger updates of the field and magnetization parameters and corresponding screen updates. This has the advantage of making program timing as independent as possible of the hardware used. It also saves other processes running on the computer from being starved. One timing event typically triggers the next, so even on a very slow machine the event queue will not overflow.

The "Anaglyph" button changes the viewing mode so that all lines in the 3D window are double-drawn in red and green as seen from slightly different viewpoints. If the display is viewed with appropriate 3D glasses with red and green eye-pieces, the depth perception is enhanced, as Mx and My appear to protrude from the display.

Use of the Anaglyph mode is by no means necessary but enhances the perception of the "Gradient" and "Structure" views in particular. Additional presses of the "Anaglyph" button adapt the red-green separation for different viewer-to-display distances.

When the "Record" button is activated, a subset of the subsequent views displayed in the 3D window are saved in in a file named "movie.gif" in animated GIF format.

When the button is pressed again (now renamed "Stop Recording"), the recording stops. An upper limit of frames is set to avoid accidental exhaustion of disk resources. A series of animations were made in this way to demonstrate the use of the program. The animations were converted to MPEG format, and commentary soundtracks were added by using the free FFmpeg software that runs on most platforms (15).


    Results
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
This section contains output from the program in the form of screen dump (Figure) and animations with narrations (MPEG movies showing, eg, resonance, relaxation, refocusing, and phase rolls). The animations present basic MR imaging concepts to illustrate typical use of the program.


Figure 1
View larger version (57K):
[in this window]
[in a new window]
[Download PPT slide]
 
Screen dump of the display of the developed software made during simulated excitation of seven isochromates experiencing d ifferent B0 fields ("Weak inhomogeneity" chosen in the "Scene" pull-down menu on the left followed by a press of the "90x selective" button). The scene is shown in the rotating frame of reference. Hence, the apparent B0 field and the RF frequency are both zero. Red bars in the 3D view indicate the current "push" of the RF waves on the isochromates.

 
Many additional ideas for use can be found in the "Help"/"Challenges" section of the program.


    Discussion
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 
All design goals of the software have been met. Although the use of the software is intuitive, it is not self-explanatory or suited for being the only source of information. Rather it is meant to supplement lectures and textbooks.

Although animations such as those presented can be used in lectures, interactive use of the program is strongly recommended. In addition to adding spontaneity, interactive use provides additional views of signal and field evolutions.

Combined with traditional presentation means, various versions of the program have been used extensively for MR imaging education over the 5-year development period. Mixed audiences of graduate medical students, radiologists, physicists, computer scientists, and radiographers have been included. The courses have been consistently well-attended, with a low dropout rate, even though they have not been credit bearing. The use of interactive simulations in the lectures is believed to be a main factor in explaining this, as the simulations have often received praise from students and never criticism (at least outspoken). Over the same period, the software has matured so that it now appears in a form appropriate for use by a wider audience of teachers and students. Preliminary experience with voluntary student homework requiring use of the simulator has been positive, as the students who have tried the exercises have demonstrated a good understanding of the topics covered. They have typically done additional experiments beyond those suggested, which is perceived as a positive outcome. The experience with simulator-based exercises is limited so far, however, as course evaluations are not yet available.

In conlcusion, a unique and valuable teaching tool has been developed. It is distributed at no cost for typical computer architectures and operating systems (12). The simulator is deceptively simple and easy to use but provides insight into the complex physics of MR imaging.


    Footnotes
 

Abbreviations: RF = radiofrequency, 3D = three-dimensional

Summary Statement: The author has developed a freely available graphical simulator based on the Bloch equations to aid in the teaching of MR topics ranging from precession and relaxation to advanced concepts such as stimulated echoes, spin tagging, and k-space-methods.


    References
 Top
 Abstract
 Introduction
 Methods
 Views and Program Interaction
 Implementation Details
 Results
 Discussion
 References
 

  1. Bloch F. Nuclear induction. Phys Rev 1946;70:460–473.
  2. Hornak JP. The basics of MRI, 1996. Web book available at http://www.cis.rit.edu/htbooks/mri/. Accessed July 17, 2007.
  3. Hargreaves B. MRI movies, 2005. Animations available at http://www-mrsrl.stanford.edu/~brian/mri-movies/. Accessed July 17, 2007.
  4. Patti JW, Jones SE, Mullins ME. MRI the movie: building and intuition (abstr). In: Radiological Society of North America annual meeeting program. Oak Brook, Ill: Radiological Society of North America, 2004;736.
  5. Jones SE, Patti JW, Mullins ME. MRI movie: the sequel. In: Radiological Society of North America annual meeeting program. Oak Brook, Ill: Radiological Society of North America, 2005;820.
  6. Moriel M. Introduction to MRI: a Shockwave movie, 2004. Animation available at http://www.simplyphysics.com/ Accessed July 17, 2007.
  7. Hoa D, Micheau A, Gahide G. Creating an interactive web-based e-learning course: a practical introduction for radiologists. Radiographics 2006;26:e25.
  8. Rundle D, Kishore S, Seshadri S, Wehrli F. Magnetic resonance imaging simulator: a teaching tool for radiology. J Digit Imaging 1990;3:226–229.
  9. Drobnjak I, Gavaghan D, Suli E, Pitt-Francis J, Jenkinson M. Development of a functional magnetic resonance imaging simulator for modeling realistic rigid-body motion artifacts. Magn Reson Med 2006;56:364–380.
  10. Benoit-Cattin H, Collewet G, Belaroussi B, Saint-Jalmes H, Odet C. The SIMRI project: a versatile and interactive MRI simulator. J Magn Reson 2005;173:97–115.
  11. Hargreaves B. Bloch equation simulation, 2002. Matlab equation solver available at http://www-mrsrl.stanford.edu/~brian/bloch/ Accessed July 17, 2007.
  12. Hanson LG. Bloch simulator for IDL virtual machine, 2007. Available at http://www.drcmr.dk/bloch Accessed July 17, 2007.
  13. Torrey HC. Bloch equations with diffusion terms. Phys Rev 1956;104:563–565.
  14. Press W, Teukolsky S, Vetterling W, Flannery B. Numerical recipes in C (the art of scientific computing). Cambridge University Press, 1992.
  15. FFmpeg multimedia system, trademark of Fabrice Bellard, originator of the FFmpeg project, 2001–2005. Available at http://ffmpeg.mplayerhq.hu/ Accessed July 17, 2007.




This Article
Right arrow Abstract Freely available
Right arrow Figures Only
Right arrow Full Text (PDF)
Right arrow CME Test (opens in a new window)
Right arrow MPEG Movies
Right arrow All Versions of this Article:
e27v5
27/6/e27    most recent
Right arrow Submit a response
Right arrow Alert me when this article is cited
Right arrow Alert me when eLetters are posted
Right arrow Alert me if a correction is posted
Services
Right arrow Email this article to a friend
Right arrow Similar articles in this journal
Right arrow Similar articles in PubMed
Right arrow Alert me to new issues of the journal
Right arrow Download to citation manager
Right arrow reprints & permissions
Citing Articles
Right arrow Citing Articles via Google Scholar
Google Scholar
Right arrow Articles by Hanson, L. G.
Right arrow Search for Related Content
PubMed
Right arrow PubMed Citation
Right arrow Articles by Hanson, L. G.


HOME HELP FEEDBACK SUBSCRIPTIONS ARCHIVE SEARCH
RADIOGRAPHICS RADIOLOGY RSNA JOURNALS ONLINE