API
rapidtide.workflows
: Rapidtide workflows
Common rapidtide workflows.
rapidtide.correlate
: Correlation functions
Functions for calculating correlations and similar metrics between arrays.
Check for autocorrelation in an array. |
|
|
Calculate short-term sliding-window correlation between two 1D arrays. |
|
Calculate short-term sliding-window correlation between two 2D arrays. |
|
Calculate mutual information between two arrays. |
|
Compute (normalized) mutual information between two 1D variate from a joint histogram. |
Calculate cross-mutual information between two 1D arrays. |
|
Convert mutual information to Pearson product-moment correlation. |
|
|
Calculate correlation between two 1D arrays, at specific delay. |
|
Estimate delay between two signals using Choudhary's cepstral analysis method. |
|
Calculate something. |
|
Perform correlation between short-time Fourier transformed arrays. |
|
Perform a fast correlation between two arrays. |
|
Return the center newsize portion of the array. |
Check that two shapes are 'valid' with respect to one another. |
|
Convolve two N-dimensional arrays using FFT. |
|
|
Calculate product for generalized crosscorrelation. |
rapidtide.filter
: Filters
This module contains all the filtering operations for the rapidtide package.
|
Returns a padded copy of the input data; padlen points of reflected data are prepended and appended to the input data to reduce end effects when the data is then filtered. |
|
Returns a input data with the end pads removed (see padvec); padlen points of reflected data are removed from each end of the array. |
|
Applies an isotropic gaussian spatial filter to a 3D array |
|
Performs a bidirectional (zero phase) Butterworth lowpass filter on an input vector and returns the result. |
|
Performs a bidirectional (zero phase) Butterworth highpass filter on an input vector and returns the result. |
|
Performs a bidirectional (zero phase) Butterworth bandpass filter on an input vector and returns the result. |
|
Filters input data using a previously calculated transfer function. |
|
Generates a brickwall lowpass transfer function. |
|
Performs an FFT brickwall lowpass filter on an input vector and returns the result. |
|
Performs an FFT brickwall highpass filter on an input vector and returns the result. |
|
Performs an FFT brickwall bandpass filter on an input vector and returns the result. |
|
Generates a trapezoidal lowpass transfer function. |
|
Performs an FFT filter with a trapezoidal lowpass transfer function on an input vector and returns the result. |
|
Performs an FFT filter with a trapezoidal highpass transfer function on an input vector and returns the result. |
|
Performs an FFT filter with a trapezoidal bandpass transfer function on an input vector and returns the result. |
lambd is the SNR in the fourier domain |
|
|
Calculate the power spectrum of an input signal |
|
Performs an FFT of the input data, and returns the frequency axis and spectrum of the input signal. |
|
Cross spectral density filter - makes a filter transfer function that preserves common frequencies. |
|
Filters an input waveform over a specified range. |
|
Returns a Blackman Harris window function of the specified length. |
|
Returns a Hann window function of the specified length. |
|
Returns a Hamming window function of the specified length. |
|
Returns a window function of the specified length and type. |
Methods |
rapidtide.fit
: Fitting functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Converted from/based on a MATLAB script at: http://billauer.co.il/peakdet.html |
rapidtide.io
: Input/output functions
|
Open a nifti file and read in the various important parts |
|
Open a cifti file and read in the various important parts |
|
|
|
Split the dims array into individual elements |
|
Split the size array into individual elements |
|
Save a data array out to a nifti file |
|
Save a data array out to a cifti |
|
Check to see if a file name is a valid nifti name. |
|
Split nifti filename into name base and extensionn. |
|
|
|
|
|
|
|
Check to see if the specified file is CIFTI format |
|
Check to see if the specified filename ends in '.txt' |
|
Strip a nifti filename down to the root with no extensions |
|
Retrieve the header information from a nifti file |
|
Retrieve the repetition time and number of timepoints from a nifti file |
|
Check the headers of two nifti files to determine if the cover the same volume at the same resolution (within tolerance) |
|
Check the spatial pixdims of two nifti files to determine if they have the same resolution (within tolerance) |
|
Check the dimension arrays of two nifti files to determine if the cover the same number of voxels in each dimension |
|
Check the dimensions of two nifti files to determine if the cover the same number of timepoints |
|
Checks to see if a file is an FSL style motion parameter file |
|
Checks to see if a file is an FSL style motion parameter file |
|
Reads motion regressors from filename (from the columns specified in colspec, if given) |
|
Calculates various motion related timecourses from motion data dict, and returns an array |
|
|
|
|
|
Read key value pairs out of a BIDS sidecar file |
|
Write key value pairs to a json file |
|
Read key value pairs out of a json file |
|
Read time series out of an fmriprep confounds tsv file |
|
|
|
NB: to be strictly valid, a continuous BIDS tsv file (i.e. |
|
Read one or more time series from some sort of text file |
|
Read time series out of a BIDS tsv file |
|
|
|
|
|
|
|
|
|
|
|
|
|
Read an array of floats in from a text file. |
|
|
|
|
|
Write all the key value pairs from a dictionary to a text file. |
|
Read key value pairs out of a text file |
|
Write a vector out to a text file. |
|
Write out a two dimensional numpy array to a text file |
rapidtide.miscmath
: Miscellaneous math functions
Return phase of complex numbers. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rapidtide.resample
: Resampling functions
|
Perform a convolution gridding operation with a Kaiser-Bessel or Gaussian kernel of width 'width'. |
|
Resample data from one spacing to another. |
|
|
|
|
|
|
|
|
|
Methods |
rapidtide.stats
: Statistical functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rapidtide.util
: Utility functions
|
Log memory usage with a logging object. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|