CorpusCallosum.data.generate_fsaverage_centroids

Script to generate static fsaverage centroids file.

This script extracts centroids from the fsaverage template segmentation and saves them to a JSON file for fast loading during pipeline execution. Run this script once to generate the centroids file.

CorpusCallosum.data.generate_fsaverage_centroids.main()[source]

Generate and save fsaverage centroids to a static file.

This script extracts centroids from the fsaverage template segmentation and saves them to a JSON file for fast loading during pipeline execution.

The script performs the following steps: 1. Load fsaverage segmentation from FreeSurfer directory 2. Extract centroids for all anatomical structures 3. Save centroids to JSON file 4. Extract and save affine matrix and header fields

Raises:
OSError

If FREESURFER_HOME environment variable is not set or invalid

FileNotFoundError

If required fsaverage files are not found

Notes

The script saves two files: - fsaverage_centroids.json : Contains centroids for each anatomical structure - fsaverage_data.json : Contains affine matrix and header information