overlap
tit.atlas.overlap ¶
Atlas related functions for NIfTI operations
- Identify overlaps (based on image dimensions)
- Resample image to a reference if needed.
check_and_resample_atlas ¶
check_and_resample_atlas(atlas_img, reference_img, atlas_name: str)
Check if atlas dimensions match reference, resample if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atlas_img
|
nibabel image of the atlas. |
required | |
reference_img
|
nibabel image of the reference (subject data). |
required | |
atlas_name
|
str
|
Name of atlas for logging. |
required |
Returns:
| Type | Description |
|---|---|
|
Atlas data as integer ndarray in correct dimensions. |
Source code in tit/atlas/overlap.py
atlas_overlap_analysis ¶
atlas_overlap_analysis(sig_mask, atlas_files: list[str], data_dir: str, reference_img=None) -> dict[str, list]
Analyze overlap between significant voxels and atlas regions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sig_mask
|
Binary ndarray (x, y, z) of significant voxels. |
required | |
atlas_files
|
list[str]
|
List of atlas file names. |
required |
data_dir
|
str
|
Directory containing atlas files. |
required |
reference_img
|
nibabel image for resampling (optional). |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, list]
|
Dict mapping atlas names to lists of region overlap dicts. |