io_mesh

nighres.io.load_mesh_geometry(surf_mesh)[source]

Load a mesh geometry into a dictionary with entries “points” and “faces”

Parameters:surf_mesh – Mesh geometry to be loaded, can be a path to a file (currently supported formats are freesurfer geometry formats, gii and ASCII-coded vtk, ply or obj) or a dictionary with the keys “points” and “faces”
Returns:Dictionary with a numpy array with key “points” for a Numpy array of the x-y-z coordinates of the mesh vertices and key “faces” for a Numpy array of the the indices (into points) of the mesh faces
Return type:dict

Notes

Originally created as part of Laminar Python [1]_

References

[1]Huntenburg et al. (2017), Laminar Python: Tools for cortical depth-resolved analysis of high-resolution brain imaging data in Python. DOI: 10.3897/rio.3.e12346
nighres.io.save_mesh_geometry(filename, surf_dict)[source]

Saves surface mesh geometry to file

Parameters:
  • filename (str) – Full path and filename under which surfaces data should be saved. The extension determines the file format. Currently supported are freesurfer geometry formats, gii and ASCII-coded vtk, obj, ply’
  • surf_dict (dict) – Surface mesh geometry to be saved. Dictionary with a numpy array with key “points” for a Numpy array of the x-y-z coordinates of the mesh vertices and key “faces2 for a Numpy array of the the indices (into points) of the mesh faces

Notes

Originally created as part of Laminar Python [1]_

References

[1]Huntenburg et al. (2017), Laminar Python: Tools for cortical depth-resolved analysis of high-resolution brain imaging data in Python. DOI: 10.3897/rio.3.e12346
nighres.io.load_mesh_data(surf_data, gii_darray=None)[source]

Loads mesh data into a Numpy array

Parameters:
  • surf_data – Mesh data to be loaded, can be a Numpy array or a path to a file. Currently supported formats are freesurfer data formats (mgz, curv, sulc, thickness, annot, label), nii, gii, ASCII-coded vtk and txt
  • gii_darray (int, optional) – Index of gii data array to load (default is to load all)
Returns:

Numpy array containing the data

Return type:

np.ndarray

Notes

Originally created as part of Laminar Python [1]_

References

[1]Huntenburg et al. (2017), Laminar Python: Tools for cortical depth-resolved analysis of high-resolution brain imaging data in Python. DOI: 10.3897/rio.3.e12346
nighres.io.save_mesh_data(filename, surf_data)[source]

Saves surface data that is a Numpy array to file

Parameters:
  • filename (str) – Full path and filename under which surfaces data should be saved. The extension determines the file format. Currently supported are freesurfer formats curv, thickness, sulc and ASCII-coded txt’
  • surf_data (np.ndarray) – Surface data to be saved

Notes

Originally created as part of Laminar Python [1]_

References

[1]Huntenburg et al. (2017), Laminar Python: Tools for cortical depth-resolved analysis of high-resolution brain imaging data in Python. DOI: 10.3897/rio.3.e12346