brainprint.surfaces
Utility module holding surface generation related functions.
-
brainprint.surfaces.create_aseg_surface(subject_dir, destination, indices)[source]
Generate a surface from the aseg and label files.
- Parameters:
- subject_dir
Path Path to the subject’s directory.
- destination
Path Path to the destination directory where the surface will be saved.
- indices
list[int] List of label indices to include in the surface generation.
- Returns:
PathPath to the generated surface in VTK format.
-
brainprint.surfaces.create_aseg_surfaces(subject_dir, destination)[source]
Create surfaces from FreeSurfer aseg labels.
- Parameters:
- subject_dir
Path Path to the subject’s FreeSurfer directory.
- destination
Path Path to the destination directory for saving surfaces.
- Returns:
dict[str, Path]Dictionary of label names mapped to corresponding surface Path objects.
-
brainprint.surfaces.create_cortical_surfaces(subject_dir, destination)[source]
Create cortical surfaces from FreeSurfer labels.
- Parameters:
- subject_dir
Path Path to the subject’s FreeSurfer directory.
- destination
Path Path to the destination directory where the surfaces will be saved.
- Returns:
dict[str, Path]Dictionary mapping label names to associated surface Paths.
-
brainprint.surfaces.create_surfaces(subject_dir, destination, skip_cortex=False)[source]
Create surfaces based on FreeSurfer labels.
- Parameters:
- subject_dir
Path Path to the subject’s FreeSurfer directory.
- destination
Path Path to the destination directory where the surfaces will be saved.
- skip_cortex
bool, optional If True, cortical surfaces will not be created (default is False).
- Returns:
dict[str, Path]Dict mapping label names to the corresponding Path objects of created surfaces.
-
brainprint.surfaces.read_vtk(path)[source]
Read a VTK file and return a triangular mesh.
- Parameters:
- path
Path Path to the VTK file to be read.
- Returns:
TriaMeshA triangular mesh object representing the contents of the VTK file.
- Raises:
RuntimeErrorIf there is an issue reading the VTK file or if the file is empty.
-
brainprint.surfaces.surf_to_vtk(source, destination)[source]
Converted a FreeSurfer .surf file to .vtk.
- Parameters:
- source
Path FreeSurfer .surf file.
- destination
Path Equivalent .vtk file.
- Returns:
PathResulting .vtk file.