Read and Write 'FreeSurfer' Neuroimaging File Formats
Make the region names and indices unique across hemispheres for a parc...
Stop unless surf is an fs.surface
Create new bvsmp instance encoding morph data for Brainvoyager.
Create CDATA element string from string.
Check whether the dtype is suitable for the data.
Warn about common errors in combining data and datatype.
Find vertex index closest to given query coordinate using Euclidean di...
Adjust integer matrix to target min value.
Get max region index of an fs.annot instance.
Extract color lookup table (LUT) from annotation.
Turn coordinate vector into string.
Delete all data in the package cache.
Apply a spatial transformation matrix to the given coordinates.
Download optional data for the freesurferformats package.
Compute Euclidean distance.
Convert quadrangular faces or polygons to triangular ones.
Convert tris faces to quad faces by simple merging.
Get connection to a binary file, gz or not.
Check whether filepath ends with extension.
Write fixed width integers to one or several lines.
Flip a 2D matrix.
Flip a 3D array along an axis.
Read 3-byte integer.
Determine morphometry file extension from format
Determine morphometry file format from filename
Constructor for fs.patch
Get an rgl tmesh3d instance from a brain surface mesh.
Write 3-byte integer.
Determine endianness of TRK file.
Compute MGH orientation string and direction
Access a single file from the package cache by its file name.
Write data to a gifti file.
Get GIFTI XML representation of data.
Add metadata to GIFTI XML tree.
Write XML tree to a gifti file.
Add a label tabel from an annotation to a GIFTI XML tree.
Add a standard label tabel for to a GIFTI XML tree.
Guess whether a file is gzipped.
Check for pandoc availability on system.
Convert 32 bit integer to RGB color as described in Brainvoyager SRF f...
Check whether object is a bvsmp instance.
Check whether object is an fs.annot
Check whether object is an fs.label
Check whether object is an fs.surface
Check whether object is an fs.volume
Check whether object is an mghheader
Split a string into fixed-length parts.
Get file names available in package cache.
Determine whether an MGH volume is conformed.
Compute RAS coords of center voxel.
Compute MGH volume orientation string.
Determine whether an MGH volume is conformed.
Check whether header contains valid ras information
Compute MGH primary slice direction
Compute ras2vox matrix from basic MGH header fields.
Compute ras2vox-tkreg matrix from basic MGH header fields.
Constructor to init MGH header instance.
Compute scanner-RAS 2 tkreg-RAS matrix from basic MGH header fields.
Compute tkreg-RAS to scanner-RAS matrix from basic MGH header fields.
Update mghheader fields from vox2ras matrix.
Compute vox2ras matrix from basic MGH header fields.
Compute vox2ras-tkreg matrix from basic MGH header fields.
Compute vox2vox matrix between two volumes.
Get fsaverage (MNI305) to MNI152 transformation matrix.
Get size of MRI dtype in bytes.
Create NIFTI v1 header suitable for given data.
Create a template NIFTI v1 header. You will have to adapt it for your ...
Create NIFTI v2 header suitable for given data.
Create a template NIFTI v2 header. You will have to adapt it for your ...
Compute data dimensions from the 'dim' field of the NIFTI (v1 or v2) h...
Compute NIFTI dim field for data dimension.
Compute NIFTI v1 data type info from datatype and bitpix header field.
Check whether vector has expected length.
Check whether character string fields have less than or equal to expec...
Determine whether a NIFTI file uses the FreeSurfer hack.
Determine NIFTI file version information and whether file is a NIFTI f...
Perform basic sanity checks on NIFTI header data. These are in no way ...
Compute NIFTI space unit info from xyzt_units header field.
Compute NIFTI time unit info from xyzt_units header field.
Get the name of the transform type from a form code.
Parse a single ASCII STL face.
Parse matrix from text file lines.
Generate PLY format header lines
Turn polygon soup into indexed mesh.
Print description of a brain atlas or annotation.
Print description of a brain surface label.
Print description of a brain surface patch.
Print description of a brain surface.
Print description of a brain volume.
Translate RAS coordinates, as used in volumes by applying vox2ras, to ...
Compute MNI talairach coordinates from RAS coords.
Read DTI tracking data from file in MRtrix 'TCK' format.
Read fiber tracks from Diffusion Toolkit in trk format.
Read DTI tracking per-coord data from file in MRtrix 'TSF' format.
Determine element counts from PLY file header.
Read fixed length char, possibly containing embedded zeroes, from bina...
Read an annotation or label in GIFTI format.
Read file in FreeSurfer annotation format
Read colortable file in FreeSurfer ASCII LUT format.
Read file in FreeSurfer curv format
Read FreeSurfer GCA file.
Read a label from a GIFTI label/annotation file.
Read file in FreeSurfer label format
Read a label file.
Read file in FreeSurfer MGH or MGZ format
Read morphometry data from ASCII curv format file
Read Brainvoyager vertex-wise statistical surface data from SMP file.
Read surface morphometry data from CIFTI dscalar files.
Read morphometry data file in GIFTI format.
Read morphometry data from FreeSurfer NIFTI v1 format files.
Read morphometry data from FreeSurfer NIFTI v2 format files.
Read morphometry data from FreeSurfer NIFTI format files, determine NI...
Read morphometry data file in any FreeSurfer format.
Read morphometry data from plain text file
Read FreeSurfer ASCII format patch.
Read FreeSurfer binary or ASCII patch file.
Read FreeSurfer ASCII format surface.
Read Brainvoyager srf format (.srf) mesh as surface.
Read mesh in BYU format.
Read GEO format mesh as surface.
Read GIFTI format mesh as surface.
Read ICO format mesh as surface.
Read surface mesh in mz3 format, used by Surf-Ice.
Read OBJ format mesh as surface.
Read Object File Format (OFF) mesh as surface.
Read Stanford PLY format mesh as surface.
Read file in FreeSurfer surface format or various mesh formats.
Read surface mesh in STL ASCII format.
Read surface mesh in STL binary format.
Read mesh in STL format, auto-detecting ASCII versus binary format ver...
Read VTK ASCII format mesh as surface.
Load transformation matrix from a tkregister dat file.
Load transformation matrix from a FreeSurfer linear transform array (L...
Load transformation matrix from a file.
Load transformation matrix from an XFM file.
Turn a 3D or 4D oro.nifti
instance into an fs.volume
instance with...
Read volume file in MGH, MGZ or NIFTI format
Read ASCII version of FreeSurfer weight file.
Read file in FreeSurfer weight or w format
Read Brainvoyager srf format (.srf) mesh.
Read raw NIFTI v1 data from file (which may contain the FreeSurfer hac...
Read NIFTI v1 header from file (which may contain the FreeSurfer hack)...
Read NIFTI v1 header from file (which may contain the FreeSurfer hack)...
Read raw data from NIFTI v2 file.
Read NIFTI v2 header from file.
Read NIFTI v2 header from file.
Read Brainvoyager statistical surface results from SMP file.
Read Brainvoyager statistical surface results from v1 or v2 SMP file.
Read Brainvoyager statistical surface results from v3 SMP file.
Read Brainvoyager statistical surface results from v4 or v5 SMP file.
Read a surface, based on the file path without extension.
Read a FreeSurfer ASCII surface file.
Read a FreeSurfer ASCII surface file.
Read a gifti file as a surface.
S3 method to read a neuroimaging surface file.
Find files with the given base name and extensions that exist.
Read binary colortable in v2 format.
Read binary colortable in old format.
Rotate a 2D matrix in 90 degree steps.
Rotate a 3D array in 90 degree steps.
Rotate 2D matrix clockwise in 90 degree steps.
Scan exactly n values from source string.
Adapt spatial transformation matrix for 1-based indices.
Adapt spatial transformation matrix for 0-based indices.
Guess whether a mesh file in STL format is the ASCII or the binary ver...
Translate surface RAS coordinates, as used in surface vertices and sur...
Compute Talairach RAS for surface RAS (e.g., vertex coordinates).
Compute MNI talairach coordinates from RAS coords.
Translate between code and name of MRI data types.
Compute Euclidean distance between two vertices v1 and v2.
Compute Euclidean distance from all mesh vertices to given point.
Write annotation to GIFTI file.
Write annotation to binary file.
Write colortable file in FreeSurfer ASCII LUT format.
Write file in FreeSurfer curv format
Write a binary surface label in GIFTI format.
Write vertex indices to file in FreeSurfer label format
Write file in FreeSurfer MGH or MGZ format
Write file in FreeSurfer ASCII curv format
Write morphometry data in GIFTI format.
Write morphometry data in NIFTI v1 format.
Write morphometry data in NIFTI v2 format.
Write morphometry data in a format derived from the given file name.
Write morphometry data in Brainvoyager SMP format.
Write curv data to file in simple text format
Write a surface patch
Write mesh to file in FreeSurfer ASCII surface format
Write surface to Brainvoyager SRF file.
Write mesh to file in BYU ASCII format.
Write mesh to file in GIFTI surface format
Write mesh to file in mz3 binary format.
Write mesh to file in Wavefront object (.obj) format
Write mesh to file in Object File Format (.off) or PLY2 format.
Write mesh to file in Object File Format (.off)
Write mesh to file in PLY format (.ply)
Write mesh to file in PLY2 File Format (.ply2)
Write mesh to file in FreeSurfer binary surface format
Write mesh to file in VTK ASCII format
Write file in FreeSurfer weight ASCII format
Write file in FreeSurfer weight format
Write header and data to a file in NIFTI v1 format.
Write header and data to a file in NIFTI v2 format.
Write a brainvoyager SMP file.
Write a brainvoyager v2 SMP file.
Write a brainvoyager v3, v4 or v5 SMP file.
Create XML GIFTI CoordinateSystemTransformMatrix node.
Create XML GIFTI Label node.
Create XML GIFTI LabelTable node.
Compute LabelTable node from annotation.
Create XML GIFTI metadata node.
Provides functions to read and write neuroimaging data in various file formats, with a focus on 'FreeSurfer' <http://freesurfer.net/> formats. This includes, but is not limited to, the following file formats: 1) MGH/MGZ format files, which can contain multi-dimensional images or other data. Typically they contain time-series of three-dimensional brain scans acquired by magnetic resonance imaging (MRI). They can also contain vertex-wise measures of surface morphometry data. The MGH format is named after the Massachusetts General Hospital, and the MGZ format is a compressed version of the same format. 2) 'FreeSurfer' morphometry data files in binary 'curv' format. These contain vertex-wise surface measures, i.e., one scalar value for each vertex of a brain surface mesh. These are typically values like the cortical thickness or brain surface area at each vertex. 3) Annotation file format. This contains a brain surface parcellation derived from a cortical atlas. 4) Surface file format. Contains a brain surface mesh, given by a list of vertices and a list of faces.
Useful links