A collection of utilities used for MRI data analysis
Project description
neuroimager
A collection of utilities used for MRI data analysis
Automatic Analysis of HMM model estimated by HMM-MAR
To be done
Atlas Operation
Suggest you have two probability atlas:
from nilearn import plotting
import nibabel as nib
import os
# Plot the original prob masks
atlas_path = "./assets/masks/"
files = [
"HarvardOxford-sub-prob-1mm.nii.gz",
"JHU-ICBM-tracts-prob-1mm.nii.gz",
]
atlas_paths = [os.path.join(atlas_path, file) for file in files]
# plot listed atlases with nilearn.plotting.plot_prob_atlas
for file in atlas_paths:
img = nib.load(file)
plotting.plot_prob_atlas(img, title=file, draw_cross=False, threshold="auto")
plotting.show()
Then you can use the atlas_operation to do some operations on the atlases:
## Remove selected regions
```python
from neuroimager.utils import filter_rois
harvard_sub = nib.load("./assets/masks/HarvardOxford-sub-prob-1mm.nii.gz")
rois_to_remove = [0, 1, 11, 12] # remove the cortical regions in this atlas
output_path = "./assets/output/filtered_harvard_sub.nii.gz"
filtered_atlas = filter_rois(harvard_sub, rois_to_remove, output_path)
plotting.plot_prob_atlas(filtered_atlas, draw_cross=False, threshold="auto")
plotting.show()
Merge two atlases
from neuroimager.utils import combine_probabilistic_atlases
atlas_paths = [
"./assets/output/filtered_harvard_sub.nii.gz",
"./assets/masks/JHU-ICBM-tracts-prob-1mm.nii.gz",
]
combined_atlas = combine_probabilistic_atlases(
atlas_paths, "./assets/output/combined_prob_atlas.nii.gz"
)
plotting.plot_roi(combined_atlas, title="3D Atlas")
plotting.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
neuroimager-0.0.7.tar.gz
(39.4 kB
view hashes)
Built Distribution
Close
Hashes for neuroimager-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872d947c0c93b6e9c7297f2dc7110cbd5158018ce9782a01d276ef7e673a8292 |
|
MD5 | c9af4959525b8829476e1b69e1064d6d |
|
BLAKE2b-256 | eef408d133f5aaaacfa0320ab6bb5121b1baa2ab3fb475d3932a84a13484e048 |