Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions library/voxeldepths_from_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ def load_fs_surf_in_grid(surf_file, grid_to_scanner, label_file=None):
by using the grid_to_scanner transformation (e.g. affine function a functional nifti image).
"""
# load freesurfer surface
coords, faces, volume_info = nib.freesurfer.read_geometry(
surf_file, read_metadata=True
)
fs_to_scanner = np.eye(4)
if surf_file[-4:] == ".gii":
surf_gii = nib.load(surf_file)
coords = surf_gii.agg_data("NIFTI_INTENT_POINTSET")
faces = surf_gii.agg_data("NIFTI_INTENT_TRIANGLE")
volume_info = {"cras": np.array([0.0, 0.0, 0.0])}
else:
# load freesurfer surface
coords, faces, volume_info = nib.freesurfer.read_geometry(
surf_file, read_metadata=True
)

# if label file provided
if label_file is not None:
Expand Down