A tool to perform Freesurfer volume Harminization in unseen scanner.
Project description
Neuroharmony: A tool for harmonizing volumetric MRI data from unseen scanners
The model presented in Garcia-Dias, et al. (2020).
Install Neuroharmony.
Clone the repository:
git clone https://github.com/garciadias/Neuroharmony.git
Install:
python setup.py install
Example of use:
Pre-trained Neuroharmony model
An example plot of how to load and apply pre-trained a Neuroharmony model.
import matplotlib.pyplot as plt
from neuroharmony.models.harmonization import fetch_trained_model, fetch_sample
import seaborn as sns
X = fetch_sample()
neuroharmony = fetch_trained_model()
x_harmonized = neuroharmony.transform(X)
rois = ['Left-Hippocampus',
'lh_bankssts_volume',
'lh_posteriorcingulate_volume',
'lh_superiorfrontal_volume',
'rh_frontalpole_volume',
'rh_parsopercularis_volume',
'rh_parstriangularis_volume',
'rh_superiorfrontal_volume',
'Right-Cerebellum-White-Matter',
]
fig, axes = plt.subplots(3, 3, figsize=(10, 10))
for roi, ax in zip(rois, axes.flatten()):
ax.plot(neuroharmony.kde_data_[roi]['x'], neuroharmony.kde_data_[roi]['y'],
color='#fcb85b', ls='--', label='ComBat harmonized training set')
sns.kdeplot(X[roi], color='#f47376', ls=':', legend=False, ax=ax, label='Original test set')
sns.kdeplot(x_harmonized[roi], color='#00bcab', ls='-', legend=False, ax=ax, label='Harmonized test set')
ax.set_xlabel(roi, fontsize=13)
axes.flatten()[2].legend(ncol=3, bbox_to_anchor=(0.8, 1.175), fontsize=13)
axes.flatten()[3].set_ylabel('Density', fontsize=15)
plt.subplots_adjust(left=0.07, right=0.99,
bottom=0.05, top=0.96,
hspace=0.20, wspace=0.20)
plt.savefig('test.png', dpi=200)
plt.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
Neuroharmony-0.0.1.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for Neuroharmony-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f61a5178e9bc4bab34bbb7d4e7fe4e2f49f6b2b084d4b4d1bfc02198167b4721 |
|
MD5 | 88f715aa9f67f110577d857b7091090d |
|
BLAKE2b-256 | e0ae83f87441149c7384adce65caf4b412c6ba440f721ec8344e4f72acc34d20 |