This tutorial assumes familiarity with MatLab. It also assumes that you have your data reconstructed by the CBI-functions and they are saved in the heegerlab directory under your name. It might also be helpful to download and go through all 3 tutorials on the lab-wiki to get to terms with the different programs a little before starting.

1. Install a copy of the mrTools on your PC following the instructions on the wiki. Add your path into ‘startup.m’ under: /e/2.3/p2/ckaul/matlab/startup.m with the line addpath(genpath('/Local/Users/ckaul/matlabspace/mrTools’)) or whatever your path is; If you have already installed freesurfer and this file contains freesurfer-entries, comment them.

2. Analyze your structural(s) with freesurfer all the way to the recon-all stage (see freesurfer cookbook for more info). Then navigate into the subjects folder with Matlab and execute the mrTools function: mlrImportFreeSurfer. This will create a subfolder SurfRelax that contains all files you’ll need for further processing with mrTools

3. Make a NEW directory for your functional data. You will need a few sub-folders in this directory: Anatomy/Inplane, Raw/TSeries, Etc and freesurfer..

4. Sort your files from the surfrelax folder (step 3) into the new folders. The mp-rage.img & .mat is your new base-anatomy (anatomy folder), the rest of the files go into the freesurfer folder

5. Go to the Mac-finder, Go/connect to server. Server Address is afp:tesla.cbi.fas.nyu.edu and afp:tesla.cbi.fas.nyu.edu. Tesla has the CBIUserdata folder which contains the heegerlab folder in which your data should be.

6. Copy the data into your folders. The 24-slice inplane mprage-structural belongs into the Anatomy/Inplane folder and all functional scans into the Raw/TSeries folder. The multislicetfisploc and all other files can go into the Etc folder.

7. In Matlab: navigate to your new folder and start ‘mrAlign’. Load the high resolution volume anatomy as the destination: File menu - Load Destination (volume).

This is a good point at which to assign a Talairach transformation, if you plan to align data across subjects. If you do this before taking any more steps, the Talairach information will be inherited by all subsequent steps, ensuring that the information is correctly encoded in all analyses and maps.

8. Load the inplanes: File menu - Load Source (inplane) and initialize the alignment: Compute Alignment menu - Initialize Alignment from Header. View the transformed inplanes superimposed on the volume. Page through the slices and slice orientations using the “Slice” slider and the “sagittal”, “coronal”, and “axial” radio buttons to view the alignment. Use the “Alpha” slider to adjust the transparency of the superposition. Use the “Overlay” button to toggle the overlay on and off.

9. Play around with the alignment-controls (manually) until you're more-or-less satisfied with the alignment between the two anatomical scans.

10. Set the crop region. Compute Alignment/Set crop region. Select first & last slice and a crop region that contains mostly gray matter.

11. Compute and check the alignment. When you are satisfied click on File/Save alignment to file and select your inplane.

12. Now, proceed to align the functionals to the inplane.

13. Load the inplane anatomy as the destination: File menu - Load Destination. Or, if you still have the inplane loaded as the source from Part I, you can simply do File menu - Reload Source as Destination.

14. Load the first functional as the source: File menu - Load Source. You will be prompted to select either the first frame or the mean over time.

15. Initialize the alignment: Compute Alignment menu - Initialize Alignment from Header. This should already give a pretty good alignment unless the subject moved a lot in between the inplanes and the first functional run. If necessary manually align the scans and compute alignment (however this should be unnneccesary as they were taken in the same scan)

16. Save alignment to ALL functional files. File/save alignment to file – select ALL functional files. You’re now done with mrAlign.

17. Navigate into your subjects folder Run ‘mrInit’ or ‘mrInitRet’. Note down the relevant parameters. I.e. for me those were Coil: nova visual, Seq: CBI 2d EDT 2x2x2.5mm.

18. Make sure you specify 8 Junk-files for each functional run.

19. you can fill out the ‘description’ field for each scan if you know it. I.e. for me that was a protocol consisting of 9 functional runs: run 1, 5 and 9 were HRF-mapper runs and 2-4 and 6-8 were pRF-retinotopic mapping runs.

20. Now start mrLoadRet. You can play around with the views and change the displayed angle.

21. Go to Analysis/MotionCorrection and click on ‘Full Motion Corr’. The option ‘sliceTimeCorrection’ can be unchecked if you want to save time (it takes about 90 minutes per run). Do check the ‘gradIntensityCorrection’ box. Click on ‘Set crop region’ and select a first and last scan that contain all gray matter you’re interested in. Then click on a middle scan and define a bounding-box for motion correction. Play around a few times if unsure. If Motion-correction has started with the wrong settings go to the MatLab-window and hit ‘Ctrl-C’ to stop the process. You might also need to execute ‘dbquit()’ a few times before you get a normal promt again.