hemolearn.BDA

class hemolearn.BDA(n_atoms, t_r, n_times_atom=60, hrf_model='scaled_hrf', hrf_atlas='aal3', atlas_kwargs={}, n_scales='scale122', prox_z='tv', lbda_strategy='ratio', lbda=0.1, rho=2.0, delta_init=1.0, u_init_type='ica', eta=10.0, z_init=None, prox_u='l1-positive-simplex', deactivate_v_learning=False, shared_spatial_maps=False, deactivate_z_learning=False, idx_first_vols=0, standardize=False, detrend=False, low_pass=None, high_pass=None, max_iter=100, random_state=None, early_stopping=True, eps=1e-05, raise_on_increase=True, cache_dir='__cache__', nb_fit_try=1, n_jobs=1, verbose=0)

Blind Deconvolution Analysis (BDA) is a algorithm to distangle the neural activation and the haemodynamic contributions in the fMRI data (BOLD signal).

Parameters
n_atomsint, number of components on which to decompose the neural

activity (number of temporal components and its associated spatial maps).

t_rfloat, Time of Repetition, fMRI acquisition parameter, the temporal

resolution

n_times_atomint, (default=30), number of points on which represent the

Haemodynamic Response Function (HRF), this leads to the duration of the response function, duration = n_times_atom * t_r

shared_spatial_mapsbool, whether or not to learn a single set of

spatials maps accross subjects.

hrf_modelstr, (default=’3_basis_hrf’), type of HRF model, possible

choice are [‘3_basis_hrf’, ‘2_basis_hrf’, ‘scaled_hrf’]

hrf_atlasstr, func, or None, (default=’aal3’), atlas type, possible

choice are [‘aal’, ‘aal3’, ‘harvard’, ‘basc’, given-function]. None default option will lead to fetch the Harvard-Oxford parcellation.

atlas_kwargsdict, (default=dict()), additional kwargs for the atlas,

if a function is passed.

n_scalesstr, (default=’scale122’), select the number of scale if

hrf_atlas == ‘basc’.

deactivate_v_learningbool, (default=False), option to force the

estimated HRF to its initial value.

deactivate_z_learningbool, (default=False), option to force the

estimated z to its initial value.

prox_zstr, (default=’tv’), temporal proximal operator should be in

[‘tv’, ‘l1’, ‘l2’, ‘elastic-net’]

lbda_strategy str, (default=’ratio’), strategy to fix the temporal

regularization parameter, possible choice are [‘ratio’, ‘fixed’]

lbdafloat, (default=0.1), whether the temporal regularization parameter

if lbda_strategy == ‘fixed’ or the ratio w.r.t lambda max if lbda_strategy == ‘ratio’

rhofloat, (default=2.0), the elastic-net temporal regularization

parameter

delta_initfloat, (default=1.0), the initialization value for the HRF

dilation parameter

u_init_typestr, (default=’ica’), strategy to init u, possible value are

[‘gaussian_noise’, ‘ica’, ‘patch’]

z_initNone or array, (default=None), initialization of z, if None, z is

initialized to zero

prox_ustr, (default=’l2-positive-ball’), constraint to impose on the

spatial maps possible choice are [‘l2-positive-ball’, ‘l1-positive-simplex’, ‘positive’]

standardizebool, (default=False), if standardize is True, the

time-series are centered and normed: their mean is put to 0 and their variance to 1 in the time dimension.

detrendbool, (defaul==False), whether or not to detrend the BOLD signal
low_passfloat or None, (defaul==None), the limit low freq pass band to

clean the BOLD signal

high_passfloat or None, (default=None), the limit high freq pass band to

clean the BOLD signal

max_iterint, (default=100), maximum number of iterations to perform the

analysis

random_stateNone, int, random-instance, (default=None), random-instance

or random-seed used to initialize the analysis

early_stoppingbool, (default=True), whether to early stop the analysis
epsfloat, (default=1.0e-4), stoppping parameter w.r.t evolution of the

cost-function

raise_on_increasebool, (default=True), whether to stop the analysis if

the cost-function increases during an iteration. This can be due to the fact that the temporal regularization parameter is set to high

cache_dirstr or None, (default=’.cache’), the directory name to

cache the analysis, if None the decomposition is not cached, if a string is given or let to default, caching is done

nb_fit_tryint, (default=1), number of analysis to do with different

initialization

n_jobsint, (default=1), the number of CPUs to use if multiple analysis

with different initialization is done

verboseint, (default=0), verbose level, 0 no verbose, 1 low verbose,

2 maximum verbose

__init__(n_atoms, t_r, n_times_atom=60, hrf_model='scaled_hrf', hrf_atlas='aal3', atlas_kwargs={}, n_scales='scale122', prox_z='tv', lbda_strategy='ratio', lbda=0.1, rho=2.0, delta_init=1.0, u_init_type='ica', eta=10.0, z_init=None, prox_u='l1-positive-simplex', deactivate_v_learning=False, shared_spatial_maps=False, deactivate_z_learning=False, idx_first_vols=0, standardize=False, detrend=False, low_pass=None, high_pass=None, max_iter=100, random_state=None, early_stopping=True, eps=1e-05, raise_on_increase=True, cache_dir='__cache__', nb_fit_try=1, n_jobs=1, verbose=0)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(n_atoms, t_r[, n_times_atom, …])

Initialize self.

fit(X_fnames[, confound_fnames])

Perform the Blind Deconvolution Analysis (BDA) by fitting the model.

fit_transform(X_fnames[, confound_fnames])

Perform the Blind Deconvolution Analysis (BDA) by fitting the model and return the estimated vascular maps.

transform(X_fnames[, confound_fnames])

Return the vascular maps estimated from the Blind Deconvolution Analysis (BDA).

Attributes

Dz_hat

a_hat

a_hat_img

lobj

ltime

u_hat

u_hat_img

v_hat

v_init

z_hat