# NeuroConn
NeuroConn is a Python package that provides a user-friendly interface for fMRI preprocessing and computing connectivity matrices and gradients. It is designed as a BIDS application, allowing easy integration with BIDS-formatted datasets.
Documentation: https://victoris93.github.io/NeuroConn/
## Features
<font color="red">**NB! If you wish to run `fmriprep` within this package, install Docker Desktop first. Keep it running when you start** `RawDataset.docker_fmriprep()`</font>
- Preprocessing of fMRI data using the fmriprep pipeline
- Computation of connectivity matrices and gradients
- Direct output of gradients or connectivity matrices for any subject without specifying preprocessing parameters
- Handling of BIDS-formatted datasets
## Installation
You can install NeuroConn using pip: `pip install NeuroConn`
## Usage
**1. fMRIPrep**. The class `RawDataset` features a method to run fmriprep within within your Python environment. Before running it:
1. Register with freesurfer and download the license file `freesurfer_license.txt`)
2. Install Docker Desktop.
3. After having activated your environment, run `pip install fmriprep-docker`.
4. Start Docker Desktop.
Then, give this a try:
```
from NeuroConn.preprocessing.preprocessing import RawDataset, FmriPreppedDataSet
from NeuroConn.data.example_datasets import fetch_example_data
ex_data = fetch_example_data() # from https://openneuro.org/datasets/ds002748
data = RawDataset(ex_data)
subject = '52'
data.docker_fmriprep(subject, fs_reconall = False, fs_license = <path_to_freesurfer_license.txt>)
```
**2. Post-fMRIPrep** Here's an example of how to use the `FmriPreppedDataSet` class provided by NeuroConn:
```
from NeuroConn.preprocessing.preprocessing import RawDataset, FmriPreppedDataSet
from NeuroConn.data.example_datasets import fetch_example_data
# Download the dataset preprocessed with fMRIPrep
example_data = fetch_example_data('https://drive.google.com/file/d/1XjF5wDJXHzMyfoAjQE6NW2xcj9PulZzH/view?usp=share_link')
# Initialize the dataset object
dataset = FmriPreppedDataSet(example_data)
# Compute connectivity matrix
conn_matrix = data_prepped.get_conn_matrix(subject, parcellation='schaefer', task='rest', n_parcels=1000, save = True)
# Compute 10 gradients (Margulies et al., 2016)
gradients = get_gradients(data_prepped,subject, task='rest', n_components = 10, approach = "pca")
```
For more detailed information and examples, please refer to the [notebook](https://github.com/victoris93/PyConn/blob/master/NeuroConn.ipynb).
## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on this GitHub repository.
## License
NeuroConn is released under the MIT License. See the LICENSE file for more details.
## Example Data
Bezmaternykh D.D., Melnikov M.Y., Savelov A.A. et al. Brain Networks Connectivity in Mild to Moderate Depression: Resting State fMRI Study with Implications to Nonpharmacological Treatment. Neural Plasticity, 2021. V. 2021. № 8846097. PP. 1-15. DOI: 10.1155/2021/8846097
Raw data
{
"_id": null,
"home_page": "https://github.com/victoris93/NeuroConn",
"name": "NeuroConn",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "fmriprep,BIDS,connectivity,gradients,dispersion",
"author": "Victoria Shevchenko",
"author_email": "shevchenko682@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/33/ad/a8b6f3ccd0a69a31b0d0cb2fb5ae29e233419529f97ca2f0b3c73de4baef/NeuroConn-0.1.0a6.tar.gz",
"platform": null,
"description": "# NeuroConn\n\nNeuroConn is a Python package that provides a user-friendly interface for fMRI preprocessing and computing connectivity matrices and gradients. It is designed as a BIDS application, allowing easy integration with BIDS-formatted datasets.\nDocumentation: https://victoris93.github.io/NeuroConn/\n\n## Features\n\n<font color=\"red\">**NB! If you wish to run `fmriprep` within this package, install Docker Desktop first. Keep it running when you start** `RawDataset.docker_fmriprep()`</font>\n- Preprocessing of fMRI data using the fmriprep pipeline\n- Computation of connectivity matrices and gradients\n- Direct output of gradients or connectivity matrices for any subject without specifying preprocessing parameters\n- Handling of BIDS-formatted datasets\n\n## Installation\n\nYou can install NeuroConn using pip: `pip install NeuroConn`\n\n## Usage\n**1. fMRIPrep**. The class `RawDataset` features a method to run fmriprep within within your Python environment. Before running it:\n1. Register with freesurfer and download the license file `freesurfer_license.txt`)\n2. Install Docker Desktop.\n3. After having activated your environment, run `pip install fmriprep-docker`.\n4. Start Docker Desktop.\nThen, give this a try:\n\n```\nfrom NeuroConn.preprocessing.preprocessing import RawDataset, FmriPreppedDataSet\nfrom NeuroConn.data.example_datasets import fetch_example_data\nex_data = fetch_example_data() # from https://openneuro.org/datasets/ds002748\ndata = RawDataset(ex_data)\nsubject = '52'\ndata.docker_fmriprep(subject, fs_reconall = False, fs_license = <path_to_freesurfer_license.txt>)\n```\n\n**2. Post-fMRIPrep** Here's an example of how to use the `FmriPreppedDataSet` class provided by NeuroConn:\n\n```\nfrom NeuroConn.preprocessing.preprocessing import RawDataset, FmriPreppedDataSet\nfrom NeuroConn.data.example_datasets import fetch_example_data\n\n# Download the dataset preprocessed with fMRIPrep\nexample_data = fetch_example_data('https://drive.google.com/file/d/1XjF5wDJXHzMyfoAjQE6NW2xcj9PulZzH/view?usp=share_link') \n# Initialize the dataset object \ndataset = FmriPreppedDataSet(example_data)\n\n# Compute connectivity matrix\nconn_matrix = data_prepped.get_conn_matrix(subject, parcellation='schaefer', task='rest', n_parcels=1000, save = True)\n\n# Compute 10 gradients (Margulies et al., 2016)\ngradients = get_gradients(data_prepped,subject, task='rest', n_components = 10, approach = \"pca\")\n```\n\nFor more detailed information and examples, please refer to the [notebook](https://github.com/victoris93/PyConn/blob/master/NeuroConn.ipynb).\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on this GitHub repository.\n\n## License\n\nNeuroConn is released under the MIT License. See the LICENSE file for more details.\n\n## Example Data\n\nBezmaternykh D.D., Melnikov M.Y., Savelov A.A. et al. Brain Networks Connectivity in Mild to Moderate Depression: Resting State fMRI Study with Implications to Nonpharmacological Treatment. Neural Plasticity, 2021. V. 2021. \u2116 8846097. PP. 1-15. DOI: 10.1155/2021/8846097\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A BIDS toolbox for connectivity & gradient analyses.",
"version": "0.1.0a6",
"project_urls": {
"Homepage": "https://github.com/victoris93/NeuroConn"
},
"split_keywords": [
"fmriprep",
"bids",
"connectivity",
"gradients",
"dispersion"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "09f1bc67a63062bfb915637bb2beaf884dbff6461bf105aec8cd7c94b8e31ebb",
"md5": "3af2f458a5e3a2f3793140faf831d5a9",
"sha256": "f2362a260d50520de729adc2bfcd03e84c312e3aff43f56ac04db39e270e18cf"
},
"downloads": -1,
"filename": "NeuroConn-0.1.0a6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3af2f458a5e3a2f3793140faf831d5a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7712071,
"upload_time": "2023-08-31T10:13:30",
"upload_time_iso_8601": "2023-08-31T10:13:30.815572Z",
"url": "https://files.pythonhosted.org/packages/09/f1/bc67a63062bfb915637bb2beaf884dbff6461bf105aec8cd7c94b8e31ebb/NeuroConn-0.1.0a6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33ada8b6f3ccd0a69a31b0d0cb2fb5ae29e233419529f97ca2f0b3c73de4baef",
"md5": "42293ea4e984a67975955852a2bcec2d",
"sha256": "4fa1dbc0c3ee351819f77c50ff0cf4dd2fde43df43d4fa9d0fc7b93239cf266d"
},
"downloads": -1,
"filename": "NeuroConn-0.1.0a6.tar.gz",
"has_sig": false,
"md5_digest": "42293ea4e984a67975955852a2bcec2d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7711986,
"upload_time": "2023-08-31T10:13:33",
"upload_time_iso_8601": "2023-08-31T10:13:33.960850Z",
"url": "https://files.pythonhosted.org/packages/33/ad/a8b6f3ccd0a69a31b0d0cb2fb5ae29e233419529f97ca2f0b3c73de4baef/NeuroConn-0.1.0a6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-31 10:13:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "victoris93",
"github_project": "NeuroConn",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "neuroconn"
}