MRI Setup

From CCN Wiki
Revision as of 23:35, 31 March 2016 by 172.101.108.133 (talk)
Jump to navigation Jump to search

Checklist

Before leaving for the MRI Center, ensure you have the following:

  • Experimenter Laptop (check that you know its whereabouts prior to the scan date!)
  • Physical experimental stimuli (if any)
  • Contact information for all participants for that day
  • 100% certainty about what experiment you are running that day (it is possible that multiple fMRI experiments will be going on in the lab at any given time)

Upon Arrival

Empty your pockets of anything metallic

Test the Experiment Script

Before we check that the buttons and AV display should be working fine, we should do a dry run of the experiment script to make sure that you are familiar with running it. We wish to avoid having participants waiting uncomfortably in the scanner while we troubleshoot our scripts!

Open a terminal window (if one is not already open) and navigate to the directory containing the script to be run that day. The script is likely to be found in a subdirectory under /home/Experimenter/Documents/MATLAB/

cd /home/experimenter/Documents/MATLAB/<projectname>

For example, we are currently developing the protocols for a lexical decision task (LDT). Those files are in ~/Experimenter/Documents/MATLAB/LDT/

Launch MATLAB

ptb3-matlab

Run the script, using a dummy subject ID (e.g., 9999)

>>runsubject(9999,1,'A')

Of course, the name of the experiment script is likely to differ from project to project. You should be familiar with the names of the scripts you will be running. A wiki link listing the names of all important files for each ongoing and archived experiment will probably make its way on to this site eventually.


Experimenter Laptop Setup

The laptop connects via USB to the Lumina console. The console masquerades as an external USB keypad and sends participant keypresses and scanner trigger events to the laptop.

Connect the Lumina console to the laptop

  1. Boot up the laptop first
  2. Log in as the experimenter on the laptop
  3. Locate the white USB cable in the back of the Lumina console
  4. Plug the other end into a USB port in the laptop

Check that the keypad is sending signals to the laptop

Before you enter the Magnet area, ensure that you are metal free!

  1. Set the Lumina controller to send the expected signals
    • The Controller Mode should be set "As Keyboard"
    • Toggle the Using to E-Prime
  2. Find the two 2-button response boxes are in the scanner room
    • They are likely to be found attached to the wheeled display mount stand
    • If they are not attached, ask the technician for help setting them up
    • Examine the button boxes closely. You will see they are labeled L (blue/yellow) and R (red/green)
  3. Open a terminal window
  4. Navigate to the directory containing the Keyboard test script
  5. Launch MATLAB
ptb3-matlab
  1. Run the keyboard test script
>>keyboard_info
    • The script will give you a number of potential keyboards to test out. Select Cedrus Corporation Lumina Keyboard (see troubleshooting section below if there are more than one matching keyboards)
    • One of the experimenters should press each of the keypad buttons while the other monitors that the button presses are registering in MATLAB
    • If the Lumina box is configured correctly to send E-Prime signals, the key-presses should be showing up as the numbers 1 to 4 (the scanner trigger will register as a ^6)
  1. Troubleshoot if necessary, because running the experiment will absolutely depend on the external USB keyboard being configured (see the next section)

Keyboard Troubleshooting

Our fMRI experiments usually listen for events from the external keypad. However the laptop has a built-in keyboard as well, but the software only wants to listen to one of them at a time.

If the external USB keyboard has not yet been connected, the scripts will default to listening to the laptop keyboard. We can simulate the scanner room events by pressing the laptop keyboard buttons:

  • A laptop keypress of '6' simulates a scanner trigger (the experiments often wait for this trigger signal to synchronize the experiment with the scanner)
  • Keypresses of 1, 2, 3 or 4 simulate the participant button box responses (see below), which you might need to do if the experiment script waits on participant responses

Keyboard Voodoo

I'm not 100% sure about what, if any, rules govern how PsychToolbox + MATLAB + Linux juggle their keyboards. The problem is that the scanner triggers and the participant button boxes appear as an external keypad, but the laptop has it's own internal keyboard that's critical for being able to type useful commands. PsychToolbox only wants to listen to one at a time, and there was some mystery about how you would force it to listen to the right keyboard at any particular point in time.

I've tried a couple experiments, changing the sequence of when the external keyboard should be plugged into the experimenter laptop. I haven't seen any documentation about this, which is why I call this section Voodoo, however the following procedure seems to work:

  1. Boot up the laptop up with the external keyboard disconnected
  2. Log in as the experimenter
  3. Plug in the external keyboard
  4. Launch ptb3-matlab

Now the keyboard should have been assigned a device number, and MATLAB should be able to detect it.

Other Potential Problems

One thing I ran into (which may not be an issue with the input device used at the scanner), but my external keyboard had 2 entries when I ran the keyboard_info script. Moreover, when I tested both of those keyboard device IDs using the keyboard_info script, only ONE of them sent keystrokes. By chance, on one occasion, it was the device with the higher ID. However if there are multiple keyboards with the same name the experiment script might accidentally tune into the device that doesn't send any key strokes (this happened on one of my tests). When I unplugged/plugged in the keyboard and restarted MATLAB, new device IDs were assigned, and this time it worked okay. The moral of the story is to make sure that you have only one matching external keyboard, but if you don't (for some reason), to check that the entry with the smaller device ID gives you input when you run the keyboard_info script. If not, quit Matlab, unplug, plug in, and restart until the problem is resolved.


Display Setup

  1. An HDMI cable (Amazon.com branded) should be poking up through the desk. Connect it to the HDMI port on the laptop (there is only one port that this cable can possibly fit into)
  2. Participants will typically be looking at stimuli presented on a display positioned at the head of the scanner
  3. Ensure that the stimuli are projected in the correct orientation
      • Because they are looking through a mirror, the image will have to be flipped horizontally
      • Depending on the mirror attached to the head coil, the image may also need to be flipped vertically
      • The SensaView display control box has a series of 4 toggle buttons that control the display
      • The most likely orientation is marked with a piece of tape on the SensaVue control box. Double-check with the scanner technician to confirm
        • The 16-channel head coil requires the image to be LR flipped; the 32-channel coil requires the image to be LR and TB flipped

Audio Setup

We have not yet run an experiment with auditory stimuli, so this is not yet sorted. However a sketch of the procedure will entail playing a test script that presents some auditory items, and having one of the scan team listen over the MRI headphones while the other runs the script.

Troubleshooting

  • Whether or not the external keyboard is plugged in at the time that you launch MATLAB seems to dictate whether or not MATLAB will see it
    • If you are finding that the keyboard check script is not detecting the external USB keypad, relaunch MATLAB, ensuring that the USB keypad is plugged in when MATLAB is launched
  • If all else fails, reboot the laptop