Brain Atlas¶
BrainGlobe-backed atlas integration. Downloads atlas data on first use and registers anatomical meshes into the lab coordinate frame. See the Brain Atlas user guide.
BG_Atlas
¶
Wrap a BrainGlobe atlas and align it to the eSDIva brain coordinate space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atlas_name
|
str
|
BrainGlobe atlas name (e.g. |
None
|
region_names
|
str or list[str]
|
Structure name(s) to load. Default is None (falls back to |
None
|
whs_voxels
|
dict
|
Landmark voxel coordinates with keys |
None
|
manual_fit
|
dict
|
Manual alignment with keys |
None
|
verbose
|
bool
|
If True, print intermediate matrices during alignment. Default is False. |
False
|
set_bgatlas
¶
Load a BrainGlobe atlas and update the instance attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atlas_name
|
str
|
The name of the BrainGlobe atlas to load. |
required |
region_names
|
str or list[str]
|
Structure name(s) to retrieve. Default is None (falls back to
|
None
|
whs_voxels
|
dict
|
Landmark voxel coordinates with keys |
None
|
manual_fit
|
dict
|
Manual alignment with keys |
None
|
verbose
|
bool
|
If True, print intermediate matrices. Default is False. |
False
|
get_pv_mesh_from_atlas
¶
Load PyVista mesh(es) from a BrainGlobe atlas for the given structures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bg_atlas
|
BrainGlobeAtlas
|
The BrainGlobe atlas object. |
required |
region_names
|
str or list[str]
|
The name(s) of the structure(s) to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, PolyData]
|
Mapping of region name to its PyVista mesh. |
transform
¶
Apply an affine transformation to the stored or supplied PyVista mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T_matrix
|
(4, 4) numpy.ndarray
|
Homogeneous transformation matrix to apply. If None, no transformation is performed. Default is None. |
None
|
pv_mesh
|
dict[str, PolyData]
|
Mesh(es) to transform. If None, the atlas mesh stored on the instance is used. Default is None. |
None
|
inplace
|
bool
|
If True, mutate the instance's mesh in place and return None. If False, return a transformed copy. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, PolyData] or None
|
Transformed mesh(es), or None when |
reset_mesh
¶
Reload the PyVista mesh from the atlas and re-apply the BPS transform.
Returns:
| Type | Description |
|---|---|
dict[str, PolyData]
|
The freshly loaded and transformed mesh(es). |