Giter Club home page Giter Club logo

dyconnmap's Introduction

dyconnmap

A neuroimaging module for dynamic connectome mapping.

build & code

Build Status Coverage Status Codacy Badge

package

PyPI version Anaconda-Server Badge Whenenver a new tag is pushed; a wheel distribution is uploaded on the Test PyPI index. Libraries.io dependency status for latest release
Downloads

release

python-versions Licence Documentation Status

tutorials

Binder

social & updates

RG

dyconnmap (abbreviated from “dynamic connectome mapping”), a neuroimaging python module specifically designed for estimating the dynamic connectivity and analyzing complex brain networks; from neurophysiological data such as electroencephalogram (EEG), magnetoencephalography (MEG) and functional magnetic resonance imaging (fMRI) recordings. It includes numerous submodules to work with, such as chronnectomics and graph-theoretical algorithms, (symbolic) time series and statistical methods.

This is an ongoing effort to develop the module further and extend it by adding more algorithms related to graph analysis and statistical approaches. Considering the increasing acceptance and usage of python in analyzing neuroimaging data, we firmly believe that the module will be a great addition in every practitioner's toolbox engaged in brain connectivity analysis.

Built on NumPy, SciPy, matplotlib and networkx.

Workflow outline

workflow

Publications

Resources

Citation

If you use dyconnmap or dyfunconn in a published work, please consider citing.

1. Marimpis, A. D., Dimitriadis, S. I., & Goebel, R. (2021). Dyconnmap: Dynamic connectome mapping—A neuroimaging python module. Human Brain Mapping, 42( 15), 4909– 4939. https://doi.org/10.1002/hbm.25589
2. Marimpis, A. D., & Dimitriadis, S. I. (2017). dyfunncon: dynamic functional connectivity–a neuroimaging Python module. F1000Research, 6. https://doi.org/10.7490/f1000research.1114652.1

Sponsors

Nov 2017 - Apr 2021 Brain Innovation B.V.
Sept 2017 BRAINTRAIN (Taking imaging into the therapeutic domain: Self-regulation of brain systems for mental disorders) research project (FP7-HEALTH).

dyconnmap's People

Contributors

dependabot-preview[bot] avatar makism avatar wmvanvliet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dyconnmap's Issues

Estimate dFC for fMRI?

Hi there,

Thanks for developing this package! I have already found some useful tools for static FC here, but I have been struggling to work out if it is possible to do any dynamic FC analyses for fMRI data? Following up on previous threads #11

If so, I'd be really grateful for some tips to get started. I'd like to start with generating some FC networks from sliding windows.

Many thanks,
Joff

About the proper setting of tvfcg

A question of usage rather than a bug report.

Assume we have a 10sec EEG 14 channels data sampled at 128Hz. The objective is to evaluate the dynamic FC in a non-overlapping time windows of 2s. Given the sync bandwidth of interest is [1.0, 4.0].

Since, the lowest freq is 1.0Hz with 128Hz sampling rate, Cycle criterion should be equal to 2 (correct me if I am wrong).

Then, my question, what is the correct number for step value? My basic understanding tell me it should be equal to 5? Since, each of the 2sec window contain 256 sample, and moving the window for 5 times will cover all the 256*5 =1280 data points.

Say if it is correct step equal to 5. According to the line below, the total number of sliding windows as calculated from (n_samples - window_length) / step is equal to 205.

windows = np.int32(np.round((n_samples - window_length) / step))

But this lead to another question, why the fcgs = np.zeros((windows, n_channels, n_channels)) having the shape of 205,14,14. Shouldt it be the size of 5,14,14?

pyedflib fails to read the sample EEG files

In your first EEG tutorial, the eegmmidb EEG data is loaded with pyedflib. However, the EDF files in that project are not strictly complient, because they contain prefilter information in both the "standard" fields and EDF+ annotation fields. pyedflib chokes on them:

>>> import pyedflib
>>> pyedflib.EdfReader('eegmmidb/S001/S001R01.edf')

Traceback (most recent call last):
  File "pyedflib/_extensions/_pyedflib.pyx", line 146, in pyedflib._extensions._pyedflib.CyEdfReader.__init__
  File "pyedflib/_extensions/_pyedflib.pyx", line 207, in pyedflib._extensions._pyedflib.CyEdfReader.open
  File "pyedflib/_extensions/_pyedflib.pyx", line 179, in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok
OSError: eegmmidb/S001/S001R01.edf: the file is not EDF(+) or BDF(+) compliant (Prefilter)

I've send a pull request to pyedflib to address the issue, but how did you work around it when writing the tutorial?

ImportError: cannot import name 'factorial' from 'scipy.misc'

Hi,

when using the latest Scipy v1.4.1, importing dyconnmap causes the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-cc4061b0c448> in <module>
----> 1 import dyconnmap

