brainprint.brainprint¶
Definition of the brainprint analysis execution functions..
- brainprint.brainprint.apply_eigenvalues_options(eigenvalues, triangular_mesh, norm='none', reweight=False)[source]¶
Apply BrainPrint analysis configuration options to the ShapeDNA eigenvalues.
- Parameters:
- eigenvalues
np.ndarray
ShapeDNA derived eigenvalues.
- triangular_mesh
TriaMesh
Surface representation.
- norm
str
,optional
Eigenvalues normalization method (default is “none”).
- reweight
bool
,optional
Whether to reweight eigenvalues or not (default is False).
- eigenvalues
- Returns:
np.ndarray
Fixed eigenvalues.
- brainprint.brainprint.compute_brainprint(surfaces, keep_eigenvectors=False, num=50, norm='none', reweight=False, use_cholmod=False)[source]¶
Compute ShapeDNA descriptors over several surfaces.
- Parameters:
- surfaces
dict
[str
,Path
] Dictionary mapping from labels to .vtk paths.
- keep_eigenvectors
bool
,optional
Whether to also return eigenvectors or not, by default False.
- num
int
,optional
Number of eigenvalues to compute, by default 50.
- norm
str
,optional
Eigenvalues normalization method, by default “none”.
- reweight
bool
,optional
Whether to reweight eigenvalues or not, by default False.
- use_cholmod
bool
,optional
If True, attempts to use the Cholesky decomposition for improved execution speed. Requires the
scikit-sparse
library. If it can not be found, an error will be thrown. If False, will use slower LU decomposition. This is the default.
- surfaces
- Returns:
tuple
[dict
[str
,np.ndarray
],Union
[dict
[str
,np.ndarray
],None
]]Surface label to eigenvalues, surface label to eigenvectors (if keep_eigenvectors is True).
- brainprint.brainprint.compute_surface_brainprint(path, return_eigenvectors=True, num=50, norm='none', reweight=False, use_cholmod=False)[source]¶
Compute BrainPrint eigenvalues and eigenvectors for the given surface.
- Parameters:
- path
Path
Path to the .vtk surface path.
- return_eigenvectors
bool
,optional
Whether to store eigenvectors in the result (default is True).
- num
int
,optional
Number of eigenvalues to compute (default is 50).
- norm
str
,optional
Eigenvalues normalization method (default is “none”).
- reweight
bool
,optional
Whether to reweight eigenvalues or not (default is False).
- use_cholmod
bool
,optional
If True, attempts to use the Cholesky decomposition for improved execution speed. Requires the
scikit-sparse
library. If it can not be found, an error will be thrown. If False, will use slower LU decomposition. This is the default.
- path
- Returns:
tuple
[np.ndarray
,Union
[np.ndarray
,None
]]Eigenvalues, eigenvectors (if returned).
- brainprint.brainprint.run_brainprint(subjects_dir, subject_id, destination=None, num=50, skip_cortex=False, keep_eigenvectors=False, norm='none', reweight=False, asymmetry=False, asymmetry_distance='euc', keep_temp=False, use_cholmod=False)[source]¶
Run the BrainPrint analysis.
- Parameters:
- subjects_dir
Path
FreeSurfer’s subjects directory.
- subject_id
str
The subject identifier, as defined within the FreeSurfer’s subjects directory.
- destination
Path
,optional
If provided, will use this path as the results root directory, by default None.
- num
int
,optional
Number of eigenvalues to compute, by default 50.
- skip_cortex
bool
,optional
_description_, by default False.
- keep_eigenvectors
bool
,optional
Whether to also return eigenvectors or not, by default False.
- norm
str
,optional
Eigenvalues normalization method, by default “none”.
- reweight
bool
,optional
Whether to reweight eigenvalues or not, by default False.
- asymmetry
bool
,optional
Whether to calculate asymmetry between lateral structures, by default False.
- asymmetry_distance
str
,optional
Distance measurement to use if asymmetry is set to True, by default “euc”.
- keep_temp
bool
,optional
Whether to keep the temporary files directory or not, by default False.
- use_cholmod
bool
,optional
If True, attempts to use the Cholesky decomposition for improved execution speed. Requires the
scikit-sparse
library. If it can not be found, an error will be thrown. If False, will use slower LU decomposition. This is the default.
- subjects_dir
- Returns:
Tuple
[Dict
[str
,np.ndarray
],Union
[Dict
[str
,np.ndarray
],None
],Union
[Dict
[str
,float
],None
]]A tuple containing dictionaries with BrainPrint analysis results. - Eigenvalues - Eigenvectors - Distances