Uncategorized

Proton Spin Visualization

The below WebGL application can be used to visually experiment with proton precession behaviors. This was prepared for use by students in the EBME460 course at Case Western Reserve University.

Drag a properly-structured text file into the upload region below. Once the application loads your file, you can hit play to view your simulation. Use your mouse to change viewing angles, and the scroll wheel to zoom. Toggling breadcrumbs off may improve performance on some devices.

Header Formatting

Data should be stored in a .txt file.
The first line of the .txt file should be a string identifying the name of your sequence.
The second line of the .txt file should be the timestep used for your simulation. (in milliseconds)
Your simulation data should begin on the third line.

Data Formatting

The data section of the .txt file is occupied by chunks of data representing the change in magnetization vectors over time for various spins. Demarkate the beginning of a specific spin’s data with the break character “|” on a new line. After this break character, each line in the text file should be occupied with a single Vector3 indicating the state of the current vector at a specific timepoint. Vectors should occupy the range from 0 to 1 and should be encoded as floating points with 6 decimals of precision in the following format, including parenthesis:
(x.xxxxxx, y.yyyyyy, z.zzzzzz)

Simple Example

The following is a sample with three spins that don’t change over time. Each points along a different axis.

SampleData
0.010000
|
(1.000000,0.000000,0.000000)
(1.000000,0.000000,0.000000)
(1.000000,0.000000,0.000000)
|
(0.000000,1.000000,1.000000)
(0.000000,1.000000,1.000000)
(0.000000,1.000000,1.000000)
|
(0.000000,0.000000,1.000000)
(0.000000,0.000000,1.000000)
(0.000000,0.000000,1.000000)

Sample Files

Below are a few sample txt files you can use to experiment with the above visualizer, or to help you better understand the format required.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.