rapidtide


Namerapidtide JSON
Version 2.8.3 PyPI version JSON
download
home_pagehttps://github.com/bbfrederick/rapidtide
SummaryTools for performing correlation analysis on fMRI data.
upload_time2024-03-07 18:26:57
maintainer
docs_urlNone
authorBlaise Frederick
requires_python>=3.8
licenseApache Software License
keywords fmri correlation riptide noise
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            The rapidtide package
=====================

Rapidtide is a suite of Python programs used to model, characterize, 
visualize, and remove time varying, physiological blood signals from fMRI and fNIRS 
datasets.  The primary workhorses of the package are the rapidtide program, 
which characterizes bulk blood flow, and happy, which focusses on the cardiac
band.

Full documentation is at: http://rapidtide.readthedocs.io/en/latest/

|PyPi Latest Version| |PyPi - Python Versions| |License| |Documentation Status| |CircleCI| |Coverage| |DOI| |Funded by NIH|

The rapidtide program
---------------------

Rapidtide is also the name of the first program in the package, which is
used to perform rapid time delay
analysis on functional imaging data to find time lagged correlations
between the voxelwise time series and other time series, primarily in the LFO
band.


Why do I want to know about time lagged correlations?
`````````````````````````````````````````````````````

This comes out of work by our group (The Opto-Magnetic group at McLean
Hospital - http://www.nirs-fmri.net) looking at the correlations between
neuroimaging data (fMRI) and NIRS data recorded simultaneously, either
in the brain or the periphery. We found that a large fraction of the
\"noise\" we found at low frequency in fMRI data was due to real,
random[*] fluctuations of blood oxygenation and volume (both of which
affect the intensity of BOLD fMRI images) in the blood passing through
the brain. More interestingly, because these characteristics of blood
move with the blood itself, this gives you a way to determine blood
arrival time at any location in the brain. This is interesting in and of
itself, but also, this gives you a method for optimally modelling (and
removing) in band physiological noise from fMRI data (see references
below).

After working with this for several years we\'ve also found that you
don\'t need to used simultaneous NIRS to find this blood borne signal -
you can get it from blood rich BOLD voxels for example in the superior
sagittal sinus, or bootstrap it out of the global mean signal in the
BOLD data. You can also track exogenously applied waveforms, such as
hypercarbic and/or hyperoxic gas challenges to really boost your signal
to noise. So there are lots of times when you might want to do this type
of correlation analysis.

As an aside, some of these tools are just generally useful for looking
at correlations between timecourses from other sources – for example
doing PPI, or even some seed based analyses.

[*] \"random\" in this context means \"determined by something we don\'t
have any information about\" - maybe EtCO2 variation, or sympathetic
nervous system activity - so not really random.

Correlation analysis is easy - why use this package?
````````````````````````````````````````````````````

The simple answer is \"correlation analysis is easy, but using a
prewritten package that handles file I/O, filtering, resampling,
windowing, and the rest for you is even easier\". A slightly more complex
answer is that while correlation analysis is pretty easy to do, it\'s
hard to do right; there are lots and lots of ways to do it incorrectly.
Fortunately, I\'ve made most of those mistakes for you over the last 8
years, and corrected my code accordingly. So rather than repeat my
boring mistakes, why not make new, interesting mistakes? Explore your
own, unique chunk of wrongspace…


Happy
-----

More recently, inspired by Henning Voss\' paper on hypersampling of
cardiac signals in fMRI, we developed a method to extract and clean
cardiac waveforms from fMRI data, even when the fMRI TR is far too long
to properly sample cardiac waveforms. This cardiac waveform can then be
to track the pulsatile cardiac pressure wave through the brain in
somewhat the same way that we track the LFO signals. Among other things,
this allows you to get cardiac waveforms during scans even when either
1) you didn\'t use a plethysmograph, or 2) you did, but the recording was
of poor quality, which happens more than you might think.

What does \"happy\" have to do with any of this?
````````````````````````````````````````````````

As to why happy is part of rapidtide, that\'s partially for practical reasons (the
libraries in rapidtide have an awful lot of code that is reused in happy), and
partially thematically - rapidtide has evolved from a \"let\'s look at low
frequency signals in fMRI data\" package to a \"let\'s look at everything in
fMRI data EXCEPT neuronal activation\", so happy fits right in.


Why are you releasing this package?
===================================

For a number of reasons.

-  I want people to use it! I think if it were easier for people to do
   time delay analysis, they\'d be more likely to do it. I don\'t have
   enough time or people in my group to do every experiment that I think
   would be interesting, so I\'m hoping other people will, so I can read
   their papers and learn interesting things.
-  It\'s the right way to do science – I can say lots of things, but if
   nobody can replicate my results, nobody will believe it (we\'ve gotten
   that a lot, because some of the implications of what we\'ve seen in
   resting state data can be a little uncomfortable). We\'ve reached a
   stage in fMRI where getting from data to results involves a huge
   amount of processing, so part of confirming results involves being
   able to see how the data were processed. If you had to do everything
   from scratch, you\'d never even try to confirm anybody\'s results.
-  In any complicated processing scheme, it\'s quite possible (or in my
   case, likely) to make dumb mistakes, either coding errors or
   conceptual errors, and I almost certainly have made some (although
   hopefully the worst ones have been dealt with at this point). More
   users and more eyes on the code make it more likely that they will be
   found. As much as I\'m queasy about somebody potentially finding a
   mistake in my code, I\'d rather that they did so, so I can fix it[‡].
-  It\'s giving back to the community. I benefit from the generosity of a
   lot of authors who have made the open source tools I use for work and
   play, so I figure I can pony up too.

[‡] or better yet, you, empowered user, can fix it, and push back a fix
that benefits everybody…

Stability, etc.
===============
This is an evolving code base. I\'m constantly tinkering with it. That
said, now that I\'ve sent this off into to the world, I\'m being somewhat
more responsible about locking down stable release points. In between
releases, however, I\'ll be messing with things, although for the most
part this will be restricted to the dev branch.
**It\'s very possible that at any given time the dev branch will be very broken,
so stay away from it unless you have a good reason to be using it.**
I\'ve finally become a little more modern and started
adding automated testing, so as time goes by hopefully the \"in between\"
releases will be somewhat more reliable.  That said, my tests routinely fail, even
when things actually work.  Probably should deal with that. Check back often for exciting
new features and bug fixes!

Python version compatibility
============================
I switched over a while ago to using Python 3 as my daily driver, so I know
that everything works there. However, I know that a lot of people can\'t
or won\'t switch from Python 2x, so I kept Python 2.7 compatibility for
quite some time.

That said, the writing is on the wall, and since I depend on a number of
packages that have dropped Python 2.x support, as of 2.0, so has rapidtide. However,
as of version 1.9.0 I\'m also releasing the code in a docker
container (fredericklab/rapidtide), which has everything nicely installed in
a fully configured Python 3 environment, so there\'s really no need for me continue 2.x
support.  So now it's f-strings all the way, kids!

Ok, I\'m sold. What\'s in here?
===============================

-  **rapidtide** - This is the heart of the package - this is the
   workhorse program that will determine the time lagged correlations
   between all the voxels in a NIFTI file and a temporal \"probe\"
   regressor (which can come from a number of places, including the data
   itself) - it rapidly determines time delays… There are a truly
   bewildering array of options, and just about everything can be
   adjusted, however I\'ve tried to pick a good set of default options
   for the most basic processing to get you going. At a minimum, it
   requires a 4D NIFTI file as input, and a root name for all of the
   output files. It generates a number of 3D NIFTI file maps of various
   parameters (lag time of maximum correlation, maximum correlation
   value, a mask of which voxels have valid fits, etc.) and some text
   files with useful information (significance thresholds, processing
   timing information, a list of values of configurable options).

-  **happy** - This is a companion to rapidtide that focusses on cardiac signals.
   happy does three things - it attempts to determine the cardiac
   waveform over the time course of an fMRI dataset using slice
   selective averaging of fully unprocessed fMRI data. It also 
   cleans up this initial estimate using a deep learning filter to
   infer what the simultaneously recorded plethysmogram would be.
   Finally, it uses either the derived or a supplied plethysmogram
   signal to construct a cardiac pulsation map over a single
   cycle of the cardiac waveform, a la Voss.

-  **showxcorrx** - Like rapidtide, but for single time courses. Takes
   two text files as input, calculates and displays the time lagged
   cross correlation between them, fits the maximum time lag, and
   estimates the significance of the correlation. It has a range of
   filtering, windowing, and correlation options.

-  **rapidtide2x_legacy**, **happy_legacy**, **showxcorr_legacy** - The
   older versions of the similarly named programs.  These use the old calling
   conventions, for compatibility with older workflows.  These will go away
   eventually, and they don't really get updates or bugfixes, so if you're
   using them, change to the new ones, and if you're not using them, don't.

-  **rapidtide2std** - This is a utility for registering rapidtide
   output maps to standard coordinates. It\'s usually much faster to run
   rapidtide in native space then transform afterwards to MNI152 space.
   NB: this will only work if you have a working FSL installation.

-  **happy2std** - Guess.

-  **showtc** - A very simple command line utility that takes timecourses from text
   files and plots the data in it in a matplotlib window. That\'s it. A
   good tool for quickly seeing what\'s in a file. Has a number of options to
   make the plot prettier.

-  **showxy** - Another simple command line utility that displays the
   the data contained in text files containing whitespace separated x-y pairs.

-  **showhist** - Another simple command line utility that displays the
   histograms generated by rapidtide.

-  **resamp1tc** - takes an input text file at some sample rate and
   outputs a text file resampled to the specified sample rate.

-  **resamplenifti** - takes an input nifti file at some TR and outputs
   a nifti file resampled to the specified TR.

-  **tidepool** - This is a GUI tool for displaying all of
   the various maps and timecourses generated by rapidtide in one place, overlaid on
   an anatomic image. This makes it a bit easier to see how all the maps
   are related to one another, how the probe regressor evolves over the run, and the
   effect of the filtering parameters. To use it, launch tidepool from the
   command line, and then select a lag time map - tidepool will figure
   out the root name and pull in all of the other associated data. Works
   in native or standard space.


Financial Support
=================

This code base is being developed and supported by grants from the US
NIH (`1R01 NS097512 <http://grantome.com/grant/NIH/R01-NS097512-02>`__, RF1 MH130637-01)

