Difference between revisions of "Beauchamp:Software Installation"

From OpenWetWare
Jump to: navigation, search
(Mounting RAID Volumes from Windows)
(Mounting RAID Volumes from Windows)
Line 139: Line 139:
Additional steps for Windows VISTA:
Additional steps for Windows VISTA:
After enabling your account on the Mac, go to the the Start menu and choose 'Computer.'
From there go to Computer: Local Disk (C:): Windows: regedit
Go to the the Start menu and choose 'Computer'
Go to Computer: Local Disk (C:): Windows: regedit
After clicking on the registry editor application:
After clicking on the registry editor application:
   Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
   Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Revision as of 09:40, 30 July 2008

Brain picture
Beauchamp Lab Notebook

Updating AFNI

AFNI is frequently updated, so it is important to make sure you have the most recent version. Here is an easy way to update (for Intel Macs):

 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

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 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.


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


Optional Installs--> Xcode Tools--> Packages--> X11SDK.mpkg


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 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 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:


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:


To include AFNI in the path, paste the following line into a terminal window:

echo 'set path = ( $path  /Applications/AFNI )' >> ~/.cshrc


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.


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


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 To see the current status of the printer go to

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@ 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. Place license.dat in the MATLAB folder when prompted.
3. Find out that Matlab is already on the computer and cancel installation.

Lab Printer

The lab laser printer is a Dell 5100cn with IP address You can check the printer status by going to 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.

Magstim Rapid TMS

This is our TMS (Transcranial Magnetic Stimulation) machine from Magstim company, UK. The front panel controls are:

2.Run (arm, bring out of standby)
3.Stimulus intensity control

Alternatively to trigger the device, a TTL pulse can be sent to the "Trigger In" port in the back of the device with a BNC connector.

The machine can also be controlled externally via the 36pin Centronics connector in the back panel. A Parallel printer cable can be used/made with a DB25 male connector on one end to connect to PC Parallel Port and a Centronics 36pin male connector on the other end to connect to Magstim Rapid.

NOTE: ECP/EPP needs to be selected for the Parallel Port in BIOS.

A 5V input should be connected to Pin 1 of the Centronics connector to gain external control (either from an external source or by downstepping the available 12V at pin 15 of the Centronics connector.

A 7 bit binary code through pins 2-8 can set the stimulus intensity (only values between 10% and 100% should be used, for example 0110010 for 50%)

Pin 9 is used for triggering by applying a 0.

Magstim instruction manual advises NOT to use the BNC trigger input when using this trigger instead.

Pins 14 and 31 of the Centronics connector can be used to arm and standby the device respectively. Magstim instruction manual advises NOT to use these features because of possible safety issues. However we noticed that when the TMS coil is in the magnet, many a time the inducted signal by the scanner puts the TMS device on standby. Therefore it needs to be armed again to deliver TMS pulses during the gap between scans. So it seems using pin 14 to arm the device is inevitable.

A number of digital and analog output signals are also available at the port including coil temperature and capacitor voltage. See Magstim instruction manual.



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:


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].