Skip to content

Computes n equally spaced offset surfaces between the white and pial surfaces with equal ratios between areas of successive surfaces, which samples the same layers in gyri and sulci.

License

Notifications You must be signed in to change notification settings

davhunt/surface_tools

Repository files navigation

Abcdspec-compliant Run on Brainlife.io

Surface tools

Generate equivolumetric surfaces: creates equivolumetric surfaces based on the ratio of areas of the mesh surfaces, without the trouble of dealing with volumetric operations.

Takes WMC datatype as input and generates n equally spaced equivolumetric surfaces, that can then be viewed in Freesurfer. (i.e. n_surfs = 5 will generate the pial and white matter surfaces as well as 3 equally spaced intermediate surfaces)

The smoothing or "diffusion smoothing" value (fwhm, Full Width at Half Maximum of the Gaussian, in mm, default 0) determines the extent to which the surfaces are smoothed (e.g. sharp jumps in neighboring data points on the surfaces will be smoothed out, generally increasing the signal-to-noise ratio)

equivolumetric Equivolumetric surfaces (red) at 0.25, 0.5 and 0.75 cortical depth on the BigBrain. Euclidean surface (yellow) at mid depth. The euclidean surface samples different layers in gyri and sulci, while equivolumetric surfaces sample the gyri and sulci more consistently.

graph Euclidean vs equivolumetric intensity sampling. The laminar peaks are better aligned using equivolumetric sampling than euclidean sampling.

The code requires FreeSurfer to be installed.

Release notes

This code has so far been tested on:

  • python 2.7 and 3.6, freesurfer v.6 and on linux (Ubuntu 16.04) and macOS (10.12.6)

Authors

Project director

Acknowledgements:

Written by Konrad Wagstyl and Alexander Huth at a Brain Hack, a version is also available in Pyrocortex. Casey Paquola and Richard Bethlehem were involved in piloting these scripts on CIVET and FreeSurfer respectively.

The io_mesh code was copied and adapted from https://github.com/juhuntenburg/laminar_python, another great tool for doing volume-based equivolumetric laminar processing.

The equations for generating equivolumetric surfaces come from Waehnert et al 2014: "Anatomically motivated modeling of cortical laminae" https://doi.org/10.1016/j.neuroimage.2013.03.078

Code is demo-ed here on the BigBrain (Amunts et al., 2013), freely available histological atlas of the human brain https://bigbrain.loris.ca/

Funding Acknowledgment

brainlife.io is publicly funded and for the sustainability of the project it is helpful to Acknowledge the use of the platform. We kindly ask that you acknowledge the funding below in your publications and code reusing this code.

NSF-BCS-1734853 NSF-BCS-1636893 NSF-ACI-1916518 NSF-IIS-1912270 NIH-NIBIB-R01EB029272

Citations

We kindly ask that you cite the following articles when publishing papers and code using this code.

  1. Avesani, P., McPherson, B., Hayashi, S. et al. The open diffusion data derivatives, brain data upcycling via integrated publishing of derivatives and reproducible open cloud services. Sci Data 6, 69 (2019). https://doi.org/10.1038/s41597-019-0073-y

MIT Copyright (c) 2020 brainlife.io The University of Texas at Austin and Indiana University

Running the App

On Brainlife.io

You can submit this App online at https://doi.org/10.25663/brainlife.app.126 via the "Execute" tab.

Running Locally (on your machine)

  1. git clone this repo.
  2. Inside the cloned directory, create config.json with something like the following content with paths to your input files.
{
        "n_surfs": 5,
        "output": "./input/freesurfer/output",
        "smoothing": 5
}

3. Launch the App by executing `main`

```bash
./main

Sample Datasets

If you don't have your own input file, you can download sample datasets from Brainlife.io, or you can use Brainlife CLI.

npm install -g brainlife
bl login
mkdir input
bl dataset download 5a0662225ab38300be518f53 && mv 5a0662225ab38300be518f53 input/freesurfer

Output

All output files will be generated under the current working directory (pwd). The main output of this App is a directory called output_surfaces. This file contains the 2n (rh and lh) generated equivolumetric surfaces (*.pial).

Dependencies

This App only requires singularity to run. If you don't have singularity, you will need to install following dependencies.

About

Computes n equally spaced offset surfaces between the white and pial surfaces with equal ratios between areas of successive surfaces, which samples the same layers in gyri and sulci.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •