Beauchamp:CreateCortSurfMod

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(New page: == Automation == All of the steps below are contained in the scripts file /Volumes/data9/surface/scripts/@recon To run this command type, /Volumes/data9/surfaces/scripts/@recon ec subj...)
Current revision (09:52, 6 March 2013) (view source)
(Creating the surface)
 
(15 intermediate revisions not shown.)
Line 1: Line 1:
-
== Automation ==
+
==Creating the surface==
 +
To create the surface, run the script
 +
  /Volumes/data/scripts/@recon
 +
This script should be run in the home directory of the experiment, e.g.
 +
  cd /Volumes/data/UT/DB
 +
  /Volumes/data/scripts/@recon
-
All of the steps below are contained in the scripts file
+
FreeSurfer will take about 6 - 8 hours to complete. It is usually best to run the process overnight, because it uses a great deal of system resources (2 cores and several GB of RAM).
-
/Volumes/data9/surface/scripts/@recon
+
-
To run this command type,
+
After @recon completes, run the @finish script, described on the following page:
-
  /Volumes/data9/surfaces/scripts/@recon ec subjname
+
[[Beauchamp:UseCortSurfMod|Final touches and using Cortical Surface Models]]
-
Where ec is the two-letter experiment code and subjname is the subject's name in the format lastname_firstname.
+
-
The scripts assumes that all of the steps performed the script file @prep_dir have been performed (see Preparation for Creating Cortical Surface Models page)
+
-
e.g.
+
-
  /Volumes/data9/surfaces/scripts/@recon BD doe_jane
+
 +
@recon assumes that all of the steps performed by the script file @prep_dir have been performed, see
 +
[[Beauchamp:PrepCortSurfModels|Preparation for Creating Cortical Surface Models]]
 +
 +
== Automation ==
 +
Most of the steps below are contained in the scripts file; information about them is included here for educational purposes.
 +
For the old web page describing an earlier incarnation of @recon, please see
 +
[[Beauchamp:CreateCortSurfModOLD|OLD version of Creating Cortical Surface Models]]
== Running FreeSurfer ==
== Running FreeSurfer ==
Line 40: Line 47:
  /surfaces/@recon-all_sep_hemi –subj subjID
  /surfaces/@recon-all_sep_hemi –subj subjID
-
Be forewarned that use of this script on the iMacs will hamper system performance when the two hemispheres are simultaneously processed.
 
-
== Using FreeSurfer on the MacPro To Speed Up Surface Creation ==
+
== Making a Pial Envelope==
-
 
+
It can also be useful to have a pial "envelope" that holds the whole brain. For instance, electrodes can be mapped to this surface with the guarantee that they will be visible in any surface model and not buried in cortex. The command to make a pial envelope is
-
To remotely login on the Mac Pro use ssh:
+
  set subjid = pasalar_siavash
-
ssh –l username 129.106.236.144
+
  set SUBJECTS_DIR = /Volumes/data9/surfaces/{$subjid}/
-
 
+
  setenv SUBJECTS_DIR /Volumes/data9/surfaces/{$subjid}/
-
To setup your account run the following commands:
+
  set ec = SP
-
 
+
  recon-all -s $ec -localGI
-
chsh –s /bin/tcsh
+
-
echo 'set path = ( $path  /sw/bin /Applications/afni/afni_src/macosx_10.4_Intel)' >> ~/.cshrc
+
-
echo ‘setenv FREESURFER_HOME /Applications/freesurfer‘ >> ~/.cshrc
+
-
echo ‘source $FREESURFER_HOME/SetUpFreeSurfer.csh' >> ~/.cshrc
+
-
echo ‘mkdir ~/mount/data9‘ >> ~/.cshrc
+
-
echo ‘mount_afp -i afp://username@129.106.236.180/data9 ~/mount/data9‘ >> ~/.cshrc
+
-
 
+
-
Using the MacPro causes some permissions issues. The easiest way to fix this is to run as a super user each time you login:
+
-
sudo -s
+
-
Remember to change the default shell for the super user:
+
-
chsh –s /bin/tcsh
+
-
Now you should be able to edit any file like you would do from the iMac.
+
-
To enable window forwarding so that you can open GUIs like afni remotely you’ll need to take the following steps:
+
-
 
+
-
* Find your IP address using ifconfig. The address will be listed under the device en0, next to inet. For example in the following output the IP address is 129.106.326.192:
+
-
 
+
-
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+
-
        inet6 fe80::216:cbff:fe84:414a%en0 prefixlen 64 scopeid 0x4
+
-
        inet 129.106.236.192 netmask 0xffffff00 broadcast 129.106.236.255
+
-
        ether 00:16:cb:84:41:4a
+
-
        media: autoselect (1000baseT <full-duplex,flow-control>) status: active
+
-
 
+
-
* Allow your computer to accept window forwarding from the PowerMac:
+
-
 
+
-
xhost +129.106.236.16
+
-
 
+
-
 
+
-
* From the window that is logged onto the PowerMac set the display IP address:
+
-
 
+
-
set DISPLAY = 129.106.236.192:0.0
+
-
 
+
-
To exit enter exit twice (once to exit from being a super user and another time to exit from the remote login.
+
 +
This command requires that Matlab be in your path; you will receive an error if it is not.
 +
You may also not be able to run multiple copies of Matlab at once, so you should quit all open Matlabs before executing.
 +
This command also computes a local gyrification index, which may be decreased in diseases or disorders and could be interesting to look at.
== Sample Subjects To Look At==
== Sample Subjects To Look At==
Line 87: Line 64:
Condensed Notes
Condensed Notes
-
/surfaces/autism/ASD/EB_010806/EB_010806notes.rtf
+
/Volumes/data9/surfaces/autism/ASD/EB_010806/EB_010806notes.rtf
When errors were encountered during autorecon-all
When errors were encountered during autorecon-all
-
/surfaces/autism/ASD/DB_073006/DB_073006notes.rtf
+
 
 +
/Volumes/data9/surfaces/autism/ASD/DB_073006/DB_073006notes.rtf
Pretty complete Notes
Pretty complete Notes
-
/surfaces/hicks_kali/BVnotes.rtf
+
 
 +
/Volumes/data9/surfaces/hicks_kali/BVnotes.rtf
covers merging in afni, running recon-all, creating SS500, creating sulc.asc files, aligning to experimental data
covers merging in afni, running recon-all, creating SS500, creating sulc.asc files, aligning to experimental data

Current revision

Contents

Creating the surface

To create the surface, run the script

 /Volumes/data/scripts/@recon 

This script should be run in the home directory of the experiment, e.g.

 cd /Volumes/data/UT/DB
 /Volumes/data/scripts/@recon 

FreeSurfer will take about 6 - 8 hours to complete. It is usually best to run the process overnight, because it uses a great deal of system resources (2 cores and several GB of RAM).

After @recon completes, run the @finish script, described on the following page: Final touches and using Cortical Surface Models

@recon assumes that all of the steps performed by the script file @prep_dir have been performed, see Preparation for Creating Cortical Surface Models

Automation

Most of the steps below are contained in the scripts file; information about them is included here for educational purposes. For the old web page describing an earlier incarnation of @recon, please see OLD version of Creating Cortical Surface Models

Running FreeSurfer

The cortical surface reconstruction program recon-all has many options for processing the files, which are listed on the wiki: https://surfer.nmr.mgh.harvard.edu/fswiki/recon_2dall The easiest option is to run the entire file stream with the following command:

recon-all –all –s subjID

Often this will result in errors because FreeSurfer has permissions issues when copying and appending files. Processor usage can be checked using the program top in another window. If recon-all has been running one subprogram for an inordinate amount of time you can kill it using ctrl-c from the window where you are running recon-all. Reset the permissions so everyone can read and write files from the subject’s directory:

sudo chmod –R 777 $SUBJECTS_DIR/subjID

After resetting the permissions you should check where the program crashed by viewing recon-all-status.log in the subject’s scripts folder. Check the FreeSurfer wiki on how to restart the file stream from where the program crashed. For example, if the program during CA Normalize the program can be restarted using the following line:

recon-all –nogcareg –autorecon2 –autorecon3 –s subjID

Since the all the Macs in the lab are multiprocessor machines, the program can delegate each hemisphere to a single processor. To do this recon-all first needs to preprocess the anatomical data and then identify the white matter:

recon-all -autorecon1 -s subjID
recon-all -autorecon2 -s subjID -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nofinalsurfs -nosmooth2 -noinflate2 –nocortribbon

After the white matter has been defined, recon-all can process the two hemispheres separately using separate log and status files:

recon-all -s subjID -hemi lh -log $SUBJECTS_DIR/subjID/scripts/recon-all_lh.log -status $SUBJECTS_DIR/subjID/scripts/recon-all-status_lh.log -tessellate -smooth1 -inflate1 -qsphere -fix -finalsurfs -smooth2 -inflate2 -cortribbon -autorecon3 &; recon-all -s subjID -hemi rh -log $SUBJECTS_DIR/subjID/scripts/recon-all_rh.log -status $SUBJECTS_DIR/subjID/scripts/recon-all-status_rh.log -tessellate -smooth1 -inflate1 -qsphere -fix -finalsurfs -smooth2 -inflate2 -cortribbon -autorecon3

Alternatively you can use the script in the surfaces folder, which runs recon-all in the manner described above:

/surfaces/@recon-all_sep_hemi –subj subjID


Making a Pial Envelope

It can also be useful to have a pial "envelope" that holds the whole brain. For instance, electrodes can be mapped to this surface with the guarantee that they will be visible in any surface model and not buried in cortex. The command to make a pial envelope is

 set subjid = pasalar_siavash
 set SUBJECTS_DIR = /Volumes/data9/surfaces/{$subjid}/
 setenv SUBJECTS_DIR /Volumes/data9/surfaces/{$subjid}/
 set ec = SP
 recon-all -s $ec -localGI

This command requires that Matlab be in your path; you will receive an error if it is not. You may also not be able to run multiple copies of Matlab at once, so you should quit all open Matlabs before executing. This command also computes a local gyrification index, which may be decreased in diseases or disorders and could be interesting to look at.

Sample Subjects To Look At

Condensed Notes

/Volumes/data9/surfaces/autism/ASD/EB_010806/EB_010806notes.rtf


When errors were encountered during autorecon-all


/Volumes/data9/surfaces/autism/ASD/DB_073006/DB_073006notes.rtf


Pretty complete Notes


/Volumes/data9/surfaces/hicks_kali/BVnotes.rtf

covers merging in afni, running recon-all, creating SS500, creating sulc.asc files, aligning to experimental data

Personal tools