Download CIFTI_read_save/@gifti/private/read_freesurfer_file.m from cindyhfls/fcMRI-VAE: direct link, hf CLI and curl.
- Browser
- Download file 817 Bytes
-
https://huggingface.co/cindyhfls/fcMRI-VAE/resolve/main/CIFTI_read_save/%40gifti/private/read_freesurfer_file.m
- Command line
-
hf download hf://cindyhfls/fcMRI-VAE/CIFTI_read_save/@gifti/private/read_freesurfer_file.m
-
curl -L -o read_freesurfer_file.m https://huggingface.co/cindyhfls/fcMRI-VAE/resolve/main/CIFTI_read_save/%40gifti/private/read_freesurfer_file.m
817 Bytes
| function this = read_freesurfer_file(filename) | |
| % Low level reader of FreeSurfer files (ASCII triangle surface file) | |
| % FORMAT this = read_freesurfer_file(filename) | |
| % filename - FreeSurfer file | |
| % | |
| % See http://wideman-one.com/gw/brain/fs/surfacefileformats.htm | |
| %__________________________________________________________________________ | |
| % Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging | |
| % Guillaume Flandin | |
| % $Id: read_freesurfer_file.m 5322 2013-03-13 15:04:14Z guillaume $ | |
| fid = fopen(filename,'rt'); | |
| if fid == -1, error('Cannot open "%s".',filename); end | |
| fgetl(fid); % #!ascii | |
| N = fscanf(fid,'%d',2); | |
| this.vertices = fscanf(fid,'%f %f %f %d',[4 N(1)])'; | |
| this.faces = fscanf(fid,'%d %d %d %d',[4 N(2)])'; | |
| fclose(fid); | |
| this.vertices = this.vertices(:,1:3); | |
| this.faces = this.faces(:,1:3) + 1; | |