~/dev/tf2/lib/python3.7/site-packages/dyconnmap/__init__.py in <module>
      5 """
      6 
----> 7 from .tvfcgs import tvfcg, tvfcg_ts, tvfcg_cfc, tvfcg_compute_windows
      8 from .sliding_window import sliding_window_indx, sliding_window
      9 from .analytic_signal import analytic_signal

~/dev/tf2/lib/python3.7/site-packages/dyconnmap/tvfcgs.py in <module>
     49 import numpy as np
     50 
---> 51 from .fc.estimator import Estimator
     52 
     53 

~/dev/tf2/lib/python3.7/site-packages/dyconnmap/fc/__init__.py in <module>
     14 from .cos import cos
     15 from .pec import pec
---> 16 from .glm import glm
     17 from .pac import PAC, pac
     18 from .mui import mutual_information

~/dev/tf2/lib/python3.7/site-packages/dyconnmap/fc/glm.py in <module>
     27 
     28 import numpy as np
---> 29 import statsmodels.api as sm
     30 
     31 

~/dev/tf2/lib/python3.7/site-packages/statsmodels/api.py in <module>
     14 from . import robust
     15 from .robust.robust_linear_model import RLM
---> 16 from .discrete.discrete_model import (Poisson, Logit, Probit,
     17                                       MNLogit, NegativeBinomial,
     18                                       GeneralizedPoisson,

~/dev/tf2/lib/python3.7/site-packages/statsmodels/discrete/discrete_model.py in <module>
     43 
     44 from statsmodels.base.l1_slsqp import fit_l1_slsqp
---> 45 from statsmodels.distributions import genpoisson_p
     46 
     47 try:

~/dev/tf2/lib/python3.7/site-packages/statsmodels/distributions/__init__.py in <module>
      1 from .empirical_distribution import ECDF, monotone_fn_inverter, StepFunction
----> 2 from .edgeworth import ExpandedNormal
      3 from .discrete import genpoisson_p, zipoisson, zigenpoisson, zinegbin

~/dev/tf2/lib/python3.7/site-packages/statsmodels/distributions/edgeworth.py in <module>
      5 import numpy as np
      6 from numpy.polynomial.hermite_e import HermiteE
----> 7 from scipy.misc import factorial
      8 from scipy.stats import rv_continuous
      9 import scipy.special as special

ImportError: cannot import name 'factorial' from 'scipy.misc' (/home/phait/dev/tf2/lib/python3.7/site-packages/scipy/misc/__init__.py)

An easy fix would be to change the import to:

from scipy.special import factorial

Cheers,
Daniele

Decouple filtering parameters from the estimators

It came into my attention that it would be a nice idea if the parameters fs, fb (those related to filtering) were decoupled from the estimators themselves.

This way, one can use the estimators with, i.e. preprocessed fMRI time series.

the test does not run correctly

Dear Makism,

Hello.

First of all, thanks for the great tool.

After installation, I realized the test does not run correctly on my side. Could you have a look the output?
Is there anything I should modify?

slurm@master:/home2/data/dyconn/dyconnmap-master/tests$ ls
data test_fc.py
init.py test_graphs.py
pycache test_graphs_threshold.py
test_chronnectomics.py test_sliding_window.py
test_clustering.py test_ts.py
test_clustering_validity.py test_tvfcgs.py

slurm@master:/home2/data/dyconn/dyconnmap-master/tests$ nosetests -svd .


Ran 0 tests in 0.000s

OK

Yours sincerely
Meng

Not installable via pip

Environment: Python 3.7.2 (running in venv module), macOS 10.14.3

(env) $ pip3 install dyfunconn
Collecting dyfunconn
  Could not find a version that satisfies the requirement dyfunconn (from versions: )
No matching distribution found for dyfunconn

I see that the module is not published on PyPi, so you might just need to change the README to explicitly point to the git repo (if that is the desired op). When searching for it on PyPi the only result that comes up is Spektral.

The usage of surrogate analysis

Dear Makism or other users,
first of all, thanks so much for your contribution in dynamic connectome mapping, which I learned a lot.
But now I am confused of the usage of surrogate analysis, which, from my understanding, is aimed to identify the "true" connections between nodes.
Here is the procedure I understand:
firstly, I contructed a 4-D dynamic functional connectivity matrix (coupling modes × temporal segments × ROIs × ROIs) for each participant.
Secondly, the time serials from corresponding frequency band, two ROIs were extracted for surrogate analysis.
Thirdly, the dynamic functional connectivity values were compared with the 1000 surrogate values and then corrected by FDR.
Is that corrected?

Meanwhile, I have some confused points:

  1. what's the meaning of the output "p_val, corr_surr, surrogates, r_value"?
  2. the surrogate analysis was conducted in individual level or group level?

I would appreciate a lot if any one could answer my questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.