Additional packages used
========================

Rapidtide would not be possible without many additional open source packages.
These include:

numpy:
------

1) Stéfan van der Walt, S. Chris Colbert and Gaël Varoquaux. The NumPy Array:
   A Structure for Efficient Numerical Computation, Computing in Science
   & Engineering, 13, 22-30 (2011) \| https://doi.org/10.1109/MCSE.2011.37

scipy:
------

1) Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy,
   David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser,
   Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson,
   K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones,
   Robert Kern, Eric Larson, CJ Carey, İlhan Polat, Yu Feng, Eric W. Moore,
   Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman,
   Ian Henriksen, E.A. Quintero, Charles R Harris, Anne M. Archibald,
   Antônio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt,
   and SciPy 1.0 Contributors. (2020) SciPy 1.0: Fundamental Algorithms for
   Scientific Computing in Python. Nature Methods, 17, 261–272 (2020) \|
   https://doi.org/10.1038/s41592-019-0686-2

matplotlib:
-----------

1) John D. Hunter. Matplotlib: A 2D Graphics Environment, Computing in Science
   & Engineering, 9, 90-95 (2007) \| https://doi.org/10.1109/MCSE.2007.55

nibabel:
--------

1) https://github.com/nipy/nibabel \| https://doi.org/10.5281/zenodo.591597

