Beauchamp:Software Installation
Updating AFNI
AFNI is frequently updated, so it is important to make sure you have the most recent version. The latest version of AFNI can be downloaded from the AFNI web site
http://afni.nimh.nih.gov/afni/download/afni/releases/latest
Download the distribution for Intel Macs.
A more automatic way to update (for Intel Macs) is the following:
set pkg = macosx_10.4_Intel wget http://afni.nimh.nih.gov/pub/dist/tgz/{$pkg}.tgz tar xvfz {$pkg}.tgz
Optionally, it can be good to test the new version BEFORE overwriting the old version. Here is how we can test SUMA:
cd macosx_10.4_Intel ./suma
If it works, we copy it over the old version (type "which afni" if you are not sure which directory afni is in)
mv macosx_10.4_Intel/* /Applications/AFNI/ rm -r macosx_10.4_Intel macosx_10.4_Intel.tgz
Configuring a New PC
MSIT (Ismael Perez) will install a basic set of software, including Microsoft Office, if asked. MSIT requires security settings, such as automatic logout after 10 minutes. If it is to be used for experiments, these security features can be a problem. MSIT will disable them if an exception form is filled out. If the PC is to be used for experiments, install Presentation software. The XVid CODEC is preferred; Virtual Dub and Audigy software are useful free editing tools.
www.xvid.org
The VLC video player is useful
http://www.videolan.org/
Also FFDShow
http://sourceforge.net/projects/ffdshow
If you are running Windows on a Mac via BootCamp in order to run Presetation,
You may find it easier to swap the control and Command keys for consistency with Mac OSX.
This can be done with
Microsoft Keyboard Layout Creator 1.4
or
remapkey.exe
in the Windows Server 2003 Resource Kit Tools
Configuring a New Mac
Ismael will install a basic set of software, including Microsoft Office, if asked.
Software that you MUST install (in this order): XTools, fink, AFNI, FreeSurfer
Software that may be handy to have: Parallels; Adobe Creative Suite; Firefox; Skype
To install software, it may be necessary to have a root password. To create one, type sudo passwd root
If you like a shell different than bash, the terminal program can be configured to use any shell using the command
chsh -s /bin/tcsh
tcsh is the shell used by MSB.
Every time tcsh starts, it reads commands from the file .cshrc To copy MSB's tcsh, type
cp /Volumes/data9/surfaces/scripts/.cshrc ~/
Because AFNI uses all three mouse buttons, you must tell the Mac to allow this. Click on system preferences/Mouse and Keyboard/Mouse and select the middle mouse button to be button #3 and the right mouse button to be button #2.
NB: SUMA is unstable with some versions of X11. If SUMA crashes, upgrade your X11 as follows. First see which is the latest version by going to
http://xquartz.macosforge.org/trac/wiki/Releases
Next, follow these instructions (replacing 2.3.0.pkg with the latest version)
quit X11 http://xquartz.macosforge.org/downloads/X11-2.3.0.pkg Install the new X11 logout, login and relaunch X11
XTools
X11 is the display system for Macs and most Unix machines. XTools is a programming environment for the Mac that includes useful compilers and other tools. To install XTools, find the Install Disc that came with your Mac, go into the System Installation Packages folder, and install the pkg file named XTools.
Optional Installs--> Xcode Tools--> XcodeTools.mpkg
AND
Optional Installs--> Xcode Tools--> Packages--> X11SDK.mpkg
http://trac.macosforge.org/projects/xquartz
1. XcodeTools and X11SDK from the Leopard DVD. 2. Maybe the latest X11 package from trac.macosforge.org 3. glib2-dev glib netpbm openmotif from fink (stable source will do). 4. mesa mesa-libglw mesa-libglw-shlibs mesa-shlibs from fink (unstable source).
Fink
Fink is a program package manager for Macs. Download the program from the Fink webpage:
The program in the dmg file will be straightforward. You can copy finkcommander to the applications folder for a GUI interface. You should update your libraries every few weeks by running the following: fink selfupdate; fink update-all
To add it to your patch, add source /sw/bin/init.csh To your .cshrc file.
Installing Required Libraries for AFNI
Type the following line to have Fink grab the newest versions:
fink install glib2-dev glib netpbm openmotif3 fink wget
AFNI
AFNI is a suite of programs developed at the NIH for the analysis of functional neuroimaging. The best place to go for installation directions is AFNI’s instruction website:
http://afni.nimh.nih.gov/pub/dist/HOWTO//howto/ht00_inst/html/index.shtml
Unlike the NIH, we install AFNI to the /Applications/abin folder, rather than the local folder of each user. If you want the most up to date version, click the link for compiling AFNI under Mac OS X. You should also check the download webpage each month for updates:
http://afni.nimh.nih.gov/pub/dist/tgz/
To include AFNI in the path, paste the following line into a terminal window:
echo 'set path = ( $path /Applications/AFNI )' >> ~/.cshrc
FreeSurfer
FreeSurfer is another set of programs developed at NIH for the analysis of functional neuroimaging. We mainly use it for cortical surface reconstruction. Their download page is part of an extensive wiki that describes its many functions.
https://surfer.nmr.mgh.harvard.edu/fswiki/Download
Updates to the software are normally posted on the listserv. To set the correct paths for Freesurfer paste the following lines into a terminal window:
echo ‘setenv FREESURFER_HOME /Applications/freesurfer‘ >> ~/.cshrc echo ‘source $FREESURFER_HOME/SetUpFreeSurfer.csh' >> ~/.cshrc
optseq2
Optseq2 is a program in the FreeSurfer package for generating random stimulus sequences. In the homepage, you can download the program, view a .ppt w/ more information, and some practice exercises: http://surfer.nmr.mgh.harvard.edu/optseq/
Open a terminal window to run the program w/ Unix commands. Set the following parameters:
set tr = 2 (or however many seconds for each trial)
set numev = 30 (or however many trials of each stimulus you will show each run. For example, if 150 trials/run, and 4 stimuli, you could have 30 stimuli/run. numev = 30)
set numtar = 20 (however many trials of a target stimulus you want to show per trial. The target is an extra stimulus that the subject will respond to just to make sure they're paying attention. Here, there's 150-120 = 30 trials left over, so we can make 20 of those target trials. The remaining 10 trials will automatically be made into control trials.)
set out = Example (whatever you want your filename to be)
Then, you'll run the program (change the 1st line if optseq2 isn't in Applications/freesurfer/bin):
/Applications/freesurfer/bin/optseq2 \
--tsearch 0.001 \
--psdwin 0 16 2 \
--nkeep 8 --o {$out} \
--ntp 150 --tr {$tr} \
--polyfit 2 --focb 1 \
--ev stimulus1 {$tr} $numev \
--ev stimulus2 {$tr} $numev \
--ev stimulus3 {$tr} $numev \
--ev stimulus4 {$tr} $numev \
--ev stimulus5 {$tr} $numev \
--ev target {$tr} $numtar
tsearch is the number of hours you want the program to run. nkeep is the number of total runs. ntp sets the number of trials/run.
Since there are 8 runs in this example, there will be 8 output files which look like Example-001.par . Each file will have 5 columns. Left-most column has the exact time (in seconds) that the stimulus is shown, 2nd column is the numerical value which corresponds to each stimulus type (in this example 0-6, 0 corresponding to control), 3rd column is number of seconds of each trial, 4th column is ????, and right-most column is whatever name you gave to each stimulus event (like "stimulus1" in this example).
Caret
Go to Caret's Download Webpage, register for an account, and download the newest release. Copy the caret folder to the Applications folder on your machine and add the following line to your .cshrc file:
set path = ($path /Applications/caret/bin/)
Creating Symbolic Links
It is useful to have symbolic links from the command line so you do not need to type the full path to a file. The program ln creates such symbolic links. Here are a couple of examples:
ln –s /Volumes/data9/surfaces/ /surfaces ln –s /Volumes/data1/UT /UT
The paths are now linked to /surfaces/ and /UT/.
Installing the Dell Printer Drivers
The application Dell 5100cn Installer is on data9. The printer IP is 129.106.236.253 To see the current status of the printer go to http://129.106.236.253
Here is a copy of the manual http://openwetware.org/images/8/83/Dell_5100cn.pdf
Mounting RAID Volumes from Windows
You must have a Mac with a valid user account. On the Mac, go to System Preferences, Sharing, and enable Windows Sharing. The menu should say
Windows users can access your computer at \\XXX.XXX.XXX.XXX\YYY
For Mac OSX 10.5, go to System Preference, Sharing. Enable File Sharing. Click the "+" button and add your user to the list of Users; change permissions to be Read & Write. Click on Options and Enable "SMB" which is what Windows uses. Click the user name (you will be prompted for your password).
You may also need to able your user account. Look for the message
Enabled accounts: Ashley Kingon
If your account is not enabled, click on the "Accounts" button and enable it.
Additional steps for Windows VISTA:
Go to the the Start menu and choose 'Computer'
Go to Computer: Local Disk (C:): Windows: regedit
After clicking on the registry editor application:
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa Click on LmCompatibilityLevel Set value to 1 Restart computer
In Windows, go to Internet Explorer and type in the URL above.
Mounting a Volume after sshing to a different machine
For example. I ssh onto tellmore machine. Now I want to access data9 from his machine.
in my home directory (~) (on tellmore) I make a directory called mount, inside of mount I make a directory called data9 (or which ever volume I am mounting), then I mount data9.
cd ~ mkdir mount cd mount mkdir data9 mount_afp -i afp://akingon@129.106.236.180/data9 data9 enter password
and now you can cd into data9
Installing Matlab
To install Matlab for use in the Beauchamp lab:
- 1. Download and install matlab here. Get login name and pw from Mike
- Note: you will be prompted to install Java run-time environment 5. This will ease the installation.
- 2. Currently, we use the NBA Computational Core license. To access this license, place the following in the network.lic file in the licenses subdirectory:
SERVER ms-nba19.ms.uthouston.edu INTERNET=129.106.30.82 27000 USE_SERVER
Lab Printer
The lab laser printer is a Dell 5100cn with IP address 139.52.6.205 You can check the printer status by going to http://139.52.6.205 In Windows, you must add a Port with this address, then install the correct printer driver and tell it to print to the port. On the Mac, go to System Preferences, Print & Fax, Click the +, Click IP, enter the IP into the address field.
Python
Path:
import sys sys.path # this will show the current path settings sys.path.append('C:\new_path') # this will add the new path, however only until the # current python session is open
To more permanently add a path, use the Windows environment variable PYTHONPATH
Control Panel --> System --> Advanced tab --> Environment Variables (Bottom of page)--> System variables --> look for PYTHONPATH, if it does not exist, use NEW to create it. Use semi-colon to add multiple paths:
C:\path1;C:\path2
IDLE (Python's GUI editor) is slow!
Displaying outputs on IDLE makes the loop very slow. Here is a test:
import time t0 = time.clock() counter = 0 while time.clock() <= t0 + 1: print "junk" counter += 1
Running this code on my 2GHz laptop, results in < 400 Hz loop rate using IDLE. Whereas rate is as high as 15 KHz if the code is run from the command line (by double clicking on the python file).
This is very important when detecting a fast event. For example reading parallel port to detect the TTL pulse from MRI scanner [the philips 3T scanner's pulse is currently only 75 microseconds long].
Presentation
How to get
Download from NeuroBehavioral Systems website (http://www.neurobs.com/) Trial license is free and good for 45 days. Student version is $100 good for 1 year. You will need to place the order first and then fax/email them both sides of your student ID along with the name and contact of your academic advisor. [you need to make an account first to be able to order]
Using two monitors
- In the Windows display settings (right click on Desktop --> Properties --> Settings), choose the second monitor and select "Extend my Windows desktop onto this monitor"
- Restart Presentation, then go to Settings --> Video and add another display (bottom of page) and choose the appropriate driver for each (top of the page)
- Make sure the second monitor (the one that will show the stimulus) is selected as the primary display device.
Getting Help
In addition to the software Help, and looking at previous codes written in the lab, questions may be asked from NeuroBehavioral systems by posting them on their forum. Usually they are very responsive and helpful. Other users may also post a response to your question.
Audio Setup
From Settings-->Audio Choose Custom Mixer-->Primary Buffer Otherwise there will be a ~20ms delay between the time of auditory stimulus presentation and the time that the voltage actually gets to the audio jack! This would be specially crucial for TMS experiments.
Response Button affecting Parallel Port
Make sure you set the response_port_output header parameter to false, otherwise whenever for example response button 3 in pressed, binary code of 3 (00000011) will be sent to the parallel port! In SDL section, before begin type:
response_port_output = false;
l