CorpusCallosum.data.fsaverage_cc_template

CorpusCallosum.data.fsaverage_cc_template.load_fsaverage_cc_template()[source]

Load and process the fsaverage corpus callosum template.

This function loads the fsaverage segmentation from FreeSurfer’s data directory, extracts the corpus callosum mask, and processes it to create a smooth template.

Returns:
CCContour

Object with all the contour information including: - contour : tuple[np.ndarray, np.ndarray] : x and y coordinates of the contour points. - anterior_endpoint_idx : np.ndarray : Index of the anterior endpoint. - posterior_endpoint_idx : np.ndarray : Index of the posterior endpoint.

Raises:
OSError

If FREESURFER_HOME environment variable is not set correctly.

CorpusCallosum.data.fsaverage_cc_template.smooth_contour(contour, window_size=5)[source]

Smooth a contour using a moving average filter.

Parameters:
contourtuple of arrays

The contour coordinates (x, y).

window_sizeint

Size of the smoothing window.

Returns:
tuple of arrays

The smoothed contour coordinates (x, y).