# NMT - NIMH Macaque Template For any issues or questions, contact Jakob Seidlitz at jakob.seidlitz@nih.gov or jms290@cam.ac.uk or Adam Messinger at Adam.Messinger@nih.gov. For AFNI implementation questions, please contact glend @ mail.nih.gov ## Description The NMT is an anatomical structural MRI template of the macaque brain. It was created using the freely available software package [ANTs](http://stnava.github.io/ANTs/). The NMT is technically the nonlinear diffeomorphic average of 31 adult rhesus macaque brains, generated by iterativley registering and averageing each individual subject to a common space. For more information on the template creation process, see [our paper](http://biorxiv.org/content/early/2017/02/03/105874). This README file provides an overview of the NMT MRI volume and its associated volume and surface files. Sample commands for visualizing the surfaces are listed as well, using [SUMA](https://afni.nimh.nih.gov/afni/suma) from the [AFNI](https://afni.nimh.nih.gov) software suite. ## Citation If you use this repository, please cite the paper below: Seidlitz, J., Sponheim, C., Glen, D., Ye, F.Q., Saleem, K.S., Leopold, D.A., Ungerleider, L., Messinger, A. A population MRI brain template and analysis tools for the macaque. NeuroImage, April 2017. https://doi.org/10.1016/j.neuroimage.2017.04.063 ## Download To download from the terminal, navigate to the directory where you want to store the NMT repository. Then, copy and paste this command: ```bash git clone http://github.com/jms290/NMT.git ``` Otherwise, on the [NMT repository homepage](https://github.com/jms290/NMT), click the green button "clone or download"... To download the Full-head version of the NMT, which includes more peripheral tissue, download from the following google drive link: https://drive.google.com/open?id=0B07w_FBo9wpIbjlFeEFORnhwaWc To download a skull-stripped version of the NMT instead of multiplying the supplied NMT template by the included brain mask, follow this google drive link: https://drive.google.com/open?id=0B07w_FBo9wpIV3I4M08wa2paUTg ## NMT Files All volume and surface files are stored in the relatively universal nifti (.nii.gz) and gifti (.gii) formats, to be compatible with a plethora of software packages. - NMT volume (with skull) - **NMT.nii.gz** - NMT brain mask - **NMT_brainmask.nii.gz** - NMT probabilisitic tissue segmentation masks + Gray matter - **NMT_segmentation_GM.nii.gz** + White matter - **NMT_segmentation_WM.nii.gz** + Cerebral spinal fluid - **NMT_segmentation_CSF.nii.gz** - NMT cortical gray matter mask - **NMT_GM_cortical_mask.nii.gz** - NMT 4-tissue segmentation mask (including arterial blood vasculature) - **NMT_segmentation_4class.nii.gz** - NMT arterial blood vasculature - **NMT_blood_vasculature_mask.nii.gz** - NMT cerebellum - **NMT_cerebellum_mask.nii.gz** - NMT olfactory bulb - **NMT_olfactory_bulb_mask.nii.gz** - NMT surfaces + Gray matter surface - **[lh or rh].GM.gii** + White matter surface - **[lh or rh].WM.gii** + Mid-cortical surface - **[lh or rh].mid.gii** - NMT surfaces (inflated) + Gray matter surface - **[lh or rh].GM_inflated.gii** + White matter surface - **[lh or rh].WM_inflated.gii** + Mid-cortical surface - **[lh or rh].mid_inflated.gii** - NMT surfaces (other) + Arterial blood vasculature - **blood_vasculature.gii** + Cerebellum surface - **cerebellum.gii** There is also a .spec file - **NMT_both.spec**, which is a text file used by SUMA to load in each of the left and right hemisphere surfaces above. ## Transformations from the NMT to the F99 and D99 templates We include the rigid, affine, and diffeomorphic (nonlinear) tranformations to the NMT from both the F99 and D99 templates. However, due to the size of the nonlinear transformation files, we are hosting them on Dropbox. They can be downloaded from [here]( https://drive.google.com/open?id=0B07w_FBo9wpIWU5Uc3k2SWFHYWs). The D99 template and atlas can be downloaded from [here](https://afni.nimh.nih.gov/pub/dist/atlases/macaque/macaqueatlas_1.2a/). An example command to align the D99 atlas to the NMT (using AFNI's 3dNwarpApply command) is provided below: ```bash 3dNwarpApply -nwarp 'D99_template_shft.1D D99_template_shft_al2std_mat.aff12.1D D99_template_shft_WARP.nii.gz' -source D99_atlas_1.2a.nii.gz -prefix D99_atlas_1.2a_al2NMT.nii.gz -ainterp NN -short ``` To go from the NMT to the D99 simply reverse the order of the transformations and add the INV() to each transformation file: ```bash 3dNwarpApply -nwarp 'INV(D99_template_shft_WARP.nii.gz) INV(D99_template_shft_al2std_mat.aff12.1D) INV(D99_template_shft.1D)' -source D99_atlas_1.2a_al2NMT.nii.gz -prefix D99_atlas_1.2a.nii.gz -ainterp NN -short ``` ## Visualization in AFNI/SUMA Navigate to the directory where you have stored the NMT repository. Then follow these steps: ```bash afni -niml & ``` This will start AFNI and tell AFNI that a connection with SUMA is imminent. Load in NMT.nii.gz as the underlay if it is not loaded automatically. Then, back in the terminal, run: ```bash suma -spec ./NMT_both.spec -sv ./NMT.nii.gz & ``` This should start SUMA, and you should see the left and right WM surfaces. To switch to a different set of surfaces, move your cursor into the SUMA window and toggle the "." key. For other navigational shortcuts and tools, see the [SUMA documentation](https://afni.nimh.nih.gov/sscc/staff/ziad/SUMA/SUMA_do1.htm). Toggle the "t" key to open the connection between AFNI and SUMA. You should see various outlines on the NMT volume in AFNI that correspond with the surfaces loaded into SUMA. To edit or remove the outlines in AFNI, toggle the "Control Surface" button in the AFNI GUI. Now that AFNI and SUMA are linked, this will allow you to vizualze any data (i.e. overlay) from the NMT volume on the surface. Note that only the voxels which intersect the surface outlines will be plotted on the surface. As such, we suggest using the "mid" surface for the visualization of any functional MRI data. For more information about using AFNI interactively, see this [slide show](https://afni.nimh.nih.gov/pub/dist/edu/latest/afni_handouts/afni03_interactive.pdf). ## Single-Subject Processing Along with the NMT dataset, we provide scripts to automated the processing of single subjects. The **NMT_subject_align script** generates the rigid (6 parameter), affine (12 parameter), and nonlinear (voxelwise) transformations to and from the NMT. The **NMT_subject_process** and **NMT_subject_morph** scripts depend on these transformations. **NMT_subject_process** performs N4 bias field correction for normalizing intensity non-uniformities, and generates a brain mask (for skull-stripping) as well as probabilistic tissue segmentation masks (GM, WM, CSF). **NMT_subject_morph** uses the NMT's cortical GM mask to produce volumetric maps of cortical thickness, surface area, and mean and gaussian (i.e., intrinsic) curvature. See the [paper](http://biorxiv.org/content/early/2017/02/03/105874) as well as the table in the [supplemental material](http://biorxiv.org/content/biorxiv/suppl/2017/02/03/105874.DC1/105874-1.pdf) for more information. Below is the usage for each script. Keep in mind these two important things: ***-These scripts require AFNI and [ANTs](http://stnava.github.io/ANTs/) to be installed*** ***-NOTE: NMT_subject_align only requires the AFNI software package to run correctly*** ***-Only a reconstructed T1-weighted scan/volume is needed (either AFNI .BRIK/.HEAD or Nifti .nii or .nii.gz format)*** ### NMT_subject_align ```tcsh tcsh NMT_subject_align.csh [subject] ../NMT.nii.gz ``` Create a directory where the NMT distribution is stored, and copy the scans of the individual subjects into this new directory. Copy or move this script to the new directory and run this script using a single scan as input, along with the NMT in the parent directory. If the brain has already been masked out from your subject (i.e., skull-stripped), generate a skull-stripped version of the NMT using the NMT's brain mask and use this as input to NMT_subject_align, as below. From the newly created directory: ```tcsh 3dcalc -a ../NMT.nii.gz -b ../NMT_brainmask.nii.gz -expr 'a*b' -prefix ../NMT_SS.nii.gz tcsh NMT_subject_align.csh [subject_without_skull] ../NMT_SS.nii.gz ``` ### NMT_subject_process ```bash bash NMT_subject_process [subject] ``` Run this script from the directory where the NMT_subject_align output lies. This script will create a directory NMT_[subject]_process with the corresponding masks in the subject's anatomical space. ### NMT_subject_morph ```bash bash NMT_subject_morph [subject] ``` Run this script from the directory where the NMT_subject_align output lies. This script will create a directory NMT_[subject]_morph with the corresponding masks in the subject's anatomical space.