Quick example of cortical unfolding in LAYNII

In this Blog post, I seek to describe a quick example of how to analyze high-resolution data across layers and columns with LAYNII.

This post is motivated by Shinho Cho. I want to thank Shinho for providing the example data used here. 

There are 5 steps involved to unfold the cortex.

1.) Obtain boder lines of GM/WM and CSF.

This can be done with automatic segmentation algorithms or manually in FSLeyes.

Screenshot 2018-09-26 14.43.25.png
example of how it looks to draw borderlines manually in FSLeyes

2.) Calculating layers with LN_GROW_LAYERS

With this rim.nii file, LAYNII can generate the layers with the command:

LN_GROW_LAYERS -rim rim.nii -vinc 100

The result is a layer file layers.nii looking like this

Screenshot 2018-09-26 14.47.00.png
are calculated based on the rim file above

Note on single slice data (e.g. for Shinho Cho ): when the “-threeD” flag is not set, the program LN_GROW_LAYERS estimates the layers on a slice-by-slice basis. This is done assuming that the slice direction is the third dimension in the nii header according to the default of x-y-z,as phase-read-slice. If your data are not stored like this, consider using the “-threeD” option in LN_GROW_LAYERS. Alternatively, the dimentsion can be exchanged with fslswapdim input x z y  output.

3.) Setting landmarks

For the columnar distance calculation, you can choose a landmark manually anywhere in the layer.nii. E.g generate a new file that is everywhere zero except for one column, where the signal is 1.

Screenshot 2018-09-26 14.47.52.png
Manually set landmark in green. This file is saved as landmarks.nii

4.) Calculating columnar distances

The columnar distances are calculated in the LAYNII program LN_COLUMNAR_DIST

LN_COLUMNAR_DIST -layer_file layers.nii -landmarks landmarks.nii -vinc 400

Screenshot 2018-09-26 14.51.09.png
example of columnar distances from landmark 

5.) Regriding

The layers and distances provide a orthogonal coordinate system that can be used to regrid the data into a 2-dim layer-column matrix.

The output of IMAGIRO is the file “unfoleded*.nii”.

example of unfolding. In the IMAGIRO view the x-axis refers to different columns and the y-axis refers to different layers.