MR Hardware

From CNI Wiki

Jump to: navigation, search

MR Scanner

The MR Scanner is in room 065 of the CNI suite in Building 420. It has its own wiki page.

The Laima Box (In Process)

Overview of Laima Box

As you may guess from the title, the Laima Box came into being on the urging of Laima to find a solution to reduce the number of frequent issues caused by a complicated display switching system, frequently loose connections to the fORP or Serial Trigger Box and unstable scanner signals. The Laima Box provides a stable and flexible interface to all the display devices, scanner signals, and other peripheral devices that are commonly used during studies.

HDMI Matrix Switch

HDMI switch schematic.
HDMI switch in Laima Box.

We use an 8x8 HDMI Matrix Switch to distribute video signals to all the various displays. This is a Key Digital KD-MS8x8G switch capable of connecting any of 8 input HDMI inputs to any/all of 8 HDMI outputs. The switch is capable of handling 4K HDCP2.2 video signals. The schematic of the switch connections are shown here with all 8 inputs and outputs in use. In order to make a connection to a particular output display, you choose the particular input under the labeled output row of 8 LEDs. This is done by pressing the button under the labeled output (see HDMI Matrix switch image) in order to progress left-to-right through the various inputs. Unfortunately, the blue LEDs on this switch that show what input is currently connected have been burning out, so it's sometimes necessary to count your button presses from a visible LED to know what input you are on.

The default output display for each input is nominally the same number as the input. As you'll note, we have the GE Host computer and GE Table Driver on inputs 1 & 2 -- this is so we can send the GE Host Display to any other display connected to the HDMI matrix switch, or use the GE Table Monitor to display other output -- such as the Eyelink computer output when adjusting the Eyelink camera at the front of the scanner.

The HDMI matrix switch allows for fairly elaborate configuration as described in the manual via a Key Digital PC application that is available on the CNI PC laptop when connected to the internal private ethernet network.

Troubleshooting: The HDMI matrix switch is generally fairly stable but if you're having odd behavior a good first step is to cycle the main power to the Laima Box -- this will reset the HDMI matrix switch.

Stimulus Presentation

The CNI offers several display options, depending on your visual stimulus needs. All use a digital interface (DVID or HDMI) and can be connected by selecting the appropriate options on the HDMI matrix switch. The mirror on the 32-channel coil is a double mirror design. (See 32-channel_double_mirror.)

