Beauchamp:Software Installation: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
(144 intermediate revisions by 6 users not shown)
Line 2: Line 2:
<br>
<br>
<div style="padding: 8px; color: #000000; background-color: #ffffff; width: 730px; border: 2px solid #666666;">
<div style="padding: 8px; color: #000000; background-color: #ffffff; width: 730px; border: 2px solid #666666;">
==Instructions For Installing AFNI are now here==
[[Beauchamp:AFNI_Install]]


== Computer Problems ==
== Computer Problems ==
Line 10: Line 13:
For installing software, you will need to get administrator privileges. Use Directory Utility to set the superuser password (see http://support.apple.com/kb/HT1528 for details). Then reboot, try to login as user "root". This same password can then be used in X11 sudo.
For installing software, you will need to get administrator privileges. Use Directory Utility to set the superuser password (see http://support.apple.com/kb/HT1528 for details). Then reboot, try to login as user "root". This same password can then be used in X11 sudo.


== Backing Up ==
Because hard disks fail, it is important to back up your files regularly.
The data drives are backed up regularly by a tape library, so don't worry about them.
The files on your Mac can be backed up in several ways:
Automatically, using Time Machine.
Find one of the small WD Passport external hard drives and plug into your Mac. Select this disk as a backup disk in Time Machine. Under "Options", make sure to exclude the Parallels directory and disk image (.HDD and .PVS files) because these are huge and will crash Time Machine.
It is also possible to select on the data drives as a Time Machine destination:
  Go into Applications / Utilities and open up terminal
Copy and paste this command into terminal (all on one line)
  defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes
Now all data drives will show up in Time Machine as backup destinations.


== Install Microsoft Office ==
Install Microsoft Office 2016 from the server at
  beauchampsrv/data/SoftwareISOs/Office2016Mac/Office_Mac_Standard_2016.iso
Double click on the ISO, then on the PKG. You may wish to uninstall Office 2011 (drag to the trash from the applications folder). Microsoft will keep updating Office 2011 which wastes time if you are not using it.


Manually, by copying your files elsewhere, such as the UT Nas, or one of the /data drives.


=== Setting up Mendeley ===
To help us share PDFs we use Mendeley + a shared Dropbox folder.
# Assuming you have a dropbox account, ask a lab member to share the folder "LabReferences" with you
# Go to http://www.mendeley.com, setup an account, and download/install the software


One issue with Time Machine network backup is whether TM does an incremental backup (fast) or a full backup every time (slow).
Once you have downloaded and installed Mendeley, we need to add a "watch folder" to Mendeley
See these sites for discussion
# Open Mendeley
http://www.somelifeblog.com/2009/02/fixed-time-machine-backup-to-network.html
# File -> Watch Folder
http://en.wikipedia.org/wiki/Time_Machine_(software)
# Navigate the file tree to Dropbox and check the LabReferences box
http://rolf.haynberg.de/?p=83
# Select OK


== Setting up a New Mac Computer ==
If you want to have your own copy of the PDFs (for annotations, etc), we need to setup Mendeley to organize your library into another directory
After MSIT has plugged in your spiffy new computer and completed the basic installations (Office, Outlook, etc), there are a few more steps to make sure everything is ready to go to analyze some awesome data. First you will need to make sure you have admin privileges on your computer so that you have the necessary permissions to install new software.
# Mendeley Dekstop -> Preferences
# Choose the File Organizer Tab
# Check the box for Organize my files and select an appropriate directory
# You may also check the boxes for "Sort files into subfolders" and "Rename document files" to have Mendeley create a more structured file hierarchy


The first thing you need to do is download XCode from the App Store. This compiles code and will be necessary for later steps.
When you have a PDF that you would like to share, simply copy it to the LabReferences/ folder in your Dropbox. Because all Mendeleys are watching that folder, it will be imported to everyone's library automatically.


Next you need to configure your terminal. Go to Applications > Utilities and drag Terminal to the dock as you will most likely be using it often. Open terminal and go to Preferences. Under "Shells open with", click "Command (complete path)" and enter:
'''NB:''' If people have setup their Mendeley to organize files into a separate directory, once you copy a file into LabReferences, you may not be able to "take it back."
  /bin/tcsh


Then you will need to copy over a .cshrc file which will help you set up your path every time you open Terminal. To copy over Michaels, enter in the command line
=== Additional Software ===
  cp /Volumes/data9/surfaces/scripts/.cshrc ~/


If at any point you need to add something to your path, you can use the following command, filling in the appropriate path location.  
For additional software you might like (Adobe Illustrator, EndNote, Parallels, etc), check the Installing Software section. If we don't have a valid license number anymore we may need to purchase a new one.
  echo 'set path = ( $path  /Applications/AFNI )' >> ~/.cshrc


Next you will need to download Fink. You can do so here:
It is also a good idea to set up TimeMachine on your computer to backup everything to the Data 1 server. If you have Parallels already installed, go to TimeMachine > Options and exclude that folder from the backup.
  http://www.finkproject.org/download/srcdist.php


Follow the instructions on the page. Every time the install guide asks you a question, the default answer will be in square brackets (i.e. [1]) or capitalized (i.e [Y/n]). Choose the default options unless you know what you're doing. After installation is complete, run the pathsetup command and then
== Installing software ==
  fink selfupdate-rsync
  fink index -f


To get the necessary packages for AFNI, run:
  fink install glib2-dev netpbm openmotif3 wget


Next you will need to download AFNI. You can go here for the latest download:
  http://afni.nimh.nih.gov/afni/download/afni/releases/latest
However, if you are running OS X Lion, it's best to get the version with no glib (true as of 01/2012).


  http://afni.nimh.nih.gov/pub/dist/tgz/macosx_10.6_Intel_64.no.glib.tgz
=== Installing Psychtoolbox and GStreamer ===
====How to setup Matlab2013b and GStreamer on Yosemite ====
Psychtoolbox  is not compatible with Matlab 2014a and higher, so you need Matlab2013b. But Matlab 2013b needs a patch to run on Yosemite.
#To install Matlab 2013b patch:
##If you do not already have Matlab2013b installed, then install it from Mathworks.
##Go to the Beauchamplab server>SoftwareISOs>MatlabR2013b_patch.dmg>R2013b_patch_1098655.dmg
In order to make the videos run on Psychtoolbox, you need gStreamer.
#To install gStreamer:
##Open bash shell in Terminal (check terminal> preferences>shells open with>default login shell >/bin/bash).
##Copy paste into terminal: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
##Follow the steps.
##After homebrew is installed, copy paste into terminal: brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav
##Open Matlab2013b and you are all set to run your experiment!


Next you will download FreeSurfer.
  https://surfer.nmr.mgh.harvard.edu/fswiki/Download


This takes about 30 minutes to download. Go grab some coffee. After it finishes downloading and installing, if your .cshrc file doesn't already have it (to check, type: open -e ~/.cshrc), add FreeSurfer to the path:
==== Installing Psychtoolbox with Matlab ====
  echo ‘setenv FREESURFER_HOME /Applications/freesurfer‘ >> ~/.cshrc
These instructions can be used to install Psychtoolbox 3.0 with Matlab (64-bit versions). You will need to have administrator privileges, as well as access to ms-nbafmri.
  echo ‘source $FREESURFER_HOME/SetUpFreeSurfer.csh' >> ~/.cshrc
# Copy <code>DownloadPsychtoolbox.m</code> from the SoftwareISOs folder to the desktop.
#Ensure that you have write access for the pathdef.m file.
##Open a finder window and click on Applications
##Right-click on Matlab -->Get Info. At the very bottom, under Custom Access, make sure you have Read & Write access. If you do not, click the picture of the lock (bottom right corner), enter your password, and then change to the correct privilege. Click on the lock again to save your changes.
##Right-click on Matlab --> Show Package Contents. Right-click on toolbox --> Get Info. Make sure you have Read & Write Access.
##Open the toolbox folder. Right-click on local --> Get Info. Make sure you have Read & Write Access.
##Right-click on pathdef.m. Make sure you have Read & Write Access.
#Open Matlab, cd to the desktop, and execute the Download script.
#Accept all certificate requests and choose defaults during installation
#'''For running Psychtoolbox codes in the new version of Matlab (2013a and over), always use the full path to direct the code to the stimulus directory.'''


== Installing and Updating AFNI ==
==== Installing GStreamer ====
All lab Macs should have AFNI installed. AFNI is frequently updated, so it is important to make sure you have the most recent version. To update, type
In order to run Psychtoolbox with 64-bit Matlab, you will need to install GStreamer. <b>Not all versions of GStreamer are compatible!</b> Make sure to use the one that's on the server (and make sure you don't update this file!)
  @update.afni.binaries -defaults
#Double-click on <code>gstreamer-sdk-2013.6-universal.pkg</code> in the SoftwareISOs folder.
Many common problems arise because users are using an old version of afni. Type
#Proceed through the installation until you get to Installation Type (where it asks for your installation location). Click on Customize (at the bottom of the window) and click on any boxes that aren't checked. Finish the installation.
  afni -version
#To ensure that Psychtoolbox is installed correctly, you can test a demo by opening Matlab and typing <code> LoadMovieIntoTexturesDemo </code>.
to find out what version you have. If it is older than one month, update it!


If AFNI is being installed for the first time, it must be downloaded manually from
==== Installing Octave and Psychtoolbox ====
  http://afni.nimh.nih.gov/afni/download/afni/releases/latest
These instructions were tested under Mac OSX 10.7.4 with Octave 3.2.6 and Psychtoolbox (PTB) 3.0. They should be completed AFTER the initial UNIX installation steps, including installing XCode tools, including command line tools; this installs "svn" which is needed.
Click and download the distribution for Intel Macs. After downloading, double click the tar file; this will create a new directory containing all of the AFNI programs. Drag this folder into the Applications directory. For ease of access, rename the folder and call it "afni" (easier to type than, for example, macosx_10.5_Intel). If you are updating, delete the old afni folder before renaming.
The instructions require access to ms-nbafmri, so make sure you are connected to the network via ethernet, UTHSC wifi, or have an open VPN connection
For OSX Lion, you may need to download the afni binaries with no glib:
# Install <code>Octave-3.2.3-i386.dmg</code> from <code>ms-nbafmri/data/SoftwareISOs</code> (i.e., double-click the dmg file)
  http://afni.nimh.nih.gov/pub/dist/tgz/macosx_10.6_Intel_64.no.glib.tgz
##Optional: In the Extras/ directory of the Octave dmg there is Gnuplot<sup>†</sup>, which is necessary if you want to make quick plots with Octave
A more automatic way to update (for Intel Macs) is the following.
# Copy <code>DownloadPsychtoolbox.m</code> from <code>ms-nbafmri/data/SoftwareISOs</code> to the desktop
Set the variable "pkg" to the latest version (as of 6/2009, 64-bit 10.5):
# Open Octave (default install is /Applications/Octave), cd to the desktop, and execute the Download script
   set pkg = macosx_10.5_Intel_64
  octave-3.2.3:1> cd Desktop/
   wget http://afni.nimh.nih.gov/pub/dist/tgz/{$pkg}.tgz
   octave-3.2.3:2> DownloadPsychtoolbox
  tar xvfz {$pkg}.tgz
# Accept all certificate requests and choose defaults during installation
# Ensure PTB is installed correctly by testing a demo:
   octave-3.2.3:3> LoadMovieIntoTexturesDemoOSX
If you get an error at this step, it may be because PTB doesn't like your dual monitor configuration. Exit Octave, Change Display Mode to "Mirrored", then Open Octave and run the demo again


No matter how you update, you must type
Happy PTB'ing!!
  rehash
after you update so that the shell will find the newest version or programs.
Another way (change the package and bindir appropriately):
sudo @update.afni.binaries -package macosx_10.5_Intel_64 -bindir /Applications/afni


Optionally, it can be good to test the new version BEFORE overwriting the old version. Here is how we can test SUMA:
† If you try to plot from Octave (<code> plot( 1:10) </code>) and get an error about DYLD_LIBRARY_PATH, then we need to make one more edit for plotting to work:
   cd {$pkg}
   sudo open -e /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot
  ./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 {$pkg}/* /Applications/AFNI/
Find the line: <code>DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"</code>
  rm -r {$pkg}.tgz {$pkg}
and replace it with <code>DYLD_LIBRARY_PATH="${ROOT}/lib"</code>
Save the file then relaunch Octave and try to plot again


If AFNI won't run after updating, it is probably because some of your libraries are out of date. Follow the instructions on the AFNI web site to install all necessary libraries; this will install the newest versions. If errors still occur, a failsafe method is to compile AFNI on your machine; this will ensure that only the available libraries are used.
  octave-3.2.3:1> sombrero()


Some statistical programs in AFNI require the free statistical package "R". This can be downloaded from
=== Installing Matlab ===
http://www.biometrics.mtu.edu/CRAN/bin/macosx/
If you want to use Psychtoolbox with Matlab (and who wouldn't?) a 32-bit version is needed; R2010a was the last 32-bit release. R2010 a located in the SoftwareISOs folder on the server. Follow the instructions in the UT_License.rtf file.
for Intel 32-bit OSX will do the trick) as well.


== Installing software on a New PC or Mac ==
see Ismael for Instructions
ISOs (CD or DVD disk images) are kept on the server in
  /data9/Software_isos
Open the ISO of the software that you would like to install; if a license key is required, it will typically be in a separate .txt file.
MSIT (Ismael Perez) will install a basic set of software, including Microsoft Office, if asked. Ismael can also give you the address from which the software can be downloaded. At one point, the URL for Office was
  \\139.52.5.233\nba-tera\office 2007
MSIT requires security settings, such as automatic logout after 10 minutes. VirusScan can be downloaded from the MSIT web site, currently at
  http://its.uth.tmc.edu/resources_mcafeedownload.htm
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.
  http://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 Presentation, you may find it easier to swap the control and Command keys for consistency with Mac OSX.
In Windows XP, This can be done with
  remapkey.exe
A program that is in the Windows Server 2003 Resource Kit Tools (free download from Microsoft).
Download the tools, go to Start/Run/remapkey
Drag the "Left Windows" key onto the "Ctrl" key and vice-versa.
This edits the registry and takes effect on the next reboot.
The registry can also be edited manually.
If you find the Windows Startup and Shutdown sounds annoying they can be turned off from Control Panel/Sounds (in Windows XP).
In Windows 7, remapkey.exe does not work. Instead, edit registry manually or try one of the following utilities:
KeyTweak (in "FullTeach" mode); SharpKeys, KeyMapper, etc.


== Configuring a Mac ==
=== Presentation ===
As of 2010, all new Macs will be connected to the Active Directory server, which means that you must use your global UT username and password to login to a Mac.
A request must be made to MSIT to give all users of the machine  admin privileges; these need to be invoked to install software.
MSIT (Ismael Perez) will install a basic set of software, including Microsoft Office, if asked.


<b><u>How to get</u></b>


AFNI and FreeSurfer are the most commonly used  analysis tools and should be installed on every Mac. Depending on the Mac purchased, it may be required to install compilers and other libraries using XTools and fink.
Download from NeuroBehavioral Systems website (http://www.neurobs.com/)
Trial license is free and good for 30 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 order and invoice number, as well as the name and contact of your academic advisor. You will need to make an account first to be able to order. After you have successfully purchased the license, you must sign in under the lab ID to retrieve the access code.


Go to Finder, Preferences, General, "Show These Items on the Desktop" select All. Go to Advanced, select "Show all filename extensions", deselect "Show warning before changing an extension".
<b><u>Using two monitors</u></b>


For software installation, it can be useful to be a "root" (super-user). To enable this function, type
- In the Windows display settings (right click on Desktop --> Properties --> Settings), choose the second monitor and select "Extend my Windows desktop onto this monitor"


  sudo passwd root
- 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)
Enter your admin password, then a new password for root, and you're done


That Startup "beep" made by the Mac can be disable with various utilities, including
- Make sure the second monitor (the one that will show the stimulus) is selected as the primary display device.
  StartupSoundPrefPane


ISOs can be created using the Disk Utility in Mac OSX.
<b><u>Getting Help</u></b>


== Running Windows on a Mac ==
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.
It can be useful to have Windows installed on a Mac. There are a number of ways to do this. Parallels can be purchased; this allows Windows to be used at the same time as Mac OSX. For the free Boot Camp utility that comes with Mac OSX can be used. In this configuration, only one of OSX or Windows can be used at a time. In either case, a licensed copy of Windows must be purchased.
MSIT does NOT have a site license for Windows 7; a copy must be purchased. A new copy can be purchased from Microsoft (~ $300) or an upgrade version can be purchased at the UT bookstore ($40 in 9/2010). However, because this is an upgrade DVD that will only upgrade an existing installation of Windows, a previous version of Windows must be installed first. This can be done easily using the Windows ISOs stored in /Volumes/data1/software_isos.
Choose "Install from a disk image" in Parallels. Start with Windows Vista
  WindowsVistaUltimateSP132bit.iso
Then, connect the Window7 ISO to the Windows Vista VM using the Devices menu in Parallels.  
  Windows7Ultimate32bitUpgradeOnly.iso
Follow the instructions to upgrade.
older instructions:
<b>Although you are upgrading, make sure you choose the "Clean Install of Windows" option for each upgrade.</b> Otherwise, Parallels shared folders might not work.
The physical DVDs are located in the Tandon Lab. The Tandon Lab has a copy of Windows XP with the UT site license key purchased from the UT book store. Copies of this disc work fine to install Windows under Parallels. For Boot Camp, the original disc must be used (with Volume Label VRMPVOL_EN) and possibly without the license key text file. An ISO of this CD can be found on /data6 under Tandlon Lab Warez and burned if not available.


== Configuring your login shell ==
<b><u>Audio Setup</u></b>
UNIX can use different command line interfaces, called shells. The shell preferred by AFNI and FreeSurfer is called tcsh.
The UNIX command line can be accessed through either the X11 program or the Terminal program. The Terminal program is preferred; it makes cutting and pasting between windows and changing window properties easier. To change the login shell used by Terminal, go to Terminal/Preferences/Startup, in "Shells open with" select Command and enter
  /bin/tcsh
For ease of access, drag the Terminal icon (or the X11 icon) to the dock.


Changing the login shell used by X11 is more complex.
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.
If you get an error when trying to play audio stimuli (something like "Device Is In Use") there is probably a strange interaction with Parallels.
This can be fixed in Parallels 7 by Virtual Machine/Configure/Sharing select all sharing options (Share Profile and SmartMount)




Every time tcsh starts, it reads commands from the file .cshrc
<b><u>Response Button affecting Parallel Port</u></b>
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.
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!
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. You may also have to go to system preferences and turn off the middle mouse button to access Dashboard/Expose/Spaces.
In SDL section, before begin type:


Other software that may be handy to have:
response_port_output =  false;
Adobe Creative Suite; Firefox; Skype


To install software, it may be necessary to have a root password.
<b><u>Configuring Presentation to use USB for output</u></b>
To create one, type sudo passwd root


<u>Attaching USB to the computer</u>
The computer first needs the NI-DAQmx software installed - download NI USB-6501 (http://zone.ni.com/devzone/cda/tut/p/id/6913).  Before you install anything, make sure you have .NET Framework 2.0 installed (available at: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en).  Under the installer features menu, the bare minimum is:


NB: SUMA is unstable with some versions of X11. If SUMA crashes, upgrade your X11 as follows.
NI-DAQmx 8.8.0
First see which is the latest version by going to
  ->.NET Framework 3.5 Lanugages
    http://xquartz.macosforge.org/trac/wiki/Releases
  ->.NET Framework 2.0 Lanugages
Next, follow these instructions (replacing 2.3.0.pkg with the latest version)
   ->.NET Framework 1.1 Lanugages
   quit X11
   ->ANSI C Support
  http://xquartz.macosforge.org/downloads/X11-2.3.0.pkg
   Install the new X11
  logout, login and relaunch X11


You will have to restart after you install the software.


The built-in Preview software in Mac OSX is the best way to view PDFs and does not require downloading anything (unlike Adobe Acrobat). For editing PDFs, the free Skim software is recommended
After the restart, connecting the device via USB, Windows will detect a "New Data Acquisition Device", and present you with a window offering several options.  Select "Configure and Test This Device Using NI Measurement & Automation Explorer" and run a Self-Test when the window opens. If this passes, the USB device can now be used to control TMS through Presentation.
http://skim-app.sourceforge.net/


== Connecting to the new Mac Server ==
<u>Configuring Presentation to use USB</u>


Click here for page on connecting to the new Mac Server
Now we need to make a few adjustments to the settings.  Under the 'Settings' tab, select the 'Port' option and find the 'Output Ports' box.  In this box we need to have a total of 2 ports.
[[Beauchamp:ServerConnection]]


== Notes on a New Mac Server ==
Add the first port, and make sure the following options are set:
Apple no longer makes the XServe, so must switch to NAS/SAN, or a PC server, or a Mac Pro or Mac Mini.
Port: USB-6501
possibilities:  
Data source: port0
Register span: 1
Inversion mask: 0
Default pulse width: 5 ms
For the second port, the following options need to be set:
Port: USB-6501
Data source: port1
Register span: 1
Inversion mask: 255
Default pulse width: 5 ms


# Drobo  ordered a demo unit, couldn't get it to work
<u>Using Presentation via USB</u>
# Mac Mini with thunderbolt + Promise thunderbolt 6-bay RAID (daisy chain 2 for 12-bay)
The USB controller uses a new library [[Image:Beauchamp_USB_TMS_library.pcl]] to control the TMS machine. A sample presentation you can use to test to the USB control of the TMS is available: [[Image:Beauchamp_OhmanTMSScenario.sce]]. In this scenario, the up/down arrows are used to control the intensity of the TMS, while the space bar is used to toggle arming/disarming the device, and the return key is used to fire the device. The sample presentation can also be used to help write code in the future - perhaps the most important point is that it is no longer necessary to define an output port inside the pcl, including the Beauchamp_USB_TMS_library.pcl is sufficient.
# ReadyNAS
# SATA Beast http://www.nexsan.com/products/satabeast-xi/index.aspx#/gallery
# Promise RAID http://store.apple.com/us/product/H1142VC/A?mco=MTY3ODQ5OTY
# Promise Thunderbolt to connect to Mac Mini
# G-Tech RAID (small)  http://store.apple.com/us/product/H4656VC/A?mco=MTY3ODQ5OTY
# Aberdeen RAID (recommended by Ismael) http://www.aberdeeninc.com
# Synology NAS http://www.synology.com/


== Configuring a New Mac Server ==
<b><u>Using and recording sound responses</u></b>


Special boot-up key strokes (hold down during boot-up): Apple-Option-P-R to erase the PRAM; C to boot up from CD; Option for a list of all boot-up choices, including CD, BootCamp, etc.
Sound response buttons can be defined in Presentation using Settings-->Response-->Devices-->sound device (threshold or offset)


New servers can be ordered with two hard drives. These hard drives can be set to mirror one another so that if one fails, the server can continue operating. To do this, boot the Server from the OSX DVD that came with the Server (using the Startup Disk icon in System Preferences.) Then, use Disk Utility to drag and drop the Server hard drives into a RAID set. Finally, reinstall OSX on the new RAID set.
Once you chose "sound device" click on "properties" button to the left of "Devices" window and adjust the parameters. You need to choose the correct microphone from the pull down menu, set the threshold, ...
Apple recommends creating an image of the boot-up disk onto an external disk using the Image utility. Then, in the event of a hard disk crash the Server can quickly and easily be restored to health, including all configurations. Before reformatting the hard disk, use the disk utility Repair Disc and Repair Permission options.
Ask Network Ops (David Zhang) for fixed IP addresses for the server. Currently, servers are located in the NBA VLAN #236. Network Ops needs the MAC addresses for each jack.
The MAC address can be read from the rear of the machine or as follows:
  ifconfig
returns
  ether 00:17:f2:06:7b:04
Cabling guys (David Findlay) need to know the Mac address and the VLAN.
Current <ac addresses for new XServe (ike) are
en0 00:24:36:f2:b6:e0
en1 00:24:36:f2:b6:dc
with corresponding DHCP
129.106.236.182
129.106.236.183
The HP Tape Loader has
Mac address: 002264CCE364
to IP address
129.106.236.185


Bidwell has Mac address
To record a sound response, check the "save responses" button and set the recording duration. Each response will be saved in a separate wave file. You can also check the button to save all responses in one wave file (in addition to the individual wave files).
00:0d:93:9e:73:92
to IP address
  129.106.236.182


Another way to record sounds is using:
sound_recording{
duration = 1000;
base_filename = "some_file_name";
};


In general, no extra software (AFNI, etc.) is installed on Servers to ease maintenance and allow them to be devoted to their calling.
within a trial.
The Promise RAID can be configured through the serial port-to-RJ11 cable included with the system.
It may be possible to do this with the XServe (possibly using the "screen" command in Terminal or a terminal emulation program such as Zterm) but I could not figure out how to connect.
Instead, a PC laptop with a serial cable and Microsoft Hyperterminal (C:/Program Files/WindowsNT/hypertrm.exe) was used.
For more details, see
[[Beauchamp:PromiseConfig]]
After initial configuration, the RAID can be tweaked via the web interface.
Or, through it's web-based management system. The system will automatically obtain an IP address from DHCP. It will broadcast this address via Bonjour. Open Safari, open Preferences/Bookmarks, click "Include Bonjour". Click Bonjour on favorites toolbar and select VTrak. Current IP address is 139.52.6.21.
Log in is administrator, password is password. (Computer running Safari must be on same subnet.)
To setup the Promise RAID, follow the instructions on
http://support.apple.com/kb/HT1164
and
http://support.apple.com/kb/HT1200
Which essentially means using the web interface (Adminstrative Tools/Import/Configuration Script) to upload this text file; it is then executed automatically.
[[Image:Beauchamp_PromiseRAIDConfigScript.txt]]
Also note that there are many different fiber channel cards and cables. See the compatibility matrix at
  http://support.apple.com/kb/HT1769
Creating and synchronizing takes many hours (overnight). After creation of the RAID set, turn on the XServe. You will see an error message saying the disks are not readable. Use Disk Utility to partition the drives (one big partition for each RAID set).
Next, use WorkGroup Manager to add users with passwords who can access the drives. To ease managment, separate groups can be created for each partition (e.g. data1 group, data2 group). Users who want access to a particular partition can be easily added or subtracted to the group. Under the Sharing tab of Server Admin, each partition can be given an owner (MSB) and a group (e.g. data1), both of which have Read & Write access. Under the File Sharing tab, click on a Volume to share, then click Share. It will show up in the Share Points section. AppleCare recommends creating a separate folder to share if it will be used for Time Machine backups, to avoid creating share points within share points.
Use RAID admin to check on the RAID.
A helpful guide is the Mac OSX File Services Administrator manual.


Setting up user accounts.
==== Parallels and Presentation ====
Create accounts for each user (easiest if use same username and ID as on previous system).
Presentation runs only under Windows, but can be run on a Mac using BootCamp OR virtualization software such as VMWare or Parallels.
It is easiest to create one "group" for each RAID set (data drive). Then users can be easily added to groups to give them access to the appropriate data.
Here are some benchmarks for a 2010 MacBook Pro with a 2.66 GHz Intel Core i7 and 4 GB RAM:
This is done in Workgroup Manager.
Then, new users


== Installing/Updating Programs ==
To assess performance under Windows 7, go to Control Panel/Performance Information and Tools.




=== XCode/XTools ===
Scores are on a scale from 1.0 to 7.9
  calculations per second    memory access    Windows graphics    3D graphics for games  hard drive


Windows 7 (boot camp)
6.8
5.5
6.4
6.4
5.9


windows 7 (parallels) (1 CPU, 1GB RAM)
4.9
4.5
5.9
4.8
6.2


X11 is the display system for Macs and most Unix machines. XCode 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 files named XTools and XCode. Alternately, you can find it on the server in /data9/software_isos.
windows 7 (parallels) (2 CPU, 2GB RAM)
This step may not be required for newer Macs.
4.9
As of May 2011, Apple is charging for newer versions of XCode.
5.5
5.9
4.8
6.2


Optional Installs--> Xcode Tools--> XcodeTools.mpkg
To summarize, biggest hit is calculations per second and graphics.


AND
== Running Windows on a Mac ==
Get Ismael to help you


Optional Installs--> Xcode Tools--> Packages--> X11SDK.mpkg
== Connecting to the Lab Mac Server ==


  http://trac.macosforge.org/projects/xquartz
The name of the Mac Mini server is ms-nbafmri (purchased 2012).
To connect, type Apple-K, then the server IP address.
The username is beauchamplab; ask MSB for the password. There are three share points:
# <b>Backups</b>  Used for Time Machine Backups
# <b>beauchamplab</b>  not used
# <b> Data </b> Where all lab data and stuff is stored.
Connect to all three (select all and click "OK"). Open a finder window and double click on "data", or open a Terminal window and type
  cd /Volumes/data


1. XcodeTools and X11SDK from the Leopard DVD.
== Backing Up ==
2. Maybe the latest X11 package from trac.macosforge.org
Because hard disks fail, it is important to back up your files regularly. The best way to do this is to keep all important work on DropBox. Then there is one copy in the cloud and one your local machine.
3. glib2-dev glib netpbm openmotif from fink (stable source will do).
It is also good to back up files on your Mac automatically, using Time Machine. Connect the Lab Mac Server (previous step) and make sure the Backups folder is mounted. Open System Preferences/Time Machine/Select Disk/Select "Backups"
4. mesa mesa-libglw mesa-libglw-shlibs mesa-shlibs from fink (unstable source).
<b>Ask MSB to type in the admin password. It will not work with the beauchamplab password.</b> You can exclude some directories from being backed up to save time and space. It is good to exclude the DropBox folder because this is already backed up by Dropbox.
If you have Parallels installed on your computer, you can tell Parallels (under the Preferences menu) not to back up the Parallels VM. This will save time because there is no real reason to back up Windows (can be easily reinstalled).


If you have an older Mac, you will periodically need to go to Apple.com and download the latest XCode and XTools. They are NOT automatically installed by the Apple Software Update routines.
== Configuring a New Mac Server ==
 
The lab's data is stored on three Promise Pegasus RAID systems attached to the Mac mini.
"You will need to re-install this package after future OS, and Security Updates delivered through Apple's Software Update. Additionally, you should reinstall this package after installing XCode."
# January 2013: 12 TB  (10 TB available with RAID5)
 
# June 2013: 18 TB (15 TB available with RAID5)
From: http://xquartz.macosforge.org/trac/wiki/X112.6.1
# May 2014: 32 TB
 
When installing a new RAID:
=== Configuring your login shell ===
# Inform all users the machine will be down for a while
UNIX can use different command line interfaces, called shells. The shell preferred by AFNI and FreeSurfer is called tcsh.
# Install all updates to the OSX
The UNIX command line can be accessed through either the X11 program or the Terminal program. The Terminal program is preferred; it makes cutting and pasting between windows and changing window properties easier. To change the login shell used by Terminal, go to Terminal/Preferences/Startup, in "Shells open with" select Command and enter
# Disconnect all RAIDs, then connect them one at a time and perform firmware updates
  /bin/tcsh
# Connect the new RAID
For ease of access, drag the Terminal icon (or the X11 icon) to the dock.
 
Changing the login shell used by X11 is more complex.
 
 
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. You may also have to go to system preferences and turn off the middle mouse button to access Dashboard/Expose/Spaces.
 
Other software that may be handy to have:
Adobe Creative Suite; Firefox; Skype
 
To install software, it may be necessary to have a root password.
To create one, type sudo passwd root
 
 
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
 
 
The built-in Preview software in Mac OSX is the best way to view PDFs and does not require downloading anything (unlike Adobe Acrobat). For editing PDFs, the free Skim software is recommended
http://skim-app.sourceforge.net/
 
 
=== Fink ===
 
This step may not be required for newer Macs.
 
Fink is a program package manager for Macs. Download the program from the Fink webpage:  
 
http://fink.sourceforge.net/.
 
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 path, 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 install wget
 
If you’re using OS X Lion you may not need the glib package.
 
 
 
Fink
This step may not be required for newer Macs.
 
Fink is a program package manager for Macs. Download the program from the Fink webpage:
 
http://fink.sourceforge.net/.
 
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 path, 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.
TimeMachine is used to back up on Pegasus RAID to the other. (This does not protect against failures of the Mac Mini but a new Mini is available quickly).
Individual Macs may also be backed up to the RAID. Go to OSX Server and turn on the Time Machine service, adding a share point. This share point can only be accessed with the admin password, assuming it is created with the admin password.


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:
=== OsiriX ===
OsiriX is a DICOM viewer that may be helpful if you need to upload DICOMs, especially from a CT scan taken after electrode surgery with epilepsy patients. It can be downloaded from here:
  http://www.osirix-viewer.com/


echo ‘setenv FREESURFER_HOME /Applications/freesurfer‘ >> ~/.cshrc
echo ‘source $FREESURFER_HOME/SetUpFreeSurfer.csh' >> ~/.cshrc


FreeSurfer needs a license file. You can request on their web site or copy it from data9:
=== R ===
cp /Volumes/data9/.license /Applications/freesurfer/
This program is used for the structural equation modeling. If you plan on doing functional connectivity as part of your data analysis, this is a good program to have. You can download it here:
  http://cran.r-project.org/bin/macosx/


== Caret ==
To utilize 1dSEM, click the R icon on the console, then locate the 1dSEM.R script in the AFNI folder and load it.
Go to [http://brainmap.wustl.edu/caret/#DownloadCaret 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 ==
== Creating Symbolic Links ==
Line 442: Line 290:




== Using the Dell 5100cn Color Laser Printer ==
== Printing ==
Download the current drivers for your computer from the Dell website
 
  http://support.dell.com/support/downloads
=== Printing Double Sided ===
The printer IP is 139.52.6.205
On a new computer you may notice that the option to print two-sided is greyed out. To fix this, go to System Preferences, Print & Scan, select the printer, then press the Options & Supplies button. Under the Driver tab, click Duplex Printing Unit.
To see the current status of the printer go to
 
http://139.52.6.205
=== Dell 5100cn Color Laser Printer  ===
Here is a copy of the manual
Here is a copy of the manual
http://openwetware.org/images/8/83/Dell_5100cn.pdf
http://openwetware.org/images/8/83/Dell_5100cn.pdf
To use the printer, download the current drivers for your computer from the Dell website
  http://support.dell.com/support/downloads
Shortcut: drivers are on the server in
  /data/SoftwareISOs/MiscSoftware/Dell_5100_cn


On Windows XP, you must first add a port, then configure the printer.
On Windows XP, you must first add a port, then configure the printer.
On Mac OSX, first run the Installer. Then open System Preferences/Print & Fax
On Mac OSX, first run the Installer. Then open System Preferences/Print & Fax
Click the "+" button to add a printer, click on "IP" and enter the IP address (above.)
**Protocol must be Line Printer Daemon -- LPD


Click the "+" button to add a printer,
**Protocol must be Line Printer Daemon -- LPD
enter the IP address (above.)


There are sometimes several drivers to choose from.
There are sometimes several drivers to choose from.
Line 465: Line 318:
On the Mac, go to System Preferences, Print & Fax, Click the +, Click IP, enter the IP into the address field.
On the Mac, go to System Preferences, Print & Fax, Click the +, Click IP, enter the IP into the address field.


 
=== HP Photosmart Color Inkjet Printer  ===
== Using the HP Photosmart Color Inkjet Printer  ==
Insert the installation CD into your computer and follow the instructions.
Insert the installation CD into your computer and follow the instructions.
The Mac installation software is in /Volumes/data9/Software_isos/HPPrinter/HP Installer
The Mac installation software is in /Volumes/data9/Software_isos/HPPrinter/HP Installer
Line 472: Line 324:
   http://hpfd76cd.local./index.htm?cat=info&page=printerInfo
   http://hpfd76cd.local./index.htm?cat=info&page=printerInfo


== Mounting Volumes ==


== Mounting RAID Volumes from Windows ==
=== 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.
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
The menu should say
Line 501: Line 354:
In Windows, go to Internet Explorer and type in the URL above.
In Windows, go to Internet Explorer and type in the URL above.


== Mounting a Volume after sshing to a different machine ==
=== Mounting a Volume after sshing to a different machine ===




Line 513: Line 366:
  cd mount
  cd mount
  mkdir data9
  mkdir data9
  mount_afp -i afp://akingon@129.106.236.180/data9 data9
  mount_afp -i afp://akingon@ipaddress/data9 data9
  enter password  
  enter password  
   
   
and now you can cd into data9
and now you can cd into data9
==Installing Matlab==
In general, MSIT is the best source for IT issues, including installing Matlab. Contact our MSIT rep, currently Ismael Perez, for help.
To install Matlab for use in the Beauchamp lab:
:1. Download and install matlab [http://www.mathworks.com/downloads/web_downloads 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
January 2009: A common cause for failure is that the DNS service cannot interpret the hostname. Instead, us
  SERVER 129.106.30.82 INTERNET=129.106.30.82 27000
  USE_SERVER
The last "27000" is probably optional. Another cause for failure is that you have downloaded the latest version of Matlab from Mathworks, while our license only supports a previous version. For instance, in Jan 2009, our license only support 2008a, although the website encourages you to download 2008b as the latest version.


==Python==
==Python==
Line 560: Line 400:


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].
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==
<b><u>How to get</u></b>
Download from NeuroBehavioral Systems website (http://www.neurobs.com/)
Trial license is free and good for 30 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 order and invoice number, as well as the name and contact of your academic advisor. You will need to make an account first to be able to order. After you have successfully purchased the license, you must sign in under the lab ID to retrieve the access code.
<b><u>Using two monitors</u></b>
- 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.
<b><u>Getting Help</u></b>
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.
<b><u>Audio Setup</u></b>
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.
<b><u>Response Button affecting Parallel Port</u></b>
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;
<b><u>Configuring Presentation to use USB for output</u></b>
<u>Attaching USB to the computer</u>
The computer first needs the NI-DAQmx software installed - download NI USB-6501 (http://zone.ni.com/devzone/cda/tut/p/id/6913).  Before you install anything, make sure you have .NET Framework 2.0 installed (available at: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en).  Under the installer features menu, the bare minimum is:
NI-DAQmx 8.8.0
  ->.NET Framework 3.5 Lanugages
  ->.NET Framework 2.0 Lanugages
  ->.NET Framework 1.1 Lanugages
  ->ANSI C Support
You will have to restart after you install the software.
After the restart, connecting the device via USB, Windows will detect a "New Data Acquisition Device", and present you with a window offering several options.  Select "Configure and Test This Device Using NI Measurement & Automation Explorer" and run a Self-Test when the window opens.  If this passes, the USB device can now be used to control TMS through Presentation.
<u>Configuring Presentation to use USB</u>
Now we need to make a few adjustments to the settings.  Under the 'Settings' tab, select the 'Port' option and find the 'Output Ports' box.  In this box we need to have a total of 2 ports.
Add the first port, and make sure the following options are set:
Port: USB-6501
Data source: port0
Register span: 1
Inversion mask: 0
Default pulse width: 5 ms
For the second port, the following options need to be set:
Port: USB-6501
Data source: port1
Register span: 1
Inversion mask: 255
Default pulse width: 5 ms
<u>Using Presentation via USB</u>
The USB controller uses a new library [[Image:Beauchamp_USB_TMS_library.pcl]] to control the TMS machine.  A sample presentation you can use to test to the USB control of the TMS is available: [[Image:Beauchamp_OhmanTMSScenario.sce]].  In this scenario, the up/down arrows are used to control the intensity of the TMS, while the space bar is used to toggle arming/disarming the device, and the return key is used to fire the device.  The sample presentation can also be used to help write code in the future - perhaps the most important point is that it is no longer necessary to define an output port inside the pcl, including the Beauchamp_USB_TMS_library.pcl is sufficient.
<b><u>Using and recording sound responses</u></b>
Sound response buttons can be defined in Presentation using Settings-->Response-->Devices-->sound device (threshold or offset)
Once you chose "sound device" click on "properties" button to the left of "Devices" window and adjust the parameters. You need to choose the correct microphone from the pull down menu, set the threshold, ...
To record a sound response, check the "save responses" button and set the recording duration. Each response will be saved in a separate wave file. You can also check the button to save all responses in one wave file (in addition to the individual wave files).
Another way to record sounds is using:
sound_recording{
duration = 1000;
base_filename = "some_file_name";
};
within a trial.


==Misc Unix Notes==
==Misc Unix Notes==
Line 658: Line 416:
   echo $idx
   echo $idx
   end
   end
==Parallels and Presentation==
Presentation runs only under Windows, but can be run on a Mac using BootCamp OR virtualization software such as VMWare or Parallels.
Here are some benchmarks for a 2010 MacBook Pro with a 2.66 GHz Intel Core i7 and 4 GB RAM:
To assess performance under Windows 7, go to Control Panel/Performance Information and Tools.
Scores are on a scale from 1.0 to 7.9
  calculations per second    memory access    Windows graphics    3D graphics for games  hard drive
Windows 7 (boot camp)
6.8
5.5
6.4
6.4
5.9
windows 7 (parallels) (1 CPU, 1GB RAM)
4.9
4.5
5.9
4.8
6.2
windows 7 (parallels) (2 CPU, 2GB RAM)
4.9
5.5
5.9
4.8
6.2
To summarize, biggest hit is calculations per second and graphics.

Revision as of 13:23, 9 September 2015

Brain picture
Beauchamp Lab




Instructions For Installing AFNI are now here

Beauchamp:AFNI_Install

Computer Problems

If you have having software or hardware problems, submit a help ticket describing the problem. Do not be afraid to request help from MSIT. They are paid to help you! The link for help tickets is http://med.uth.tmc.edu/msit/mshelp.htm For installing software, you will need to get administrator privileges. Use Directory Utility to set the superuser password (see http://support.apple.com/kb/HT1528 for details). Then reboot, try to login as user "root". This same password can then be used in X11 sudo.


Install Microsoft Office

Install Microsoft Office 2016 from the server at

 beauchampsrv/data/SoftwareISOs/Office2016Mac/Office_Mac_Standard_2016.iso

Double click on the ISO, then on the PKG. You may wish to uninstall Office 2011 (drag to the trash from the applications folder). Microsoft will keep updating Office 2011 which wastes time if you are not using it.


Setting up Mendeley

To help us share PDFs we use Mendeley + a shared Dropbox folder.

  1. Assuming you have a dropbox account, ask a lab member to share the folder "LabReferences" with you
  2. Go to http://www.mendeley.com, setup an account, and download/install the software

Once you have downloaded and installed Mendeley, we need to add a "watch folder" to Mendeley

  1. Open Mendeley
  2. File -> Watch Folder
  3. Navigate the file tree to Dropbox and check the LabReferences box
  4. Select OK

If you want to have your own copy of the PDFs (for annotations, etc), we need to setup Mendeley to organize your library into another directory

  1. Mendeley Dekstop -> Preferences
  2. Choose the File Organizer Tab
  3. Check the box for Organize my files and select an appropriate directory
  4. You may also check the boxes for "Sort files into subfolders" and "Rename document files" to have Mendeley create a more structured file hierarchy

When you have a PDF that you would like to share, simply copy it to the LabReferences/ folder in your Dropbox. Because all Mendeleys are watching that folder, it will be imported to everyone's library automatically.

NB: If people have setup their Mendeley to organize files into a separate directory, once you copy a file into LabReferences, you may not be able to "take it back."

Additional Software

For additional software you might like (Adobe Illustrator, EndNote, Parallels, etc), check the Installing Software section. If we don't have a valid license number anymore we may need to purchase a new one.

It is also a good idea to set up TimeMachine on your computer to backup everything to the Data 1 server. If you have Parallels already installed, go to TimeMachine > Options and exclude that folder from the backup.

Installing software

Installing Psychtoolbox and GStreamer

How to setup Matlab2013b and GStreamer on Yosemite

Psychtoolbox is not compatible with Matlab 2014a and higher, so you need Matlab2013b. But Matlab 2013b needs a patch to run on Yosemite.

  1. To install Matlab 2013b patch:
    1. If you do not already have Matlab2013b installed, then install it from Mathworks.
    2. Go to the Beauchamplab server>SoftwareISOs>MatlabR2013b_patch.dmg>R2013b_patch_1098655.dmg

In order to make the videos run on Psychtoolbox, you need gStreamer.

  1. To install gStreamer:
    1. Open bash shell in Terminal (check terminal> preferences>shells open with>default login shell >/bin/bash).
    2. Copy paste into terminal: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    3. Follow the steps.
    4. After homebrew is installed, copy paste into terminal: brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav
    5. Open Matlab2013b and you are all set to run your experiment!


Installing Psychtoolbox with Matlab

These instructions can be used to install Psychtoolbox 3.0 with Matlab (64-bit versions). You will need to have administrator privileges, as well as access to ms-nbafmri.

  1. Copy DownloadPsychtoolbox.m from the SoftwareISOs folder to the desktop.
  2. Ensure that you have write access for the pathdef.m file.
    1. Open a finder window and click on Applications
    2. Right-click on Matlab -->Get Info. At the very bottom, under Custom Access, make sure you have Read & Write access. If you do not, click the picture of the lock (bottom right corner), enter your password, and then change to the correct privilege. Click on the lock again to save your changes.
    3. Right-click on Matlab --> Show Package Contents. Right-click on toolbox --> Get Info. Make sure you have Read & Write Access.
    4. Open the toolbox folder. Right-click on local --> Get Info. Make sure you have Read & Write Access.
    5. Right-click on pathdef.m. Make sure you have Read & Write Access.
  3. Open Matlab, cd to the desktop, and execute the Download script.
  4. Accept all certificate requests and choose defaults during installation
  5. For running Psychtoolbox codes in the new version of Matlab (2013a and over), always use the full path to direct the code to the stimulus directory.

Installing GStreamer

In order to run Psychtoolbox with 64-bit Matlab, you will need to install GStreamer. Not all versions of GStreamer are compatible! Make sure to use the one that's on the server (and make sure you don't update this file!)

  1. Double-click on gstreamer-sdk-2013.6-universal.pkg in the SoftwareISOs folder.
  2. Proceed through the installation until you get to Installation Type (where it asks for your installation location). Click on Customize (at the bottom of the window) and click on any boxes that aren't checked. Finish the installation.
  3. To ensure that Psychtoolbox is installed correctly, you can test a demo by opening Matlab and typing LoadMovieIntoTexturesDemo .

Installing Octave and Psychtoolbox

These instructions were tested under Mac OSX 10.7.4 with Octave 3.2.6 and Psychtoolbox (PTB) 3.0. They should be completed AFTER the initial UNIX installation steps, including installing XCode tools, including command line tools; this installs "svn" which is needed. The instructions require access to ms-nbafmri, so make sure you are connected to the network via ethernet, UTHSC wifi, or have an open VPN connection

  1. Install Octave-3.2.3-i386.dmg from ms-nbafmri/data/SoftwareISOs (i.e., double-click the dmg file)
    1. Optional: In the Extras/ directory of the Octave dmg there is Gnuplot, which is necessary if you want to make quick plots with Octave
  2. Copy DownloadPsychtoolbox.m from ms-nbafmri/data/SoftwareISOs to the desktop
  3. Open Octave (default install is /Applications/Octave), cd to the desktop, and execute the Download script
 octave-3.2.3:1> cd Desktop/
 octave-3.2.3:2> DownloadPsychtoolbox
  1. Accept all certificate requests and choose defaults during installation
  2. Ensure PTB is installed correctly by testing a demo:
 octave-3.2.3:3> LoadMovieIntoTexturesDemoOSX

If you get an error at this step, it may be because PTB doesn't like your dual monitor configuration. Exit Octave, Change Display Mode to "Mirrored", then Open Octave and run the demo again

Happy PTB'ing!!

† If you try to plot from Octave ( plot( 1:10) ) and get an error about DYLD_LIBRARY_PATH, then we need to make one more edit for plotting to work:

 sudo open -e /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot

Find the line: DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}" and replace it with DYLD_LIBRARY_PATH="${ROOT}/lib" Save the file then relaunch Octave and try to plot again

  octave-3.2.3:1> sombrero()

Installing Matlab

If you want to use Psychtoolbox with Matlab (and who wouldn't?) a 32-bit version is needed; R2010a was the last 32-bit release. R2010 a located in the SoftwareISOs folder on the server. Follow the instructions in the UT_License.rtf file. for Intel 32-bit OSX will do the trick) as well.

see Ismael for Instructions

Presentation

How to get

Download from NeuroBehavioral Systems website (http://www.neurobs.com/) Trial license is free and good for 30 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 order and invoice number, as well as the name and contact of your academic advisor. You will need to make an account first to be able to order. After you have successfully purchased the license, you must sign in under the lab ID to retrieve the access code.

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. If you get an error when trying to play audio stimuli (something like "Device Is In Use") there is probably a strange interaction with Parallels. This can be fixed in Parallels 7 by Virtual Machine/Configure/Sharing select all sharing options (Share Profile and SmartMount)


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;

Configuring Presentation to use USB for output

Attaching USB to the computer The computer first needs the NI-DAQmx software installed - download NI USB-6501 (http://zone.ni.com/devzone/cda/tut/p/id/6913). Before you install anything, make sure you have .NET Framework 2.0 installed (available at: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en). Under the installer features menu, the bare minimum is:

NI-DAQmx 8.8.0
 ->.NET Framework 3.5 Lanugages
 ->.NET Framework 2.0 Lanugages
 ->.NET Framework 1.1 Lanugages
 ->ANSI C Support

You will have to restart after you install the software.

After the restart, connecting the device via USB, Windows will detect a "New Data Acquisition Device", and present you with a window offering several options. Select "Configure and Test This Device Using NI Measurement & Automation Explorer" and run a Self-Test when the window opens. If this passes, the USB device can now be used to control TMS through Presentation.

Configuring Presentation to use USB

Now we need to make a few adjustments to the settings. Under the 'Settings' tab, select the 'Port' option and find the 'Output Ports' box. In this box we need to have a total of 2 ports.

Add the first port, and make sure the following options are set:

Port: USB-6501
Data source: port0
Register span: 1
Inversion mask: 0
Default pulse width: 5 ms

For the second port, the following options need to be set:

Port: USB-6501
Data source: port1
Register span: 1
Inversion mask: 255
Default pulse width: 5 ms

Using Presentation via USB The USB controller uses a new library File:Beauchamp USB TMS library.pcl to control the TMS machine. A sample presentation you can use to test to the USB control of the TMS is available: File:Beauchamp OhmanTMSScenario.sce. In this scenario, the up/down arrows are used to control the intensity of the TMS, while the space bar is used to toggle arming/disarming the device, and the return key is used to fire the device. The sample presentation can also be used to help write code in the future - perhaps the most important point is that it is no longer necessary to define an output port inside the pcl, including the Beauchamp_USB_TMS_library.pcl is sufficient.

Using and recording sound responses

Sound response buttons can be defined in Presentation using Settings-->Response-->Devices-->sound device (threshold or offset)

Once you chose "sound device" click on "properties" button to the left of "Devices" window and adjust the parameters. You need to choose the correct microphone from the pull down menu, set the threshold, ...

To record a sound response, check the "save responses" button and set the recording duration. Each response will be saved in a separate wave file. You can also check the button to save all responses in one wave file (in addition to the individual wave files).

Another way to record sounds is using:

sound_recording{
duration = 1000;
base_filename = "some_file_name";
};

within a trial.

Parallels and Presentation

Presentation runs only under Windows, but can be run on a Mac using BootCamp OR virtualization software such as VMWare or Parallels. Here are some benchmarks for a 2010 MacBook Pro with a 2.66 GHz Intel Core i7 and 4 GB RAM:

To assess performance under Windows 7, go to Control Panel/Performance Information and Tools.


Scores are on a scale from 1.0 to 7.9

 calculations per second     memory access    Windows graphics    3D graphics for games   hard drive

Windows 7 (boot camp) 6.8 5.5 6.4 6.4 5.9

windows 7 (parallels) (1 CPU, 1GB RAM) 4.9 4.5 5.9 4.8 6.2

windows 7 (parallels) (2 CPU, 2GB RAM) 4.9 5.5 5.9 4.8 6.2

To summarize, biggest hit is calculations per second and graphics.

Running Windows on a Mac

Get Ismael to help you

Connecting to the Lab Mac Server

The name of the Mac Mini server is ms-nbafmri (purchased 2012). To connect, type Apple-K, then the server IP address. The username is beauchamplab; ask MSB for the password. There are three share points:

  1. Backups Used for Time Machine Backups
  2. beauchamplab not used
  3. Data Where all lab data and stuff is stored.

Connect to all three (select all and click "OK"). Open a finder window and double click on "data", or open a Terminal window and type

 cd /Volumes/data

Backing Up

Because hard disks fail, it is important to back up your files regularly. The best way to do this is to keep all important work on DropBox. Then there is one copy in the cloud and one your local machine. It is also good to back up files on your Mac automatically, using Time Machine. Connect the Lab Mac Server (previous step) and make sure the Backups folder is mounted. Open System Preferences/Time Machine/Select Disk/Select "Backups" Ask MSB to type in the admin password. It will not work with the beauchamplab password. You can exclude some directories from being backed up to save time and space. It is good to exclude the DropBox folder because this is already backed up by Dropbox. If you have Parallels installed on your computer, you can tell Parallels (under the Preferences menu) not to back up the Parallels VM. This will save time because there is no real reason to back up Windows (can be easily reinstalled).

Configuring a New Mac Server

The lab's data is stored on three Promise Pegasus RAID systems attached to the Mac mini.

  1. January 2013: 12 TB (10 TB available with RAID5)
  2. June 2013: 18 TB (15 TB available with RAID5)
  3. May 2014: 32 TB

When installing a new RAID:

  1. Inform all users the machine will be down for a while
  2. Install all updates to the OSX
  3. Disconnect all RAIDs, then connect them one at a time and perform firmware updates
  4. Connect the new RAID

TimeMachine is used to back up on Pegasus RAID to the other. (This does not protect against failures of the Mac Mini but a new Mini is available quickly). Individual Macs may also be backed up to the RAID. Go to OSX Server and turn on the Time Machine service, adding a share point. This share point can only be accessed with the admin password, assuming it is created with the admin password.


OsiriX

OsiriX is a DICOM viewer that may be helpful if you need to upload DICOMs, especially from a CT scan taken after electrode surgery with epilepsy patients. It can be downloaded from here:

  http://www.osirix-viewer.com/


R

This program is used for the structural equation modeling. If you plan on doing functional connectivity as part of your data analysis, this is a good program to have. You can download it here:

  http://cran.r-project.org/bin/macosx/

To utilize 1dSEM, click the R icon on the console, then locate the 1dSEM.R script in the AFNI folder and load it.

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


Printing

Printing Double Sided

On a new computer you may notice that the option to print two-sided is greyed out. To fix this, go to System Preferences, Print & Scan, select the printer, then press the Options & Supplies button. Under the Driver tab, click Duplex Printing Unit.

Dell 5100cn Color Laser Printer

Here is a copy of the manual http://openwetware.org/images/8/83/Dell_5100cn.pdf

To use the printer, download the current drivers for your computer from the Dell website

 http://support.dell.com/support/downloads

Shortcut: drivers are on the server in

 /data/SoftwareISOs/MiscSoftware/Dell_5100_cn

On Windows XP, you must first add a port, then configure the printer. On Mac OSX, first run the Installer. Then open System Preferences/Print & Fax Click the "+" button to add a printer, click on "IP" and enter the IP address (above.)

    • Protocol must be Line Printer Daemon -- LPD


There are sometimes several drivers to choose from. The PS (postscript) driver under Windows cannot collate. The PCL driver does. So if you need to collate, use the PCL driver.

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.

HP Photosmart Color Inkjet Printer

Insert the installation CD into your computer and follow the instructions. The Mac installation software is in /Volumes/data9/Software_isos/HPPrinter/HP Installer The status of the printer can be checked at

 http://hpfd76cd.local./index.htm?cat=info&page=printerInfo

Mounting Volumes

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@ipaddress/data9 data9
enter password 

and now you can cd into data9

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

Misc Unix Notes

Loops in tcsh are a handy way to automate data processing. Here is an un-commented example. The syntax varies from shell to shell.

set sdall = ( X Y Z P O R T Y)
set idx = 1
foreach ec (FL FM FN FQ FS FU FW FY FZ)
set sd = $sdall[$idx]
@ idx++
echo $idx
end

Here is a while loop for tcsh

 set idx = 1
 while ($idx < 10)
 @ idx++
 echo $idx
 end