Decomposition

class nidmd.Decomposition(data=None, filenames=None, sampling_time=None)[source]

Representation of a Decomposition.

Constructor

Decomposition.__init__(data=None, filenames=None, sampling_time=None)[source]

Decomposition Constructor.

Parameters
  • data (Array-like) – Preprocessed time-series fMRI data. Can be list of Array-like

  • filenames (str) – filenames of .mat files containing data. Can be list of str.

  • sampling_time (float, optional) – Sampling time of time-series recording.

Yields
  • data (Array-like) – Time-series raw data

  • X (Array-like) – Time-series data from t:1->T

  • Y (Array-like) – Time-series data from t:0->T-1

  • atlas (nidmd.Atlas) – Cortical Parcellation atlas used for this decomposition

  • eig_val (Array-like) – Eigenvalues of the eigen-decomposition of the Auto-regressive matrix

  • eig_vec (Array-like) – Eigenvectors of the eigen-decomposition of the Auto-regressive matrix

  • eig_idx (Array-like) – Indices for descending order of the eigen-decomposition of the Auto-regressive matrix

  • A (Array-like) – Auto-regressive matrix

  • Z (Array-like) – Approximation of the activity versus time for each mode

  • df (pd.DataFrame) – Pandas DataFrame containing the following columns: mode, value, intensity, damping_time, period, conjugate, strength_real, strength_imag, activity

Methods

Decomposition.run()

Run Decomposition.

Decomposition.add(data)

Add data to Decomposition.

Decomposition.extract(filename)

Extracts fMRI data from file.

Decomposition.split(data[, normalize])

Split time-series into X: [1->T] and Y:[0->T-1].

Decomposition.normalize(data[, direction, …])

Normalize a matrix

Decomposition.compute_match(other, m)

Get approximated matched modes for match group with self as a reference.

Decomposition.get_decomposition(x, y)

Get dynamic modes by Least Squares optimization of Auto-regressive model.

Decomposition.dmd([normalize])

Returns a dictionary-like object containing Dynamic Mode Decomposition elements.

Decomposition._compute(val, vec, index, time)

Compute Decomposition to fetch DataFrame with all relevant info.

API reference

class nidmd.Decomposition(data=None, filenames=None, sampling_time=None)[source]

Representation of a Decomposition.

add(data)[source]

Add data to Decomposition.

Parameters

data (Array-like) – Time-series data.

Yields

atlas (nidmd.Atlas) – Cortical Parcellation atlas used for this decomposition

Raises

ImportError – If the import fails.

compute_match(other, m)[source]

Get approximated matched modes for match group with self as a reference. Predicts amplification of approximated modes using linear regression.

Parameters
  • other (nidmd.Decomposition) – match group

  • m (int) – number of modes analyzed for approximation

Returns

  • modes (pd.DataFrame) – Pandas DataFrame containing the following columns: mode, value, damping_time, period, conjudate

  • x (Array-like) – Vector containing absolute value of top 10 approximated eigenvalues of self (by mode matching to self)

  • y (Array-like) – Vector containing absolute value of top 10 real eigenvalues of self

run()[source]

Run Decomposition.

Returns

df – Pandas DataFrame containing the following columns: mode, value, intensity, damping_time, period, conjugate, strength_real, strength_imag, activity

Return type

pd.DataFrame