3D LCD display (49")

We have a 49" 4K 3D LCD display from Resonance Technology.

* 640x480@60Hz up to 4096x2160@50Hz resolution
* 1000:1 contrast ratio
* screen size: 107.2cm high x 60.3cm wide 
* visual distance from Nova coil: 267cm from mirror2, 6cm mirror2 to mirror1, 15cm from eye to mirror1 = 288cm
* visual distance from NFL coil: 263cm from mirror1, 13cm from eye to mirror1 = 276cm 

To see 3D effects, subjects will need to wear passive polarized lenses. The screen can, of course, present non-3D stimuli too.

As described in our Slack channel, the TV monitor has varying latency depending on the mode it is in. We conducted tests using a 1920x1080p@60Hz signal comparing the mirrored display on a laptop while simultaneously viewing the display on the scan room monitor. By capturing these displays simultaneously with a high-speed video acquisition we were able to calibrate the latency between the laptop and scan room monitor display. Assuming the laptop display latency is 0, when in General mode the monitor processing creates about 133ms (8 video frames) of latency, as compared to Game mode where the latency is only 33ms or 2 frames. In order to switch modes, the remote control must be used inside the scan room but care must be taken as the batteries are slightly ferromagnetic so be sure to hold on the remote firmly and keep it as far from the scanner as possible. Choose Options->Scene Select->Game in order to select Game mode. It should be in this mode by default -- we ask any users that switch the monitor mode to please return to Game mode after their experiment.

LCD Projector

We also have a rear-projection LCD projector (Eiki LC-WUL100L Projector). This projector can be used by placing the large mirror on the back of the scanner bed in front of the LCD panels. You also need to place the rear-projection screen on the head coil. Set-up of this system is a bit more involved than the flat panel displays, but it offers a much brighter display and a larger field of view. If you need that, let us know and we'll show you how to set up the projector system.

Here are the specs on the projector:

* 5,000 lumens
* 1920x1200
* 2000:1 contrast
* 10-bit color resolution
* brighter and larger field of view than the LCD displays

If you try the projector (via HDMI) and nothing happens, you can try cycling power to the [[#The Laima Box|Laima Box]. If this doesn’t work, troubleshoot the projector as you normally would (check the input cable on the projector is connected and cycle inputs). There is also a remote control for the Eiki projector that can be used by pointing it at the IR sensor on the front of the Laima Box (which is relayed to an IR emitter inside the projector enclosure. This is useful for adjusting the off-axis lens position, setting menu options, etc.

MRI Compatible Glasses

mri frames and lenses

For participants who wear glasses, CNI has a set of interchangeable lenses that are used with an MRI compatible plastic frame. The frame and lenses are located in the open shelving above and to the left of where the screening forms are located. We have lenses for both near-sighted (-0.5 to -8.0 in .5 step increments) and far-sighted (+.5 to +8.0 in .5 step increments) vision corrections. The lenses are made of hard polycarbonate plastic and are not breakable. The easiest way to install the lenses into the frame is insert the lens from the back first into the edge by the ear piece and then snap in the lens by the nose. If the participant does not know his/her glasses prescription we have a lensometer that can determine that. Basic instructions for use of the lensometer are in the next section. There is also an eye chart posted on the door to the equipment room where participants can test their vision with the MRI glasses. Have the participant stand right in front of the lensometer (about 10 feet from the chart) to use the chart.

eye chart


To determine glass prescription strengths for MRI participants CNI has the AL200 Auto Lensometer. Is is located in the CNI control room area. There is both a User's guide and a quick reference sheet next to the lensometer. The lensometer is currently set up to read a single vision lens. There are settings available to read either bifocal or progressive lenses, but they are not typically used as only the distance portion of the lens needs to be measured.

Here is a basic how-to from the Reichert user's guide.

Auditory System

Bone-conduction transducers.
Newmatic audio amplifier.

The auditory system at the CNI uses the Newmatic audio amplifier to drive piezo transducers. Normal sound-attenuating headphones (even those marketed as 'slim'), do not fit in our Nova 32-channel head coil. So, we installed two different sets of ultra-slim transducers. Our primary system uses bone conduction to deliver sound to the subject. For this system, we place piezoelectric transducers directly on the scan subject's cheeks, just in front of the ear. The subject wears sound-attenuating earplugs as usual, and hears the audio stimuli via bone conduction. This system is the only one that reliably fits in the 32-channel head coil. We have found it to be ideal in terms of subject comfort as well, since they can wear ear plugs to block the scanner noise. We recommend that you use the light-weight memory foam pads (the red or white ones) for padding around the ears/head (if padding is needed – the participant may already be snug enough in the head coil). Using the thicker/heavier-weight memory foam pads can push the headphones against the participant’s head in a painful way. Also, please be sure to use sanitary covers. They can be found in the shelves in the scanner room. Use some medical tape to secure them.

The second system uses air tubes that penetrate earplugs and operate much like earbud headphones, except that the sound is delivered through the tubes. Most groups prefer the bone conduction system, but some have found that it is difficult to properly place the transducers for a few subjects, and thus revert to the air-tube system for these subjects.

We have not calibrated the frequency response of either system, but from our own qualitative experience, both have significant attenuation of the higher frequencies (as expected for these kinds of transducers). However, speech stimuli come through fine and both male and female voices sound clear and are fully intelligible.

Both systems are driven by the black Newmatic amplifier box. To set up the audio, plug in the audio cable into your computer’s headphone jack. Make sure that your computer’s sound is turned on. We recommend that you turn your computer’s sound to a high volume, and then use the volume control on the Newmatic amp to adjust the subject's volume. For speech stimuli, we recommend setting the volume to about 6 or 7 to start with, and then adjust as needed. You can use the volume on the black speaker to adjust the volume in the control room (i.e., what you hear). This won’t impact the volume settings for the participant.

We recommend that you test the sound before your participant comes in and also with your participant before you start your experiment (ask them to position the headphones such that they can hear optimally). The Carstensen lab has had good experience using an online violin tuner as the sample sound, for example, this one: [1].

For information about how to build an MR-compatible bone-conduction system, see the CNI Bone Conduction Audio System page.

If you need to talk to your participant during the experiment WHILE the sound is also playing, you will want to use the “Talk” button on the black microphone to the left of the GE console, rather than the regular “Talk” button for the intercom. If you are using audio for your experiment, but you want to talk to the participant while the sound is not playing, you can use the regular intercom “Talk” button.

Troubleshooting the audio: If you/your participant cannot hear a sound through the headphones, and you have made sure that the audio cable is plugged in, that both your computer's volume is set to high, and that the Newmatic sound system is turned on and set to a reasonable volume level.

Contact the CNI staff if you need help setting up the auditory system.

Subject measurement

fORP Response Box

We have a modular response box system (fORP 932) from Current Designs. With ths system, you can swap out various response devices. The output from any of these devices is available from the fORP box via USB. The device emulates a USB keyboard. (Note that we have found more reliable operation with PsychToolbox by using the "USB HID NAR" mode rather than the "USB HID KEY" mode. With KEY mode, some keypresses are missed.) We have confirmed that the fORP 932 USB interface is polled at 1kHz. The device itself has sub-millisecond time resolution (see the fORP FAQ). We estimate that this system provides response time measurements with a precision and reliability of about one millisecond.

Note that the fORP can send keypresses every time the scanner acquires a slice (or a volume, in the case of fMRI EPI). If you want this (e.g., to trigger the start of your stimulus), make sure the 'scope trigger' cable is connected to the fORP, because it is often disconnected by some users (it's a BNC-style cable; ask Laima, Michael, Hua, or Adam if you are not sure). You will also want to configure the fORP to allow these keypresses by selecting a configuration that does *not* say "no 5" or "no t". If you *do not* want to get these pulses (most users actually do not want these), then select a configuration that includes "no 5" (if you are doing numbers) or "no t" (if you are doing letters. (Please don't disable these keys by disconnecting the BNC cable; there is already too much wear-and-tear on that cable.

fORP (silver box) and trigger box with the red manual trigger button.

The response devices that we currently have are:

  1. scroll-wheel device
  2. 2X4 bimanual button boxes
  3. 4-buttonstick-style response device
  4. 5-button diamond button box
  5. 5-button curved button box
  6. trackball device
  7. PYKA 5 button box
  8. joystick
  9. foot pedal

If you have a need for a different response device, just let us know.

To use a response device at the CNI:

  1. Plug the desired device into the black fiber-optic connector on the right side of the front of the magnet bore
  2. Locate the silver box (labeled fORP) in the control room to the right of the GE console.
  3. Push in the knob on the right front side of the fORP box to enter menu mode. For the following instructions, you will turn the knob to scroll through the menu choices, and then push in on the knob to select your choice. (See this guide for more details on using the fORP 932.)
  4. Turn the knob until the word "yes" is underlined then push the knob to select "yes"
  5. In the "mode select" menu that appears next, you can select "manual config" We recommend, however, that you pick the AUTOCONFIGURE choice which tells the interface to determine as much as it can about the connected handheld device and the cabling to the host computer. This should simplify the choices that need to be made by you. If you have used the AUTOCONFIGURE option you can skip steps 6 and 7 below and proceed directly to step 8.
  6. In the response device menu, turn the knob to scroll through the choices until you find the device that you connected in step 1 (examples include):
    1. 4-button cylinder: select HHSC-cyl-5
    2. 5-button diamond: select HHSC-1x5-D
    3. 5-button curved: select HHSC-1x5-C
    4. bi-manual 4-button keypads: select HHSC-2x4c
    5. scrollwheel: select HHSC-SCRL1
    6. trackball: select HHSC-TRK-2 (for mouse emulation)
  7. Select USB in the next display by pushing in the knob.
  8. Select the desired output mode. For the cylinder or keypads, this determines the mapping between the buttons and the keypress that is generated. E.g., HID-NAR-12345 will map the 4 cylinder buttons to the four number keys, 1-4, and send a '5' for each each pulse received by the scanner (if you don't want these pulses, select the 'no 5' mode, as noted above). NAR means "no auto release". In NAR mode, the keypress is maintained as long as the button is pressed. In the non-NAR mode, a brief keypress is generated, even if the button is held down. We find that NAR mode works better with PsychToolbox. In non-NAR mode, it can miss the very brief keypresses produced by auto release. For a description of other modes, see Current Designs support site.
  9. Setup is now complete.

For more technical details about the fORP, see the fORP wiki page.

NOTE: Please do not disconnect the slice trigger cable to disable the slice triggers! The connector on this cable is delicate and has been broken from the frequent use. If you do not want the slice trigger key-presses ('5', 't', or '6', depending on the forp settings), then please select a option that disables these keypresses. E.g., 'HID-NAR no 5'.

CNI Touch-pad

CNI touch-pad.

We designed and built this MR-compatible touch pad. It uses a KEYTEC 4-wire resistive touch glass connected to a Teensy 2.0 with custom firmware. The CNI Touch Pad connects to a host via USB and will show up as a serial port on your machine. It will continuously stream the absolute position of the subject's touch using a simple serial protocol. Here is some sample code to get coordinates in Matlab.

Eye Tracker

Eye tracker camera.
Eye tracker IR illuminator.

We have an SR Research EyeLink 2000 eye tracker with remote optics installed at the CNI. It has a frame rate of up to 2000Hz, up to 1/2 degree accuracy, and is fairly easy to set up and use. We found that the standard IR light source from SR Research did not adequately focus the light onto the subject's eye, so we built a small MR-safe IR source using a single high-power IR LED epoxied to a non-metallic heat sink. The illuminator is mounted on the head coil using a loc-line stalk and can be positioned to nicely illuminate the target eye. It's powered from the same 5v source that powered the original SR illustrator (and that powers the camera) via a simple circuit based around a 1.8v linear regulator (it turns out that 1.8v drives this LED with just the right amount of current). We did have an issue with the RF pulses from the scanner causing some flicker in the illuminator, but a few big capacitors managed to minimize the flicker.

The camera is permanently mounted to the cover over the patient bed mechanism at the back of the bore, just in front of the LCD display. The camera position and focus should not need to be adjusted if your subject is positioned with their eyes close to isocenter. However, if you have a prescription that is centered far from iso-center, you may need to adjust the focus a bit. To do that, you can use the video switch under the counter (next to the FORP) to show the eye tracker video on the large LCD at the back of the bore so that you can adjust the camera and easily see what you are doing.

The infrared light source is mounted on a blue loc-line stalk that attaches to the head coil and is usually left unattached and hanging on the side of the scanner next to the response devices; you will need to mount it to the head coil using the blue loc-line pliers that you can find under the shelf with all the padding. Once mounted, make sure the light source is directed toward the subject's eye by aiming it through the gap between the two mirrors.

The eye tracker host computer is mounted in the equipment room. However, the display, keyboard, and mouse for that computer are to the right of the GE console. You can connect to the host computer by a direct TCP connection through the ethernet cable located in the cable bundle next to the GE console. This cable is, not surprisingly, labeled "eye tracker". If you use psych toolbox for stimulus presentation, you can use the EyeLink Toolbox. For those who use python (e.g., Psychopy), try the PyLink module. If you use E-Prime, check out the E-Prime integration info on the SR Research support site. In any case, the IP address of the Eyelink is on our private network and thus is NOT the default IP, so you need to explicitly set it to This private network has a DHCP server, so your stimulus computer should automatically get assigned an IP address on the same subnet. Please don't hard-code an IP address for your stimulus computer! Note that older versions of psychtoolbox don't allow you to specify the IP address, so be sure to get the latest Eyelink mex file from github.

For a tutorial and troubleshooting information on the Eyelink system, see the EyelinkTracker page.

The old MReyetracking system from Resonance Technology is still available. This system uses the ViewPoint software from Arrington Research. For more details on the old eye tracker, see the eye tracker page.

Physio monitoring

Photo plethesmograph (PPG) and respiration belt.

The scanner has the standard suite of physiological measures: pulse oximetry, respiration belt, and ECG. These can be used for scan triggering. Also, the digital data from these measurements are saved on the console and backed-up in the nims database. These data are also processed by the CNI PPG monitoring device and used for EEG ballisto-cardiogram artifact removal by the EGI NetStation software. (See also the UCSD fMRI group's site for more information on using the GE physio files to remove physiological artifacts from fMRI data.) A recent paper is here - The PhysIO Toolbox for Modeling Physiological Noise in fMRI Data

Setting Up Physio Recording

  • Go to “Tools” -- Gating
Tools Button
  • To record respiration/movement of the abdominal wall, select “Respiratory.”
Tools Gating
  • To record pulse/peripheral gating, select “PG.”
  • Outfit your participant with the respiratory bellows and the PG sensor

Respiratory Bellows

The respiratory bellows goes around your participant’s diaphragm or abdomen. You will get the best signal in the area where the participant’s breathing motion is most visible when they are lying down. Use the Velcro to adjust the respiratory bellows; it should be snug and not move around much, but stretched as little as possible and not too tight. The bellows should expand and contract approximately 0.5 to 1 inches with the participant’s breathing. Do not place any padding over the respiratory bellows. You should be able to see the recording on the small screen on the scanner. Note that it’ll take about one minute for the system to stabilize. Your participant should remain still for the system to adjust. Check that the screen shows you a nice waveform without too much noise, and adjust the bellows if necessary.

Pulse/Peripheral Gating (PPG)

The participant’s pulse is monitored by a photopulse sensor that detects blood oxygen levels (pulse oximetry) in the vascular bed of the participant’s finger/thumb or toe.

During the measurement, the participant’s hand or foot should remain cool and dry.

We recommend that you attach the sensor to the participant’s toe, especially if you are going to ask your participant to use one of the button boxes because hand movements will create noise in your PG signal.

Recording from the toe: Attach the sensor to the fastener for the toe (with the Velcro). Place the sensor on the vascular bed of the participant’s toe. To keep the sensor in place, tape it and the fastener to the participant’s foot using medical tape. It is also a good idea to tape the cable to the knee pillow or the participant’s leg to reduce the pull on the sensor. Recording from the thumb/finger: Place the sensor on the participant’s finger or thumb. It is a good idea to avoid placing the sensor on the joint (the signal will be much noisier if you place the sensor on the joint). To keep the sensor in place it helps to tape it to the participant’s hand with some medical tape.

You should be able to see the recording on the small screen on the scanner. Note that it’ll take up to a minute for the system to stabilize. Your participant should remain still for the system to adjust. Check that the screen shows you a nice waveform without too much noise, and adjust the sensor if necessary.

Note: When you are done, please clean the sensor with alcohol wipes as it directly touches the participant’s skin.

Recording Physio

The default method for recording the physio is the CV control method. It is synchronized with scan start and stop. With default setting of CV control method, a recording of maximum length (25 minute) will require approximately 3 seconds to save to files to the hard disk after the end of the scan. You need to make sure that the next phys-recording scan starts after the previous recording finishes saving data to files. If the next phys-recording scan starts before the previous recording finishes, the new recording request will be ignored.

Physio Waveforms on Console

Parsing the physio files

The physio data from the scanner can include three types of measurements: pulse, respiration, and electrocardiogram (ECG). The pulse data come from the PPG, the respiration data from the breathing-belt, and the ECG from the specialized electrodes attached to the chest.

The data recorded from these devices are written out into simple text-files. There are three files for each type of measurement. The file names start with PPG, RESP and ECG (we think) for the three types of measurements. The files have raw data ('Data'), the times of the local peaks ('PacTrig') and ('Trig', which has been empty in our experience).

  • The temporal sampling rates differ between the three types of measurements
    • ECG: 1ms,
    • Pulse/Peripheral Gating: 10ms,
    • Respiration: 40ms.
  • The timeseries data
    • start 30 seconds of baseline from before the start scan button was pressed
    • have a variable duration between start scan button press and the actual start (pre-scan delays, external trigger delays, etc.)
    • continue to the prescribed duration of the scan (even if you stopped the scan manually)
  • The end of the timeseries in the file coincides with the prescribed end of the scan.
  • The maximum duration of each file is 25 minutes.

The physio files are zipped and including in the Flywheel acquisition. We will be writing Gears to help extract, visualize, and summarize the data.

To reiterate-- the physio data stored in the physio files starts 30 seconds before you press the 'start scan' button (yes, it's psychic ;), which is almost always more than 30 seconds before scanning actually starts. It could be substantially longer if you do external triggering. In that case, you'll get some extra physio data recorded during the time between when you press start scan and you send your trigger. But the recording does stop when the scan is prescribed to stop (even if you abort the scan prematurely). So, to synchronize physio and scan data, chop off the extra physio data at the beginning of the file. And if the scan was prematurely aborted, you'll need to take that into account too.

At the CNI, we attempt to do the basic processing on the physio files generated by your scans. The files are read and regressors are computed. These regressors can be used to regress out the physio noise, or they can be used to de-noise the raw data. For details, see in the NIMS repository.

Biopac measures

For measuring skin conductance and EMG, we have a Biopac with the electro-dermal activity amplifier and EMG amplifier modules. The data from the Biopac are digitized with a LabJack UE9 DAQ device and are available directly through a TCP stream (see the UE9 code samples) or via our linux box voxel2, which can be used to trigger data acquisition that is synchronized with the scanner. The command to run the recording script is " /data/biopac/[your experiment folder]/[run id] [recording duration]". The recording duration is in seconds. The output is a csv file at /data/biopac/[your experiment folder]/[run id]_[timestamp].csv. The data file records the voltage and raw ADC values. The skin conductance is stored in the second (voltage) and third (raw ADC) columns. You probably want the second column (with numbers like "1.60230098"). The skin conductance amplifier gain is set to five microsiemens per volt. So, if you multiply the numbers in the second column by 5, you will have the skin conductance in microsiemens. The EMG values are in the fourth (voltage) and fifth (raw ADC) columns. The EMG amplifier gain is set to 2000, so dividing the values in the fourth column by 2 will give you the EMG voltage in millivolts.

Subject video

You can monitor and record the subject's face or body using an infrared video camera. The camera is always on and streaming video to the linux box next to the scan console. An analog video signal is also sent to the large-screen tv in the control room (use the 'A/v input'). To use the camera, you can attach it to the head coil using the loc-line connectors. When not in use, the camera should be hung on the side of the scanner along with the response devices. To see the video feed, run the following from the command line: "ffplay -f video4linux2 /dev/video0". To record the video feed, you can use our video recording scripts. From the command line run "recordSubject 310", this will record subject video for 5 minutes and 10 seconds; to synchronize the recording to the start of the scan, run "recordSubjectTrigger 310" instead. The data files are saved to the "video" directory.

Troubleshoot: if you get an error "/dev/device0: busy or resource unavailable", then run "fuser /dev/device0" and you'll get the PID of the process that is currently occupying the video device. Then run "kill -9 [PID]". This should kill the process and you should be able to use the video camera again. Occasionally the camera feed fails and the recorded video files are empty. If this happens, check the video device setting with "v4l2-ctl -d /dev/video0 --all" and look for the "Video Standard" section. If it's something like "Video Standard = 0x000000ff PAL-B/B1/G/H/I/D/D1/K", then you'll need to change it to NTSC standard with "v4l2-ctl -d /dev/video0 -s ntsc". The returned message should be "Standard set to 0000b000 NTSC-M/M-JP/M-KR".

Scan Triggers

UserCVs under the 'Advanced' tab for the cni_epi PSD.

The moment when the scanner starts acquiring image data can be controlled from the computer you use to control your experiment. To do this you need to be able to program your computer to send a pulse to the scanner at the planned moment.

At the CNI, we provide two methods for sending the pulse. Both use a USB connection, one using a USB DAQ device that has a nice Matlab driver available and the other uses a USB-to-Serial port device, which works well for E-Prime and Presentation. The notes below show how to set up the UserCV so that the scanner listens for the trigger, and how to send a trigger pulse using either the USB DAQ device or the USB-to-Serial device.

Protocol configuration

For BOLD EPI, be sure to use the cni_epi PSD to get the triggering options described here. The same options are also available for the spiral PSD. Under the 'Advanced' tab, make sure the "start scan trigger" CV is set to '1', which tells it to use the external trigger. Other options include '0' for no trigger (scan starts as soon as the scan button is pressed), and '2' for cardiac gating, which will synchronize to the cardiac cycle (measured via either the PPG pulse oximeter or ECG leads).

USB-1208 HID trigger

NOTE: this trigger system is deprecated and has been removed. Please convert your scripts to use the #USB-to-Serial Port Trigger.

At the CNI, we have a [USB-1208] HID device from Measurement Computing installed and wired into the scan trigger through pin 14. This device is supported by the PsychToolbox [DAQ Toolbox]. If you have PsychToolbox configured, just plug in the USB cable labeled "Matlab Trigger" and you can send a TTL pulse to the scanner by pulsing pin 14. See the VistaSoft [StartScan] function for example Matlab code.

USB-to-Serial Port Trigger

The CNI also has a USB-to-Serial port device set up to send scan triggers. Just connect the USB cable labeled "EPrime Trigger" to your computer. On OS-X and Linux, the device is automatically recognized as a serial port (under /dev/ttyACM? on linux or /dev/ttyUSB??? on OS-X). On windows, you might need to install a driver the first time you connect it. Download the CNI Serial driver and be sure that the file name has the correct extension. (Windows will probably add a ".txt" to the file name, which causes the driver manager to fail to recognize it as an inf file. Change your folder settings to not hide file extensions and edit the file name to remove the ".txt". In Windows 7, go to Windows Explorer and press the Alt key to show the menu, and click on Folder Options via Tools menu button. Click on View tab and remove the check from Hide extensions for known file types, and then press OK. Now you can see and edit the file extensions.) Then, go to the Windows 'device manager' and open the device properties for the unrecognized USB device. Find the 'update driver' button and browse to the directory containing the .inf file that you downloaded. Check the port settings and make sure the port is COM1, COM2, COM3 or COM4. If not, use the 'advanced' button under the "port settings" tab to change the com port to one of these. (This is an E-Prime limitation.)

When configuring the port, note that the device is expecting communication at 57600 bps and the scanner is triggered by sending a three-character string: "[t]" (without the quotes). In E-Prime, you need to add the serial port device to your experiment and then configure it by specifying the device (look in your device manager if you are not sure) and setting the baud rate to 57600. (Other settings can be left at their default values.) In your E-Prime script, add the following in-line code to send the trigger string to the port:

Serial.WriteString "[t]"

To use this device from Matlab, try:

s = serial('/dev/ttyS0', 'BaudRate', 57600);
fprintf(s, '[t]');

Note that you will need to replace '/dev/ttyS0' with the correct port on your machine. E.g., if you're on windows, the port might be 'com1', 'com2', etc. On a mac, type 'ls -lh /dev/tty.usbmodem*' in a terminal.

However, some older Matlab versions for OS-X system don't support the Matlab 'serial' command. If that happens to be you, don't lose hope! You can set up a simple python script to do the triggering. First, get the trigger working in python. In a terminal, try this:

tar -xzf pyserial-2.6.tar.gz
sudo mv pyserial-2.6 /Library/Python/2.3/site-packages/
chmod a+x
sudo mv /usr/local/bin/

Then, in Matlab, you can call this python script with:

unix('/usr/local/bin/ /dev/tty.usbmodem123451');

If you are using PsychoPy, first make sure the pyserial package is installed (e.g., pip install pyserial). Then create two code blocks:

# Insert a 'Begin Experiment' code block to initialize (e.g., as part of your instructions)
import serial
import time
device = '/dev/ttyACM1'  # NOTE: replace with your device identifier! On windows, the port might be 'com1', 'com2', etc. 
def cni_trigger():
        ser = serial.Serial(device, 115200, timeout=1)
# Insert a "Begin Routine" code block whenever you want to send a trigger:

Alternate example from Christina Chung:

### import modules
import serial
import time 

### scanner trigger
### Set SCANNER_TRIGGER_NEEDED to False to bypass program abortion when scanner exception is thrown
DEVICE_ID = 'com3'

### scanner trigger
def cni_trigger():
        ser = serial.Serial(DEVICE_ID, 57600, timeout=1)
        time.sleep(2)    ### wait for 2 sec to ensure scanner is ready; CNI wiki default 0.1

The construction of our serial trigger device is described on the CNI widgets page.

Capturing Scan Timing Pulses

If you are not getting the expected pulses, check the t-junction under the counter by the GE console and try disconnecting the cable with the orange flag.

Some researchers want to know the precise time when each slice or each volume is acquired. The scanner produces timing pulses that can be used to record this information. Additionally, a pulse sent by the scanner at the beginning of the scan can be used to trigger the start of an experimental task (reversing the direction of triggering discussed above). At the CNI, we have two methods of receiving these timing pulses. One method uses the USB-to-Serial trigger device and the other uses the fORP response box system. These two methods are described in more detail below.

USB-to-Serial timing pulses

The emulated serial port device described above can also be used to receive timing pulses from the scanner. To enable this mode, send a "[p]" command. You will then receive a 'p' character every time a timing pulse is detected. The temporal accuracy of these pulses should be about 1 ms. These "scope trigger" pulses come at the beginning of every slice or the beginning of every volume, depending on how the PSD is configured. For the cni_epi and spiral PSDs, under the "Advanced" tab, you can change the "scope trigger" CV to send pulses for every slice or just for the first slice of each volume. To capture these trigger pulses, you can use this python script.

Timing pulses as keypresses via fORP

To use the fORP response box system to receive timing pulses from the scanner, set up the system as described in the 'Response Box' section above. Note that timing pulses will be received via the same USB connection as subjects' responses, and that no additional USB cables need be plugged into your testing computer. However, you will need to plug a cable labeled 'Slice Trigger' into the back of the fORP box. Assuming that you have selected a numeric mapping between button presses and keys, the timing pulses sent to your testing laptop will be in the form of a '5'. (Note that use of the 5-button diamond-shaped response box will include the numbers 1-4 and 6, and thus will not include the number 5). Use caution when editing experimental scripts while using this method--if your script is open while the scanner sends pulses, a long series of 5's will be inserted into your script! Similarly, at the end of your scan session, please be sure to unplug the 'Slice Trigger' cable from the back of the fORP box so that the frequent pulses do not disrupt other users' experimental scripts.

Subject Positioning

There are many MR-safe pads available for subject positioning. (Add positioning advice?)

Also, there is a Mag Design and Engineering bite-bar holder on the 8-channel and 32-channel coils (both built by Ben Krasnow). We have a 200deg water source in the control room (the Cuisinart coffee machine) and are planning to get a little microwave for heating things like bite bars and EEG electrolyte.

Some labs have expressed interest in a vacuum pillow system for subject positioning. From: Ashley Shurick (Gross lab) is familiar with the SecureVacTM Immobilization System from Bionix Radiation Therapy. The system at NYU uses a customized pillow measuring 50 x 70 cm with 12.5L of fill. However, the size should depend on the head coil used, as pillows come larger or smaller, with more or less fill. They also have a vacuum pump system to remove air from the pillow, helping prevent movement. We are currently looking int this.

General information

Power switch for peripherals

Push-button switches to power on and off the peripheral equipment. (hand model cameo by Jason Yeatman)

The stimulus displays, audio system, and the fORP response system are best kept turned off when not in use. We've found this to be particularly important for the LCD display, which can act up when it's been left on for too long. To make it easier to turn all these devices on and off, we have installed two switches on the column to the right of the GE console. Please turn all the equipment off when you finish scanning. The switches toggle the power and glow blue when the power is on.

Behind the scenes, these push buttons each control a Furman MP-15 power relay, one in the equipment room that controls power to scan room devices and one in the console room. The switched labelled "LCD" toggles power to devices in the scanner room and must be on to use the LCD display. The switch labelled "fORP" toggles the devices in the console room and must be on to use the fORP response system. The goggles and audio system require both switches to be on because they have a component in both the control room and the scan room.

The magnetic field

When positioning equipment in the scan room, it's useful to be aware of the magnetic field lines. All equipment in the CNI scan room is MR-safe, but not all equipment functions properly in very high-field regions. The diagrams show the estimated field lines in the MR suite area.

Building your own MR center

See the Hardware configuration page for details about setting up the equipment described here.

Personal tools