scikit-learn:
-------------

1) Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B.,
   Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V.,
   Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M.,
   and Duchesnay, E., Scikit-learn: Machine Learning in Python.
   Journal of Machine Learning Research, 2011. 12: p. 2825-2830. \| https://scikit-learn.org

pandas:
-------

1) McKinney, W., pandas: a foundational Python library for data analysis
   and statistics. Python for High Performance and Scientific Computing, 2011. 14.

nilearn:
--------

1) https://github.com/nilearn/nilearn


References
==========

Links to PDFs of all papers mentioned here can be found on the OMG
website: https://www.nirs-fmri.net/home/publications

General overview of systemic low frequency oscillations in fMRI data
--------------------------------------------------------------------

1) Tong Y, Hocke LM, Frederick BB. (2019) Low Frequency Systemic
   Hemodynamic \"Noise\" in Resting State BOLD fMRI: Characteristics,
   Causes, Implications, Mitigation Strategies, and Applications. Front.
   Neurosci., 14 August 2019 \| https://doi.org/10.3389/fnins.2019.00787

Multimodal Cerebral Circulation Imaging
---------------------------------------

1)  Tong Y, Frederick BD. (2010) Time lag dependent multimodal
    processing of concurrent fMRI and near-infrared spectroscopy (NIRS)
    data suggests a global circulatory origin for low-frequency
    oscillation signals in human brain. Neuroimage, 53(2), 553-64.

2)  Tong Y, Hocke L, Frederick BD. (2011) Isolating the sources of
    widespread physiological fluctuations in fNIRS signals. J Biomed
    Opt. 16(10), 106005.

3)  Tong Y, Bergethon PR, Frederick BD. (2011c) An improved method for
    mapping cerebrovascular reserve using concurrent fMRI and
    near-infrared spectroscopy with Regressor Interpolation at
    Progressive Time Delays (RIPTiDe). Neuroimage, 56(4), 2047-2057.

4)  Tong Y, Frederick BD. (2012) Concurrent fNIRS and fMRI processing
    allows independent visualization of the propagation of pressure
    waves and bulk blood flow in the cerebral vasculature. Neuroimage,
    Jul 16;61(4): 1419-27.

5)  Tong Y, Hocke LM, Licata SC, Frederick BD. (2012) Low frequency
    oscillations measured in the periphery with near infrared
    spectroscopy (NIRS) are strongly correlated with blood oxygen
    level-dependent functional magnetic resonance imaging (BOLD fMRI)
    signals. J Biomed Opt, 2012;17(10):106004. doi:
    10.1117/1.JBO.17.10.106004. PubMed PMID: 23224003; PMCID: 3461094.

6)  Tong Y, Hocke LM, Frederick BD. (2013) Short repetition time
    multiband EPI with simultaneous pulse recording allows dynamic
    imaging of the cardiac pulsation signal. Magn Reson Med
    2014;72(5):1268-76. Epub Nov 22, 2013. doi: 10.1002/mrm.25041.
    PubMed PMID: 24272768.

7)  Tong Y, Frederick B. (2014) Studying the Spatial Distribution of
    Physiological Effects on BOLD Signals using Ultrafast fMRI. Front
    Hum Neurosci 2014;5(196). doi: doi: 10.3389/fnhum.2014.00196.

8)  Tong Y, Frederick B. (2014) Tracking cerebral blood flow in BOLD
    fMRI using recursively generated regressors. Hum Brain Mapp.
    2014;35(11):5471-85. doi: 10.1002/hbm.22564. PubMed PMID: 24954380;
    PMCID: PMC4206590.

9)  Donahue M, Strother M, Lindsey K, Hocke L, Tong Y, Frederick B.
    (2015) Time delay processing of hypercapnic fMRI allows quantitative
    parameterization of cerebrovascular reactivity and blood flow
    delays. Journal of Cerebral Blood Flow & Metabolism.  2015. PubMed 
    PMID: 26661192. Epub October 19, 2015. doi: 10.1177/0271678X15608643.

10) Hocke L, Cayetano K, Tong Y, Frederick B. (2015) An optimized
    multimodal fMRI/NIRS probe for ultra-high resolution mapping.
    Neurophotonics. 2(4), 045004 (Oct-Dec 2015). doi:
    10.1117/1.NPh.2.4.0450004.

11) Tong Y, Hocke LM, Fan X, Janes AC, Frederick B (2015). Can apparent
    resting state connectivity arise from systemic fluctuations?
    Frontiers in human neuroscience. 2015;9. doi:
    10.3389/fnhum.2015.00285.

12) Tong Y, Lindsey KP, Hocke LM, Vitaliano G, Mintzopoulos D, Frederick
    B. (2016) Perfusion information extracted from resting state
    functional magnetic resonance imaging. Journal of cerebral blood
    flow and metabolism : official journal of the International Society
    of Cerebral Blood Flow and Metabolism. 2016. doi:
    10.1177/0271678X16631755. PubMed PMID: 26873885.

Cardiac waveform extraction and refinement
------------------------------------------

1) Aslan S, Hocke L, Schwarz N, Frederick B. (2019) Extraction of the
   cardiac waveform from simultaneous multislice fMRI data using slice
   sorted averaging and a deep learning reconstruction filter.
   NeuroImage 198, 303–316 (2019).

Physiological noise identification and removal using time delay methods
-----------------------------------------------------------------------

1) Tong Y, Lindsey KP, Frederick BD. (2011b) Partitioning of
   physiological noise signals in the brain with concurrent
   near-infrared spectroscopy (NIRS) and fMRI. J Cereb Blood Flow Metab.
   31(12), 2352-62.

2) Frederick BD, Nickerson LD, Tong Y. (2012) Physiological denoising of
   BOLD fMRI data using Regressor Interpolation at Progressive Time
   Delays (RIPTiDe) processing of concurrent fMRI and near-infrared
   spectroscopy (NIRS). Neuroimage, Apr 15;60(3): 1419-27.

3) Tong Y, Hocke LM, Nickerson LD, Licata SC, Lindsey KP, Frederick BB
   (2013) Evaluating the effects of systemic low frequency oscillations
   measured in the periphery on the independent component analysis
   results of resting state networks. NeuroImage. 2013;76C:202-15. doi:
   10.1016/j.neuroimage.2013.03.019. PubMed PMID: 23523805; PMCID:
   PMC3652630.

4) Hocke LM, Tong Y, Lindsey KP, Frederick BB (2016). Comparison of
   peripheral near-infrared spectroscopy low-frequency oscillations to
   other denoising methods in resting state functional MRI with
   ultrahigh temporal resolution. Magnetic resonance in medicine :
   official journal of the Society of Magnetic Resonance in Medicine /
   Society of Magnetic Resonance in Medicine. 2016.
   \| http://dx.doi.org/10.1002/mrm.26038. PubMed PMID: 26854203.

5) Erdoğan S, Tong Y, Hocke L, Lindsey K, Frederick B (2016). Correcting
   resting state fMRI-BOLD signals for blood arrival time enhances
   functional connectivity analysis. Front. Hum. Neurosci., 28 June 2016
   \| http://dx.doi.org/10.3389/fnhum.2016.00311

6) Tong, Y, Hocke, LM, and Frederick, BB, Low Frequency
   Systemic Hemodynamic \"Noise\" in Resting State BOLD fMRI: Characteristics,
   Causes, Implications, Mitigation Strategies, and Applications.
   Front Neurosci, 2019. 13: p. 787.
   \| http://dx.doi.org/10.3389/fnins.2019.00787

.. |PyPi Latest Version| image:: https://img.shields.io/pypi/v/rapidtide.svg
   :target: https://pypi.python.org/pypi/rapidtide/
.. |PyPi - Python Versions| image:: https://img.shields.io/pypi/pyversions/rapidtide.svg
   :target: https://pypi.python.org/pypi/rapidtide/
.. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
   :target: https://opensource.org/licenses/Apache-2.0
.. |Documentation Status| image:: https://readthedocs.org/projects/rapidtide/badge/?version=stable
   :target: http://rapidtide.readthedocs.io/en/stable/?badge=stable
.. |CircleCI| image:: https://circleci.com/gh/bbfrederick/rapidtide.svg?branch=main&style=shield
   :target: https://circleci.com/gh/bbfrederick/rapidtide
.. |Coverage| image:: https://codecov.io/gh/bbfrederick/rapidtide/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/bbfrederick/rapidtide
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.814990.svg
   :target: https://doi.org/10.5281/zenodo.814990
