fsqc.fsqcUtils¶
This module provides various import/export functions as well as the ‘levelsetsTria’ function
- fsqc.fsqcUtils.applyTransform(img_file, out_file, mat_file, interp)[source]¶
Apply a transformation to an image.
- fsqc.fsqcUtils.binarizeImage(img_file, out_file, match=None)[source]¶
Binarize an image and saves the result.
- Parameters:
- img_file
str
Path to the input image file.
- out_file
str
Path to save the binarized image.
- matcharray_like or
None
,optional
Values to consider as True. If None, non-zero values are considered True.
- img_file
- Returns:
None
This function returns nothing.
Notes
This function uses nibabel to load and save NIfTI images.
- fsqc.fsqcUtils.importMGH(filename)[source]¶
A function to read Freesurfer MGH files.
- Parameters:
- filename
str
Path to the MGH file.
- filename
- Returns:
- vol
numpy.ndarray
3D array containing vol values.
- vol
Notes
Requires a valid MGH file. If not found, NaNs will be returned.
- fsqc.fsqcUtils.levelsetsTria(v, t, p, levelsets)[source]¶
Generate intersections of triangles with level sets.
- Parameters:
- v
numpy.ndarray
Array of vertex coordinates with shape (n, 3).
- t
numpy.ndarray
Array of triangles with vertex indices, shape (m, 3).
- p
numpy.ndarray
Array of values corresponding to vertex points, shape (n,).
- levelsets
list
ornumpy.ndarray
List or array of level set values.
- v
- Returns:
- fsqc.fsqcUtils.readLTA(file)[source]¶
It reads a LTA (Linear Transform Array) file and extracts transformation information.
- fsqc.fsqcUtils.returnFreeSurferColorLUT()[source]¶
Provide FreeSurfer color look-up table.
- Returns:
numpy.ndarray
This function returns numpy array.