Skip to content

Instantly share code, notes, and snippets.

@AReineberg
Created September 11, 2017 03:29
Show Gist options
  • Save AReineberg/1367345a1aaef56bcc56f05a2d9506a5 to your computer and use it in GitHub Desktop.
Save AReineberg/1367345a1aaef56bcc56f05a2d9506a5 to your computer and use it in GitHub Desktop.
Converts freesurfer asc file to mgh file format.
overlay = MRIread('lh.thickness.fsaverage.mgh');
asc = load('lh_thickness_data.asc');
asc_reshaped = reshape(asc(:,5), overlay.volsize)
overlay.vol = fast_mat2vol(asc_reshaped, overlay.volsize);
MRIwrite(overlay, 'lh_thickness_data.mgh');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment