{"id":598,"date":"2013-06-05T06:13:35","date_gmt":"2013-06-05T14:13:35","guid":{"rendered":"http:\/\/www.kylemathewson.com\/?p=598"},"modified":"2013-06-05T06:13:35","modified_gmt":"2013-06-05T14:13:35","slug":"retinotopy-in-freesurfercnl-protocol","status":"publish","type":"post","link":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/retinotopy-in-freesurfercnl-protocol\/","title":{"rendered":"Retinotopy in Freesurfer\u2013CNL Protocol"},"content":{"rendered":"<p><span style=\"text-decoration: underline;\">CNL ROP &#8211; Retinotopy Workstation Setup \u2013 Windows 7 \u2013 64 \u2013bit<\/span><\/p>\n<p><a href=\"#Summary\">Summary<\/a><br \/>\n<a href=\"#VBOX\">Installing Xubuntu on Virtual Box<\/a><br \/>\n<a href=\"#STRC\">Analyzing the Structural Data with recon-all<\/a><br \/>\n<a href=\"#FUNC\">Analyzing the Functional Data with FSFAST<\/a><br \/>\n<a href=\"#VIEW\">Visualize Results with tksurfer<\/a><\/p>\n<p>A special thanks to <a href=\"http:\/\/psychology.arizona.edu\/pscalf\" target=\"_blank\">Dr. Paige Scalf<\/a> and her student Laura Cacciamani for compiling and creating many of the sections of this document. For more help and references to which I also am indebted see:<\/p>\n<p><a href=\"http:\/\/sampendu.wordpress.com\/retinotopy-tutorial\/\">http:\/\/sampendu.wordpress.com\/retinotopy-tutorial\/<\/a> This also provides a nice psychtoolbox script that can be used to collect retinotopy data. And a script that can be used to analyze preprocessed retinotopy data. This does not however analyze the functional data in terms of preprocessing and coregistration, and we found it easier to do all the steps in FSFAST in freesurfer.<\/p>\n<p><a href=\"http:\/\/www.alivelearn.net\/?p=65\">http:\/\/www.alivelearn.net\/?p=65<\/a> \u2013 Explains cutting the occiput surface, and some of the process, but the steps are outdated for old freesurfer versions<\/p>\n<p><a href=\"https:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/FsFastIndividualRetinotopyAnalysis\">https:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/FsFastIndividualRetinotopyAnalysis<\/a> \u2013 The most authoritative but least ellaborative instruction. I don\u2019t find his automated way of viewing the results as effective as the one shown below based on the SamPenDu tutorial.<\/p>\n<p><a name=\"Summary\"> <\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<BR><br \/>\nSUMMARY \u2013 (More details and links below).<\/p>\n<p>This explains how to setup the environment for Retinotopy analysis for OPA. It explains how to use a windows 7 64-bit pc to install Matlab, SPM 8, and VM Virtual Box.<\/p>\n<p>&#8211;<a href=\"http:\/\/www.fil.ion.ucl.ac.uk\/spm\/software\/spm8\/\" target=\"_blank\">SPM 8<\/a> is used to convert <a href=\"http:\/\/www.mccauslandcenter.sc.edu\/mricro\/dicom\/\" target=\"_blank\">.IMA raw DICOM<\/a> files from the <a href=\"http:\/\/bic.beckman.illinois.edu\/\" target=\"_blank\">BIC<\/a> <a href=\"http:\/\/usa.healthcare.siemens.com\/magnetic-resonance-imaging\/3t-mri-scanner\/magnetom-trio-tim\" target=\"_blank\">Siemens 3T Trio scanner<\/a>.<\/p>\n<p>&#8211;<a href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\">Virtual Box<\/a> is then used to create and install and virtual <a href=\"http:\/\/xubuntu.org\/\" target=\"_blank\">Xubuntu<\/a> environment.<\/p>\n<p>-In Xubuntu, <a href=\"https:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\" target=\"_blank\">freesurfer<\/a> is installed, the <a href=\"http:\/\/neuro.debian.net\/\" target=\"_blank\">neurodebian archive<\/a> is used to install <a href=\"http:\/\/neuro.debian.net\/pkgs\/fsl.html\" target=\"_blank\">FSL,<\/a> and <a href=\"http:\/\/www.mathworks.com\/products\/matlab\/\" target=\"_blank\">matlab<\/a> is <a href=\"http:\/\/webstore.illinois.edu\/home\/\" target=\"_blank\">downloaded<\/a>, mounted, and installed (freesurfer required FSL and matlab for the analysis).<\/p>\n<p>-A <a href=\"http:\/\/www.giannistsakiris.com\/index.php\/2008\/04\/09\/virtualbox-access-windows-host-shared-folders-from-ubuntu-guest\/\" target=\"_blank\">shared folder is setup<\/a> between windows and the virtual Ubuntu environment.<\/p>\n<p>The Retinotopy analysis is then performed on the output of SPM 8 in Xubuntu.<\/p>\n<p>&nbsp;<\/p>\n<p><a name=\"VBOX\"> <\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<BR><br \/>\nXUBUNTU on Virtual Box<\/p>\n<p>1) On the windows 7, 64bit host, install matlab 2012a <a href=\"http:\/\/webstore.illinois.edu\/home\/\">http:\/\/webstore.illinois.edu\/home\/<\/a> and Install SPM 8 <a href=\"http:\/\/www.fil.ion.ucl.ac.uk\/spm\/software\/download.html\">http:\/\/www.fil.ion.ucl.ac.uk\/spm\/software\/download.html<\/a> and set the path to the installed toolbox in matlab<\/p>\n<p>2) Restart Computer &gt; Start BIOS &gt; Intel or AMD &gt; Enable Virtual Hardware (\u2018You will encounter a &#8216;VT-x&#8217; error later when trying to launch the vm if this is not enabled.)<\/p>\n<p>3) Download a copy of Xubuntu 12.10 64-bit from <a href=\"http:\/\/ftp.dei.uc.pt\/pub\/linux\/xubuntu\/releases\/12.10\/release\/\">http:\/\/ftp.dei.uc.pt\/pub\/linux\/xubuntu\/releases\/12.10\/release\/<\/a><\/p>\n<p>4) Either VirtualMount the CD, or burn a copy of the image onto a DVD to install the OS<\/p>\n<p>5) Download VirtualBox 4.2.12 for Windows <a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\">https:\/\/www.virtualbox.org\/wiki\/Downloads<\/a><\/p>\n<p>6) In VirtualBox Click New <a href=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image002.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image002\" alt=\"clip_image002\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image002_thumb.jpg\" width=\"44\" height=\"41\" border=\"0\" \/><\/a><\/p>\n<blockquote><p>a. Name: Ubuntu64, Type: Linux, Version: Ubunut (64 bit)<\/p>\n<p>b. Memory size \u2013 10000 MB \u2013 10GB?<\/p>\n<p>c. Hard drive &gt; Create a virtual hard drive now &gt; Create<\/p>\n<p>d. VDI &gt; Next&gt; Fixed Size &gt; 100 GB &gt; Click folder to browse to HD location (e.g. E:\/VM_disks)&gt; Create<\/p><\/blockquote>\n<p>7) In VirtualBox Click Settings <a href=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image003.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image003\" alt=\"clip_image003\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image003_thumb.png\" width=\"38\" height=\"40\" border=\"0\" \/><\/a><\/p>\n<blockquote><p>a. General Menu &gt; Advanced Tab &gt; Shared Clipboard &gt; Bidirectional<\/p>\n<p>b. System Menu &gt; Motherboard Tab &gt; Extended Features &gt; Check Enable IO API<\/p>\n<p align=\"center\">1. &gt; Processor Tab &gt; Processors &gt; 2, Extended Features &gt; Check Enable PAE\/NX<\/p>\n<p align=\"center\">2. Acceleration Tab &gt; Check Enable VT-x\/AMD-V, Check Enable Nested Paging<\/p>\n<p>c. Display Menu &gt; Video Memory &gt; 24 MB, Uncheck Enable 3D Acceleration and Enable 2D\u2026<\/p>\n<p>d. Shared Folders Menu &gt; Click +Folder to add &gt; Create Folder called \u201cUbunuShare\u201d<\/p><\/blockquote>\n<p>8) In VirtualBox \u2013 Click Start <a href=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image004.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image004\" alt=\"clip_image004\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image004_thumb.png\" width=\"37\" height=\"39\" border=\"0\" \/><\/a><\/p>\n<blockquote><p>a. Select Drive<\/p>\n<p>b. Instal Xubuntu from the disk<\/p><\/blockquote>\n<p>9) Create a shared folder from windows to Ubuntu with these instructions called UbuntuShare<\/p>\n<p><a href=\"http:\/\/www.giannistsakiris.com\/index.php\/2008\/04\/09\/virtualbox-access-windows-host-shared-folders-from-ubuntu-guest\/\">http:\/\/www.giannistsakiris.com\/index.php\/2008\/04\/09\/virtualbox-access-windows-host-shared-folders-from-ubuntu-guest\/<\/a><\/p>\n<p>be sure to create a text file called mount with, the password is at the top of the terminal<\/p>\n<p class=\"MsoListParagraph\" style=\"line-height: 13pt; margin: 0in 0in 10pt 0.5in;\"><span style=\"color: #000000; font-family: 'Courier New'; font-size: small;\">sudo mount -t vboxsf UbuntuShare \/home\/virtualuser\/WinShare<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>10) Back on the Ubuntu Virtual Box \u2013 CTRL F \u2013 fullscreen, if you start the virtual machine again be sure to remount the shared folder in the terminal (the password is at the top)<i><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>11) Download Freesurfer 5.1.0 64-bit &#8211; <a href=\"ftp:\/\/surfer.nmr.mgh.harvard.edu\/pub\/dist\/freesurfer\/5.1.0\/freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0.tar.gz\">ftp:\/\/surfer.nmr.mgh.harvard.edu\/pub\/dist\/freesurfer\/5.1.0\/freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0.tar.gz<\/a><i><\/i><\/p>\n<blockquote><p><i>a. <\/i>Register your copy of Freesurfer here <a href=\"https:\/\/surfer.nmr.mgh.harvard.edu\/registration.html\">https:\/\/surfer.nmr.mgh.harvard.edu\/registration.html<\/a>. Create the .license file from the email contents between the lines.<i><\/i><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>12) Use Neurodebian to install the FSL components you need from here <a href=\"http:\/\/neuro.debian.net\/install_pkg.html?p=fsl\">http:\/\/neuro.debian.net\/install_pkg.html?p=fsl<\/a> (I had to run twice to get FSL 5.0), check on the application menu that it installed<i><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>13) Download matlabR2012b_UNIX.iso from <a href=\"http:\/\/webstore.illinois.edu\/home\/\">http:\/\/webstore.illinois.edu\/home\/<\/a><\/p>\n<blockquote><p>a. Open a terminal and mount the .iso to a new folder and install<\/p>\n<p class=\"MsoListParagraphCxSpFirst\" style=\"line-height: 13pt; text-indent: -0.75in; margin: 0in 0in 0pt 1.25in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">mkdir \/MATLABmedia<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.75in; margin: 0in 0in 0pt 1.25in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">mount -t iso9660 -o loop ~\/downloads\/matlabR2012b_UNIX.iso \/MATLABmedia<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.75in; margin: 0in 0in 0pt 1.25in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">cd \/MATLABmedia<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpLast\" style=\"line-height: 13pt; text-indent: -0.75in; margin: 0in 0in 10pt 1.25in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">.\/install<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<blockquote><p>b. REMEMBER \u2013 you will need to be on CITES VPN on the WINDOWS PC for matlab to work<\/p><\/blockquote>\n<p>14) Edit the bash startup script to initialize everything correctly when you open the terminal:<\/p>\n<blockquote><p>a. In your home folder, show hidden files, open \u201c.bashrc\u201d<\/p>\n<p>b. Add the following lines to the end and save (Where \u201ckarl\u201d is whatever your Ubuntu username is<\/p>\n<p class=\"MsoListParagraphCxSpFirst\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">#Freesurfer setup<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">export FREESURFER_HOME=\/home\/karl\/freesurfer<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">export FSLDIR=\/usr\/share\/fsl\/5.0<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">source $FREESURFER_HOME\/SetUpFreeSurfer.sh<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">\u00a0<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 0pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\"># Mount shared folder<\/span><\/span><\/span><\/p>\n<p class=\"MsoListParagraphCxSpLast\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 10pt 1in; mso-add-space: auto;\"><span style=\"line-height: 12pt;\"><span style=\"font-family: 'Courier New';\"><span style=\"font-size: 10pt; color: #000000;\">sudo mount -t vboxsf UbuntuShare \/home\/karl\/WinShare<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p class=\"MsoListParagraphCxSpLast\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 10pt 1in; mso-add-space: auto;\">\n<p class=\"MsoListParagraphCxSpLast\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 10pt 1in; mso-add-space: auto;\">\n<p class=\"MsoListParagraphCxSpLast\" style=\"line-height: 13pt; text-indent: -0.5in; margin: 0in 0in 10pt 1in; mso-add-space: auto;\">\n<p><a name=\"STRC\"> <\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Now we can finally do the analysis protocol<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">Structural file conversion from scanner output<\/span><\/p>\n<p>15) Run spm &gt; click fMRI &gt; click Batch &gt; Click SPM menu &gt; Util &gt; DICOM Import<\/p>\n<blockquote><p>DICOM FILES \u2013 Select all the slice files from the scanner output MPRAGE folder (e.g. *.IMA)<\/p>\n<p>Output Directory \u2013 Select the shared folder from 2)<\/p>\n<p>Output image format \u2013 select .nii<\/p>\n<p><span style=\"text-decoration: underline;\">Functional file conversion from scanner output <\/span><\/p>\n<p><i>Convert to .nii (do for each retinotopy type)<\/i><\/p><\/blockquote>\n<p>16) &#8211; Run spm &gt; click fMRI &gt; click Batch &gt; Click SPM menu &gt; Util &gt; DICOM Import<\/p>\n<blockquote><p>This is very similar to 4, but now uses the functional scans, and has an extra stem to combine slices over time into a 4D .nii file<\/p>\n<p>DICOM FILES \u2013 Select all the slice files from the scanner output EPI_ folder (e.g. *.IMA)<\/p>\n<p>Output Directory \u2013 ** Select the same EPI_ folder as the slices, there is one more step below<\/p>\n<p>Output image format \u2013 select .nii<\/p>\n<p><i>Convert to 4D (do for each retinotopy type)<\/i><\/p><\/blockquote>\n<p><i>6) <\/i>Run spm &gt; click fMRI &gt; click Batch &gt;Click SPM menu &gt; Util &gt; 3D to 4D file conversion<\/p>\n<blockquote><p>3D volumes \u2013 select all the .nii files in the data directory from 5a)<\/p>\n<p>Output Filename \u2013 f.nii (THIS WILL SAVE IN THE ORIGINAL DATA DIRECTORY AND MUST BE MOVED NEXT)<\/p><\/blockquote>\n<blockquote><p><span style=\"text-decoration: underline;\">In the shared (ubunto-windows) folder, <\/span><\/p><\/blockquote>\n<blockquote><p>-rename the MPRAGE .nii file with the subject ID (e.g. MS_041013.nii)<\/p>\n<p>-create four folders (001, 002, 003, 004) for each retinotopy direction and type (POLARPOS, POLARNEG, ECCENPOS, ECCENNEG).<\/p>\n<p>-Go to the data directories where your scanner output files are, and copy the newly created (5b) f.nii files from each of the respective EPI folders to each of the new folders in the shared folder. Make sure to put the correct files in the correct folder depending on the order of the tasks recorded in the run sheet (e.g polar positive is EPI_Vis_1 and should go in 001, polar negative is 2 and should go in 002, eccentric positive is 3, and eccentric negative is 4.<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>In Xubuntu &gt; Open a terminal<\/p>\n<p>8) Run recon-all on the structural data, use the -i command to import from the shared folder and create a new subject directory structure in the freesurfer subject directory (this will take all day).<\/p>\n<blockquote><p><span style=\"font-family: 'Courier New';\">recon-all -s MS_041013 -i WinShare\/MS_041013.nii -all<\/span><\/p><\/blockquote>\n<p align=\"center\">1. Cut occiput surface<br \/>\nRun command<\/p>\n<blockquote>\n<p align=\"center\"><code>tksurfer MS_041013 lh inflated<\/code><code><\/code><\/p>\n<\/blockquote>\n<p align=\"center\">2. to display the inflated left hemisphere.<br \/>\nRotate the brain until the medial surface is facing you.<br \/>\nThen select points along calcarine fissure and press button \u201cCut line\u201d.<br \/>\n<a href=\"http:\/\/www.alivelearn.net\/wp-content\/uploads\/2008\/11\/occipcut1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image005\" alt=\"clip_image005\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image005.png\" width=\"244\" height=\"169\" border=\"0\" \/><\/a><br \/>\nSelect 3 points to define the cutting plane: 2 on medial side and 1 on lateral side. Choose a 4th point to specify which portion of surface to keep and press button \u201cCut plane\u201d.<br \/>\n<a href=\"http:\/\/www.alivelearn.net\/wp-content\/uploads\/2008\/11\/occipcut2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image006\" alt=\"clip_image006\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image006.png\" width=\"244\" height=\"117\" border=\"0\" \/><\/a><a href=\"http:\/\/www.alivelearn.net\/wp-content\/uploads\/2008\/11\/occipcut3.png\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;\" title=\"clip_image007\" alt=\"clip_image007\" src=\"http:\/\/kylemathewson.korymathewson.name\/wp-content\/uploads\/2013\/06\/clip_image007.png\" width=\"244\" height=\"93\" border=\"0\" \/><\/a><br \/>\nSave (File &gt; Patch &gt; Save As) as file lh.occip.patch.3d.<br \/>\n(To know how to cut full brain, check out <a href=\"http:\/\/afni.nimh.nih.gov\/pub\/dist\/edu\/human_freesurfer\/fs_hands-on\/fs_hands-on.pdf\">this PDF<\/a>)<\/p>\n<p align=\"center\">3. Flatten occiput surface<\/p>\n<blockquote>\n<p align=\"center\">cd to the subject\u2019s \u201csurf\u201d directory and run<\/p>\n<p align=\"center\"><code>mris_flatten -w 0 -distances 20 7 lh.occip.patch.3d\u00a0 lh.occip.patch.flat<\/code><code><\/code><\/p>\n<p align=\"center\">To visualize the patch, you can first load the subject\u2019s inflated surface, then File &gt; Patch &gt; Load Patch \u2026<br \/>\nFlattening takes 1-2 hours.<\/p>\n<\/blockquote>\n<p align=\"center\">4. Repeat step 2 and 3 for the right hemisphere.<\/p>\n<p><a name=\"FUNC\"> <\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">RETINOTOPY ANALYSIS<\/span><\/p>\n<p><b><span style=\"text-decoration: underline;\">Setting up for the analysis:<\/span><\/b><\/p>\n<p>\u00b7 Your directories MUST follow this flow:<\/p>\n<blockquote><p>o Subjects\/SUBJECTID\/FunctionalDir\/RunDir\/Rawfuncdata.nii<\/p>\n<p>o subjects\/MS_041013\/Retinotopy\/001\/f.nii<\/p>\n<p>and<\/p>\n<p>o subjects\/MS_041013\/Retinotopy\/001\/rtopy.par<\/p>\n<p>and<\/p>\n<p>o subjects\/MS_041013\/Retinotopy\/002\/f.nii \u2026<\/p><\/blockquote>\n<p>\u00b7 in freesurfer\/subjects\/SUBJECTID Create a text file called \u201csubjectname\u201d (NO .txt on the end)<\/p>\n<blockquote><p>o In it should contain ONLY your subject\u2019s name (i.e. MS_041013)<\/p>\n<p>o This subject name must match the freesurfer subject name (here SUBJECTID; created when you did the recon-all command), so make sure it\u2019s right<\/p><\/blockquote>\n<p>\u00b7 Folder 001 and 002 are for Polar, 003 and 004 for eccen; In each of the 001, 002, 003, and 004 directories create a .par files (a text file with extension .par)<\/p>\n<blockquote><p>o They should both be called the same thing (i.e. \u201crtopy.par\u201d)<\/p>\n<p>o Should contain the following:<\/p>\n<p>\u00a7 In folder 001:<\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">stimtype polar<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">direction pos<\/span><\/p>\n<p>\u00a7 In folder 002:<\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">stimtype polar<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">direction neg<\/span><\/p>\n<p>\u00a7 In folder 003:<\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">stimtype eccen<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">direction pos<\/span><\/p>\n<p>\u00a7 In folder 004:<\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">stimtype eccen<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">direction neg<\/span><\/p><\/blockquote>\n<p>9)In a new window, open up the shared directory, and copy and paste the four folders into the Subject directory\/Retinotopy folder with the four matching folders, the files will copy into their respective folders. Make sure the functional data matches what is written in the rtopy.par file.<\/p>\n<p>10) You will also have to convert each of these f.nii files to add the TR probably:<\/p>\n<blockquote><p><span style=\"font-family: 'Courier New'; font-size: small;\">cd 001<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">mri_convert f.nii f.nii -tr 2000<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd ..<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd 002<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">mri_convert f.nii f.nii -tr 2000<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd ..<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd 003<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">mri_convert f.nii f.nii -tr 2000<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd ..<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd 004<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">mri_convert f.nii f.nii -tr 2000<\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: small;\">cd ..<\/span><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p><b><span style=\"text-decoration: underline;\">First-level GLM analysis:<\/span><\/b><\/p>\n<p><i>Note: for all of these commands, you must be in the main project directory<\/i><\/p>\n<p>\u00b7 <b>Preprocessing<\/b>:<\/p>\n<blockquote><p>o preproc-sess<\/p>\n<p>\u00a7 -s &lt;subject&gt;<\/p>\n<p>\u00a7 -surface self lhrh<\/p>\n<p>\u00a7 -fsd &lt;FunctionalDirectory&gt;<\/p>\n<p>\u00a7 -mni305<\/p>\n<p>\u00a7 -fwhm &lt;number&gt;<\/p>\n<p>\u00b7 For no smoothing, set to 0<\/p>\n<p>o Example:<\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">preproc-sess -s MS_041013 -surface self lhrh -fsd Retinotopy -mni305 \u2013fwhm 5<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u00b7 <b>Make the design:<\/b><\/p>\n<blockquote><p>o Mkanalysis-sess<\/p>\n<p>\u00a7 -a &lt;analysis directory&gt;<\/p>\n<p>\u00a7 -surface self lh<\/p>\n<p>\u00a7 -TR &lt;TR value, in seconds&gt;<\/p>\n<p>\u00a7 -retinotopy &lt;length of 1 cycle, in seconds&gt;<\/p>\n<p>\u00a7 -paradigm &lt;.par file&gt;<\/p>\n<p>\u00a7 -fsd &lt;FunctionalDirectory&gt;<\/p>\n<p>\u00a7 -fwhm &lt;number&gt;<\/p>\n<p>o Example:<\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">mkanalysis-sess -a Retinotopy.MS_041013.lh -surface self lh -TR 2 -retinotopy 36 -paradigm rtopy.par -fsd Retinotopy -fwhm 5<\/span><\/p>\n<\/blockquote>\n<p>\u00b7 <b>Analyze<\/b>:<\/p>\n<blockquote><p>o selxavg3-sess<\/p>\n<p>\u00a7 -a &lt;analysis directory&gt;<\/p>\n<p>\u00a7 -s &lt;subject directory&gt;<\/p>\n<p>o Example:<\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">selxavg3-sess \u2013a Retinotopy.MS_041013.lh \u2013s MS_041013<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">Compute the field sign?<\/span><\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">fieldsign-sess -a Retinotopy.nils.lh -sphere -s nils<\/span><\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">fieldsign-sess -a Retinotopy.nils.rh -sphere -s nils<\/span><\/p>\n<p><a name=\"VIEW\"> <\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<BR><br \/>\n<b><span style=\"text-decoration: underline;\">To view the data:<\/span><\/b><\/p>\n<p align=\"center\"><span style=\"font-family: 'Courier New'; font-size: small;\">tksurfer &lt;subject&gt; &lt;hemisphere&gt; inflated <\/span><\/p>\n<blockquote><p>\u00b7 OPTIONAL &#8211; Under file &gt; Patch &gt; Load Patch\u2026 &gt; Browse\u2026 &gt; SUBJECTID\/surf\/lh.occip.patch.flat or rh<i><\/i><\/p><\/blockquote>\n<blockquote><p>\u00b7 Ctrl + Right Click Curvature toggle, Load Curvature, Press Ok<i><\/i><\/p><\/blockquote>\n<blockquote><p>\u00b7 Under file &gt; Load overlay<\/p><\/blockquote>\n<p>o Navigate to ProjectDir\/SessionDir\/FuncDir\/func.subject.hemisphere\/[polar\/eccen]<\/p>\n<p>o Load real.nii.gz into overlay 1, close, reopen and and imag.nii.gz into overlay 2 (both no registration necessary)<\/p>\n<blockquote><p>\u00b7 Under view &gt;Overlay Layer &gt; Select real.nii.gz<\/p>\n<p>\u00b7 Under view &gt; Configure\u2026 &gt; Overlay\u2026<\/p><\/blockquote>\n<p>o Under \u201ccolor scale\u201d, select RBG wheel<\/p>\n<p>o Under \u201cdisplay options\u201d, select \u201ccomplex\u201d<\/p>\n<p>o Check \u201cIgnore Zeroes in Histrogram\u201d<\/p>\n<p>o Change thresholding as necessary (I used .25-.8)<\/p>\n<p>o Press Apply<\/p>\n<blockquote><p>\u00b7 FOR POLAR ONLY \u2013 Under view \u00e0 configure \u00e0 Phase encoded data display<\/p><\/blockquote>\n<p>o Change angle cycles to 2<\/p>\n<p>Create Legend:<\/p>\n<p><a href=\"http:\/\/www.fil.ion.ucl.ac.uk\/~sschwarz\/Colour_Wheel.m\">http:\/\/www.fil.ion.ucl.ac.uk\/~sschwarz\/Colour_Wheel.m<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CNL ROP &#8211; Retinotopy Workstation Setup \u2013 Windows 7 \u2013 64 \u2013bit Summary Installing Xubuntu on Virtual Box Analyzing the Structural Data with recon-all Analyzing the Functional Data with FSFAST Visualize Results with tksurfer A special thanks to Dr. Paige Scalf and her student Laura Cacciamani for compiling and creating many of the sections of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/retinotopy-in-freesurfercnl-protocol\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Retinotopy in Freesurfer\u2013CNL Protocol&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-598","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/posts\/598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/comments?post=598"}],"version-history":[{"count":0,"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/posts\/598\/revisions"}],"wp:attachment":[{"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/media?parent=598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/categories?post=598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.psych.ualberta.ca\/kylemathewson\/wp-json\/wp\/v2\/tags?post=598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}