.. |Funded by NIH| image:: https://img.shields.io/badge/NIH-RF1--MH130637--01-yellowgreen.svg
   :target: https://reporter.nih.gov/project-details/10509534

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bbfrederick/rapidtide",
    "name": "rapidtide",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "fMRI,correlation,RIPTiDe,noise",
    "author": "Blaise Frederick",
    "author_email": "Blaise Frederick <blaise.frederick@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/59/c5/46dd5a54207bf312933dfbe99b655a75d8b4784cd9f0384bdc8f6ff0f61f/rapidtide-2.8.3.tar.gz",
    "platform": null,
    "description": "The rapidtide package\n=====================\n\nRapidtide is a suite of Python programs used to model, characterize, \nvisualize, and remove time varying, physiological blood signals from fMRI and fNIRS \ndatasets.  The primary workhorses of the package are the rapidtide program, \nwhich characterizes bulk blood flow, and happy, which focusses on the cardiac\nband.\n\nFull documentation is at: http://rapidtide.readthedocs.io/en/latest/\n\n|PyPi Latest Version| |PyPi - Python Versions| |License| |Documentation Status| |CircleCI| |Coverage| |DOI| |Funded by NIH|\n\nThe rapidtide program\n---------------------\n\nRapidtide is also the name of the first program in the package, which is\nused to perform rapid time delay\nanalysis on functional imaging data to find time lagged correlations\nbetween the voxelwise time series and other time series, primarily in the LFO\nband.\n\n\nWhy do I want to know about time lagged correlations?\n`````````````````````````````````````````````````````\n\nThis comes out of work by our group (The Opto-Magnetic group at McLean\nHospital - http://www.nirs-fmri.net) looking at the correlations between\nneuroimaging data (fMRI) and NIRS data recorded simultaneously, either\nin the brain or the periphery. We found that a large fraction of the\n\\\"noise\\\" we found at low frequency in fMRI data was due to real,\nrandom[*] fluctuations of blood oxygenation and volume (both of which\naffect the intensity of BOLD fMRI images) in the blood passing through\nthe brain. More interestingly, because these characteristics of blood\nmove with the blood itself, this gives you a way to determine blood\narrival time at any location in the brain. This is interesting in and of\nitself, but also, this gives you a method for optimally modelling (and\nremoving) in band physiological noise from fMRI data (see references\nbelow).\n\nAfter working with this for several years we\\'ve also found that you\ndon\\'t need to used simultaneous NIRS to find this blood borne signal -\nyou can get it from blood rich BOLD voxels for example in the superior\nsagittal sinus, or bootstrap it out of the global mean signal in the\nBOLD data. You can also track exogenously applied waveforms, such as\nhypercarbic and/or hyperoxic gas challenges to really boost your signal\nto noise. So there are lots of times when you might want to do this type\nof correlation analysis.\n\nAs an aside, some of these tools are just generally useful for looking\nat correlations between timecourses from other sources \u2013 for example\ndoing PPI, or even some seed based analyses.\n\n[*] \\\"random\\\" in this context means \\\"determined by something we don\\'t\nhave any information about\\\" - maybe EtCO2 variation, or sympathetic\nnervous system activity - so not really random.\n\nCorrelation analysis is easy - why use this package?\n````````````````````````````````````````````````````\n\nThe simple answer is \\\"correlation analysis is easy, but using a\nprewritten package that handles file I/O, filtering, resampling,\nwindowing, and the rest for you is even easier\\\". A slightly more complex\nanswer is that while correlation analysis is pretty easy to do, it\\'s\nhard to do right; there are lots and lots of ways to do it incorrectly.\nFortunately, I\\'ve made most of those mistakes for you over the last 8\nyears, and corrected my code accordingly. So rather than repeat my\nboring mistakes, why not make new, interesting mistakes? Explore your\nown, unique chunk of wrongspace\u2026\n\n\nHappy\n-----\n\nMore recently, inspired by Henning Voss\\' paper on hypersampling of\ncardiac signals in fMRI, we developed a method to extract and clean\ncardiac waveforms from fMRI data, even when the fMRI TR is far too long\nto properly sample cardiac waveforms. This cardiac waveform can then be\nto track the pulsatile cardiac pressure wave through the brain in\nsomewhat the same way that we track the LFO signals. Among other things,\nthis allows you to get cardiac waveforms during scans even when either\n1) you didn\\'t use a plethysmograph, or 2) you did, but the recording was\nof poor quality, which happens more than you might think.\n\nWhat does \\\"happy\\\" have to do with any of this?\n````````````````````````````````````````````````\n\nAs to why happy is part of rapidtide, that\\'s partially for practical reasons (the\nlibraries in rapidtide have an awful lot of code that is reused in happy), and\npartially thematically - rapidtide has evolved from a \\\"let\\'s look at low\nfrequency signals in fMRI data\\\" package to a \\\"let\\'s look at everything in\nfMRI data EXCEPT neuronal activation\\\", so happy fits right in.\n\n\nWhy are you releasing this package?\n===================================\n\nFor a number of reasons.\n\n-  I want people to use it! I think if it were easier for people to do\n   time delay analysis, they\\'d be more likely to do it. I don\\'t have\n   enough time or people in my group to do every experiment that I think\n   would be interesting, so I\\'m hoping other people will, so I can read\n   their papers and learn interesting things.\n-  It\\'s the right way to do science \u2013 I can say lots of things, but if\n   nobody can replicate my results, nobody will believe it (we\\'ve gotten\n   that a lot, because some of the implications of what we\\'ve seen in\n   resting state data can be a little uncomfortable). We\\'ve reached a\n   stage in fMRI where getting from data to results involves a huge\n   amount of processing, so part of confirming results involves being\n   able to see how the data were processed. If you had to do everything\n   from scratch, you\\'d never even try to confirm anybody\\'s results.\n-  In any complicated processing scheme, it\\'s quite possible (or in my\n   case, likely) to make dumb mistakes, either coding errors or\n   conceptual errors, and I almost certainly have made some (although\n   hopefully the worst ones have been dealt with at this point). More\n   users and more eyes on the code make it more likely that they will be\n   found. As much as I\\'m queasy about somebody potentially finding a\n   mistake in my code, I\\'d rather that they did so, so I can fix it[\u2021].\n-  It\\'s giving back to the community. I benefit from the generosity of a\n   lot of authors who have made the open source tools I use for work and\n   play, so I figure I can pony up too.\n\n[\u2021] or better yet, you, empowered user, can fix it, and push back a fix\nthat benefits everybody\u2026\n\nStability, etc.\n===============\nThis is an evolving code base. I\\'m constantly tinkering with it. That\nsaid, now that I\\'ve sent this off into to the world, I\\'m being somewhat\nmore responsible about locking down stable release points. In between\nreleases, however, I\\'ll be messing with things, although for the most\npart this will be restricted to the dev branch.\n**It\\'s very possible that at any given time the dev branch will be very broken,\nso stay away from it unless you have a good reason to be using it.**\nI\\'ve finally become a little more modern and started\nadding automated testing, so as time goes by hopefully the \\\"in between\\\"\nreleases will be somewhat more reliable.  That said, my tests routinely fail, even\nwhen things actually work.  Probably should deal with that. Check back often for exciting\nnew features and bug fixes!\n\nPython version compatibility\n============================\nI switched over a while ago to using Python 3 as my daily driver, so I know\nthat everything works there. However, I know that a lot of people can\\'t\nor won\\'t switch from Python 2x, so I kept Python 2.7 compatibility for\nquite some time.\n\nThat said, the writing is on the wall, and since I depend on a number of\npackages that have dropped Python 2.x support, as of 2.0, so has rapidtide. However,\nas of version 1.9.0 I\\'m also releasing the code in a docker\ncontainer (fredericklab/rapidtide), which has everything nicely installed in\na fully configured Python 3 environment, so there\\'s really no need for me continue 2.x\nsupport.  So now it's f-strings all the way, kids!\n\nOk, I\\'m sold. What\\'s in here?\n===============================\n\n-  **rapidtide** - This is the heart of the package - this is the\n   workhorse program that will determine the time lagged correlations\n   between all the voxels in a NIFTI file and a temporal \\\"probe\\\"\n   regressor (which can come from a number of places, including the data\n   itself) - it rapidly determines time delays\u2026 There are a truly\n   bewildering array of options, and just about everything can be\n   adjusted, however I\\'ve tried to pick a good set of default options\n   for the most basic processing to get you going. At a minimum, it\n   requires a 4D NIFTI file as input, and a root name for all of the\n   output files. It generates a number of 3D NIFTI file maps of various\n   parameters (lag time of maximum correlation, maximum correlation\n   value, a mask of which voxels have valid fits, etc.) and some text\n   files with useful information (significance thresholds, processing\n   timing information, a list of values of configurable options).\n\n-  **happy** - This is a companion to rapidtide that focusses on cardiac signals.\n   happy does three things - it attempts to determine the cardiac\n   waveform over the time course of an fMRI dataset using slice\n   selective averaging of fully unprocessed fMRI data. It also \n   cleans up this initial estimate using a deep learning filter to\n   infer what the simultaneously recorded plethysmogram would be.\n   Finally, it uses either the derived or a supplied plethysmogram\n   signal to construct a cardiac pulsation map over a single\n   cycle of the cardiac waveform, a la Voss.\n\n-  **showxcorrx** - Like rapidtide, but for single time courses. Takes\n   two text files as input, calculates and displays the time lagged\n   cross correlation between them, fits the maximum time lag, and\n   estimates the significance of the correlation. It has a range of\n   filtering, windowing, and correlation options.\n\n-  **rapidtide2x_legacy**, **happy_legacy**, **showxcorr_legacy** - The\n   older versions of the similarly named programs.  These use the old calling\n   conventions, for compatibility with older workflows.  These will go away\n   eventually, and they don't really get updates or bugfixes, so if you're\n   using them, change to the new ones, and if you're not using them, don't.\n\n-  **rapidtide2std** - This is a utility for registering rapidtide\n   output maps to standard coordinates. It\\'s usually much faster to run\n   rapidtide in native space then transform afterwards to MNI152 space.\n   NB: this will only work if you have a working FSL installation.\n\n-  **happy2std** - Guess.\n\n-  **showtc** - A very simple command line utility that takes timecourses from text\n   files and plots the data in it in a matplotlib window. That\\'s it. A\n   good tool for quickly seeing what\\'s in a file. Has a number of options to\n   make the plot prettier.\n\n-  **showxy** - Another simple command line utility that displays the\n   the data contained in text files containing whitespace separated x-y pairs.\n\n-  **showhist** - Another simple command line utility that displays the\n   histograms generated by rapidtide.\n\n-  **resamp1tc** - takes an input text file at some sample rate and\n   outputs a text file resampled to the specified sample rate.\n\n-  **resamplenifti** - takes an input nifti file at some TR and outputs\n   a nifti file resampled to the specified TR.\n\n-  **tidepool** - This is a GUI tool for displaying all of\n   the various maps and timecourses generated by rapidtide in one place, overlaid on\n   an anatomic image. This makes it a bit easier to see how all the maps\n   are related to one another, how the probe regressor evolves over the run, and the\n   effect of the filtering parameters. To use it, launch tidepool from the\n   command line, and then select a lag time map - tidepool will figure\n   out the root name and pull in all of the other associated data. Works\n   in native or standard space.\n\n\nFinancial Support\n=================\n\nThis code base is being developed and supported by grants from the US\nNIH (`1R01 NS097512 <http://grantome.com/grant/NIH/R01-NS097512-02>`__, RF1 MH130637-01)\n\nAdditional packages used\n========================\n\nRapidtide would not be possible without many additional open source packages.\nThese include:\n\nnumpy:\n------\n\n1) St\u00e9fan van der Walt, S. Chris Colbert and Ga\u00ebl Varoquaux. The NumPy Array:\n   A Structure for Efficient Numerical Computation, Computing in Science\n   & Engineering, 13, 22-30 (2011) \\| https://doi.org/10.1109/MCSE.2011.37\n\nscipy:\n------\n\n1) Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy,\n   David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser,\n   Jonathan Bright, St\u00e9fan J. van der Walt, Matthew Brett, Joshua Wilson,\n   K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones,\n   Robert Kern, Eric Larson, CJ Carey, \u0130lhan Polat, Yu Feng, Eric W. Moore,\n   Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman,\n   Ian Henriksen, E.A. Quintero, Charles R Harris, Anne M. Archibald,\n   Ant\u00f4nio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt,\n   and SciPy 1.0 Contributors. (2020) SciPy 1.0: Fundamental Algorithms for\n   Scientific Computing in Python. Nature Methods, 17, 261\u2013272 (2020) \\|\n   https://doi.org/10.1038/s41592-019-0686-2\n\nmatplotlib:\n-----------\n\n1) John D. Hunter. Matplotlib: A 2D Graphics Environment, Computing in Science\n   & Engineering, 9, 90-95 (2007) \\| https://doi.org/10.1109/MCSE.2007.55\n\nnibabel:\n--------\n\n1) https://github.com/nipy/nibabel \\| https://doi.org/10.5281/zenodo.591597\n\nscikit-learn:\n-------------\n\n1) Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B.,\n   Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V.,\n   Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M.,\n   and Duchesnay, E., Scikit-learn: Machine Learning in Python.\n   Journal of Machine Learning Research, 2011. 12: p. 2825-2830. \\| https://scikit-learn.org\n\npandas:\n-------\n\n1) McKinney, W., pandas: a foundational Python library for data analysis\n   and statistics. Python for High Performance and Scientific Computing, 2011. 14.\n\nnilearn:\n--------\n\n1) https://github.com/nilearn/nilearn\n\n\nReferences\n==========\n\nLinks to PDFs of all papers mentioned here can be found on the OMG\nwebsite: https://www.nirs-fmri.net/home/publications\n\nGeneral overview of systemic low frequency oscillations in fMRI data\n--------------------------------------------------------------------\n\n1) Tong Y, Hocke LM, Frederick BB. (2019) Low Frequency Systemic\n   Hemodynamic \\\"Noise\\\" in Resting State BOLD fMRI: Characteristics,\n   Causes, Implications, Mitigation Strategies, and Applications. Front.\n   Neurosci., 14 August 2019 \\| https://doi.org/10.3389/fnins.2019.00787\n\nMultimodal Cerebral Circulation Imaging\n---------------------------------------\n\n1)  Tong Y, Frederick BD. (2010) Time lag dependent multimodal\n    processing of concurrent fMRI and near-infrared spectroscopy (NIRS)\n    data suggests a global circulatory origin for low-frequency\n    oscillation signals in human brain. Neuroimage, 53(2), 553-64.\n\n2)  Tong Y, Hocke L, Frederick BD. (2011) Isolating the sources of\n    widespread physiological fluctuations in fNIRS signals. J Biomed\n    Opt. 16(10), 106005.\n\n3)  Tong Y, Bergethon PR, Frederick BD. (2011c) An improved method for\n    mapping cerebrovascular reserve using concurrent fMRI and\n    near-infrared spectroscopy with Regressor Interpolation at\n    Progressive Time Delays (RIPTiDe). Neuroimage, 56(4), 2047-2057.\n\n4)  Tong Y, Frederick BD. (2012) Concurrent fNIRS and fMRI processing\n    allows independent visualization of the propagation of pressure\n    waves and bulk blood flow in the cerebral vasculature. Neuroimage,\n    Jul 16;61(4): 1419-27.\n\n5)  Tong Y, Hocke LM, Licata SC, Frederick BD. (2012) Low frequency\n    oscillations measured in the periphery with near infrared\n    spectroscopy (NIRS) are strongly correlated with blood oxygen\n    level-dependent functional magnetic resonance imaging (BOLD fMRI)\n    signals. J Biomed Opt, 2012;17(10):106004. doi:\n    10.1117/1.JBO.17.10.106004. PubMed PMID: 23224003; PMCID: 3461094.\n\n6)  Tong Y, Hocke LM, Frederick BD. (2013) Short repetition time\n    multiband EPI with simultaneous pulse recording allows dynamic\n    imaging of the cardiac pulsation signal. Magn Reson Med\n    2014;72(5):1268-76. Epub Nov 22, 2013. doi: 10.1002/mrm.25041.\n    PubMed PMID: 24272768.\n\n7)  Tong Y, Frederick B. (2014) Studying the Spatial Distribution of\n    Physiological Effects on BOLD Signals using Ultrafast fMRI. Front\n    Hum Neurosci 2014;5(196). doi: doi: 10.3389/fnhum.2014.00196.\n\n8)  Tong Y, Frederick B. (2014) Tracking cerebral blood flow in BOLD\n    fMRI using recursively generated regressors. Hum Brain Mapp.\n    2014;35(11):5471-85. doi: 10.1002/hbm.22564. PubMed PMID: 24954380;\n    PMCID: PMC4206590.\n\n9)  Donahue M, Strother M, Lindsey K, Hocke L, Tong Y, Frederick B.\n    (2015) Time delay processing of hypercapnic fMRI allows quantitative\n    parameterization of cerebrovascular reactivity and blood flow\n    delays. Journal of Cerebral Blood Flow & Metabolism.  2015. PubMed \n    PMID: 26661192. Epub October 19, 2015. doi: 10.1177/0271678X15608643.\n\n10) Hocke L, Cayetano K, Tong Y, Frederick B. (2015) An optimized\n    multimodal fMRI/NIRS probe for ultra-high resolution mapping.\n    Neurophotonics. 2(4), 045004 (Oct-Dec 2015). doi:\n    10.1117/1.NPh.2.4.0450004.\n\n11) Tong Y, Hocke LM, Fan X, Janes AC, Frederick B (2015). Can apparent\n    resting state connectivity arise from systemic fluctuations?\n    Frontiers in human neuroscience. 2015;9. doi:\n    10.3389/fnhum.2015.00285.\n\n12) Tong Y, Lindsey KP, Hocke LM, Vitaliano G, Mintzopoulos D, Frederick\n    B. (2016) Perfusion information extracted from resting state\n    functional magnetic resonance imaging. Journal of cerebral blood\n    flow and metabolism : official journal of the International Society\n    of Cerebral Blood Flow and Metabolism. 2016. doi:\n    10.1177/0271678X16631755. PubMed PMID: 26873885.\n\nCardiac waveform extraction and refinement\n------------------------------------------\n\n1) Aslan S, Hocke L, Schwarz N, Frederick B. (2019) Extraction of the\n   cardiac waveform from simultaneous multislice fMRI data using slice\n   sorted averaging and a deep learning reconstruction filter.\n   NeuroImage 198, 303\u2013316 (2019).\n\nPhysiological noise identification and removal using time delay methods\n-----------------------------------------------------------------------\n\n1) Tong Y, Lindsey KP, Frederick BD. (2011b) Partitioning of\n   physiological noise signals in the brain with concurrent\n   near-infrared spectroscopy (NIRS) and fMRI. J Cereb Blood Flow Metab.\n   31(12), 2352-62.\n\n2) Frederick BD, Nickerson LD, Tong Y. (2012) Physiological denoising of\n   BOLD fMRI data using Regressor Interpolation at Progressive Time\n   Delays (RIPTiDe) processing of concurrent fMRI and near-infrared\n   spectroscopy (NIRS). Neuroimage, Apr 15;60(3): 1419-27.\n\n3) Tong Y, Hocke LM, Nickerson LD, Licata SC, Lindsey KP, Frederick BB\n   (2013) Evaluating the effects of systemic low frequency oscillations\n   measured in the periphery on the independent component analysis\n   results of resting state networks. NeuroImage. 2013;76C:202-15. doi:\n   10.1016/j.neuroimage.2013.03.019. PubMed PMID: 23523805; PMCID:\n   PMC3652630.\n\n4) Hocke LM, Tong Y, Lindsey KP, Frederick BB (2016). Comparison of\n   peripheral near-infrared spectroscopy low-frequency oscillations to\n   other denoising methods in resting state functional MRI with\n   ultrahigh temporal resolution. Magnetic resonance in medicine :\n   official journal of the Society of Magnetic Resonance in Medicine /\n   Society of Magnetic Resonance in Medicine. 2016.\n   \\| http://dx.doi.org/10.1002/mrm.26038. PubMed PMID: 26854203.\n\n5) Erdo\u011fan S, Tong Y, Hocke L, Lindsey K, Frederick B (2016). Correcting\n   resting state fMRI-BOLD signals for blood arrival time enhances\n   functional connectivity analysis. Front. Hum. Neurosci., 28 June 2016\n   \\| http://dx.doi.org/10.3389/fnhum.2016.00311\n\n6) Tong, Y, Hocke, LM, and Frederick, BB, Low Frequency\n   Systemic Hemodynamic \\\"Noise\\\" in Resting State BOLD fMRI: Characteristics,\n   Causes, Implications, Mitigation Strategies, and Applications.\n   Front Neurosci, 2019. 13: p. 787.\n   \\| http://dx.doi.org/10.3389/fnins.2019.00787\n\n.. |PyPi Latest Version| image:: https://img.shields.io/pypi/v/rapidtide.svg\n   :target: https://pypi.python.org/pypi/rapidtide/\n.. |PyPi - Python Versions| image:: https://img.shields.io/pypi/pyversions/rapidtide.svg\n   :target: https://pypi.python.org/pypi/rapidtide/\n.. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n   :target: https://opensource.org/licenses/Apache-2.0\n.. |Documentation Status| image:: https://readthedocs.org/projects/rapidtide/badge/?version=stable\n   :target: http://rapidtide.readthedocs.io/en/stable/?badge=stable\n.. |CircleCI| image:: https://circleci.com/gh/bbfrederick/rapidtide.svg?branch=main&style=shield\n   :target: https://circleci.com/gh/bbfrederick/rapidtide\n.. |Coverage| image:: https://codecov.io/gh/bbfrederick/rapidtide/branch/main/graph/badge.svg\n   :target: https://codecov.io/gh/bbfrederick/rapidtide\n.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.814990.svg\n   :target: https://doi.org/10.5281/zenodo.814990\n.. |Funded by NIH| image:: https://img.shields.io/badge/NIH-RF1--MH130637--01-yellowgreen.svg\n   :target: https://reporter.nih.gov/project-details/10509534\n",
    "bugtrack_url": null,
    "license": "Apache Software License",
    "summary": "Tools for performing correlation analysis on fMRI data.",
    "version": "2.8.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/bbfrederick/rapidtide/issues",
        "Changelog": "https://github.com/bbfrederick/rapidtide/blob/main/CHANGELOG.md",
        "Documentation": "https://rapidtide.readthedocs.io",
        "Homepage": "https://github.com/bbfrederick/rapidtide",
        "Repository": "https://github.com/bbfrederick/rapidtide.git"
    },
    "split_keywords": [
        "fmri",
        "correlation",
        "riptide",
        "noise"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "765fd2cebd53238dd1acc5c629bba392f6e2ccb88f7d3f4d33f210ff93e11c66",
                "md5": "1949a92cd7e05366037762071071187d",
                "sha256": "2ca32d37fde2fa9a42508504545ccbe56f469b879d1481427e3cfbe40f2fb2e6"
            },
            "downloads": -1,
            "filename": "rapidtide-2.8.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1949a92cd7e05366037762071071187d",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 19192186,
            "upload_time": "2024-03-07T18:26:52",
            "upload_time_iso_8601": "2024-03-07T18:26:52.597541Z",
            "url": "https://files.pythonhosted.org/packages/76/5f/d2cebd53238dd1acc5c629bba392f6e2ccb88f7d3f4d33f210ff93e11c66/rapidtide-2.8.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59c546dd5a54207bf312933dfbe99b655a75d8b4784cd9f0384bdc8f6ff0f61f",
                "md5": "c82ce6a146f53a50642825c7919e6bb4",
                "sha256": "b422efcbdd8c2223eba49a482c7a088d5909d6f703ddc0a1f19cc6acfe375640"
            },
            "downloads": -1,
            "filename": "rapidtide-2.8.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c82ce6a146f53a50642825c7919e6bb4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18992974,
            "upload_time": "2024-03-07T18:26:57",
            "upload_time_iso_8601": "2024-03-07T18:26:57.205851Z",
            "url": "https://files.pythonhosted.org/packages/59/c5/46dd5a54207bf312933dfbe99b655a75d8b4784cd9f0384bdc8f6ff0f61f/rapidtide-2.8.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 18:26:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bbfrederick",
    "github_project": "rapidtide",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "rapidtide"
}
        
Elapsed time: 0.21075s