Created
May 16, 2023 14:46
-
-
Save rcassani/a1393a2a995a7f9542ffab08f6bb6a03 to your computer and use it in GitHub Desktop.
Create dummy (empty) FreeSurfer weight (`.w`) file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Write empty FreeSurfer wfile | |
fileFullPath = '~/Desktop/dummy_rh.w'; | |
% Create binary big-endian file | |
fid = fopen(fileFullPath, 'wb', 'b'); | |
% Int16 for Latency | |
fwrite(fid, 0, 'int16'); | |
% Count of vertex-value pairs to follow (3-bytes) | |
fwrite(fid, [0, 0, 0], 'uchar') ; | |
% Close file | |
fclose(fid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Format specification: http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm#WFile
wfile reader: https://github.com/freesurfer/freesurfer/blob/dev/matlab/read_wfile.m
Related Brainstorm forum post: https://neuroimage.usc.edu/forums/t//40241