pyhrf.rfir.
RFIREstim
(hrf_nb_coeffs=42, hrf_dt=0.6, drift_type='cosine', stop_crit1=0.0001, stop_crit2=1e-05, nb_its_max=5, nb_iterations=500, nb_its_min=1, average_bold=False, taum=0.01, lambda_reg=100.0, fixed_taum=False, discarded_scan_indexes=None, output_fit=False)¶Bases: pyhrf.xmlio.Initable
Class handling the estimation of HRFs from fMRI data. Analysis is voxel-wise and can be multissession (heteroscedastic noise and session dependent drift). Simultaneous analysis of several conditions is treated. One HRF is considered at each voxel.
Compute_INV_R_and_R_and_DET_R
()¶Both computes self.InvR and self.DetR
Requires:
Compute_onset_matrix3
()¶Computes the onset matrix. Each stimulus onset is considered over a period of LengthOnsets seconds if (LengthOnsets > DetlaT) and a time step otherwise.
Requires:
where self.X[i][m,n,k] is such that:
CptFctQ
(CptType)¶Computes the function at a given iteration
Notes
It requires:
CptSigma
()¶Computes the Sigma at a given iteration.
self.Sigma[m*SBS:(m+1)*SBS,n*SBS:(n+1)*SBS]] -> (m,n)^th block of Sigma in session i.
EM_solver
(POI)¶requires: * everything in the class is supposed initialized
InitMatrixAndVectors
(POI)¶Initialize to zeros: X, y, P, l, h, InvR, Sigma. Initialize to ones: TauM, rb (<-scalar).
InitStorageMat
()¶Initialization of the matrices that will store all voxel results.
Notes
Input signals must have been read (in ReadRealSignal)
ReadPointOfInterestData
(POI)¶Initialize the parameters for a voxel analysis. The voxel ID is ‘POI’ in ‘ConsideredCoord’ initialized in ‘ReadRealSignal’
Notes
Input signals must have been read (in ReadRealSignal)
StoreRes
(POI)¶Store results computed in the voxel defined in POI.
Notes
The estimation at this voxel must have been performed
buildCosMat
(fctNb, tr, ny)¶Build a cosine low frequency basis in P (adapted from samplerbase.py)
Parameters: |
|
---|
buildLowFreqMat
()¶Build the low frequency basis matrix P.
buildPolyMat
(fctNb, tr, ny)¶Build a polynomial low frequency basis in P (adapted from samplerbase.py)
Parameters: |
|
---|
Notes
clean_memory
()¶Clean all objects that are useless for outputs
compute_fit
(POI)¶cpt_XSigmaX
(tempTerm2i, SBS, i)¶default_nb_its
= 500¶default_stop_crit1
= 0.0001¶default_stop_crit2
= 1e-05¶getOutputs
()¶linkToData
(data)¶parametersComments
= {'drift_type': 'Basis type in the drift model. Either "cosine" or "poly"', 'hrf_dt': 'Required HRF temporal resolution', 'hrf_nb_coeffs': 'Number of values in the discrete HRF. Discretization is homogeneous HRF time length is then: nb_hrf_coeffs * hrf_dt '}¶parametersToShow
= ['hrf_nb_coeffs', 'hrf_dt', 'drift_type', 'nb_iterations']¶run
()¶function to launch the analysis
pyhrf.rfir.
init_dict
()¶pyhrf.rfir.
rfir
(func_data, fir_duration=42, fir_dt=0.6, nb_its_max=100, nb_its_min=5, fixed_taum=False, lambda_reg=100.0)¶Fit a Regularized FIR on functional data func_data:
Reference: “Unsupervised robust non-parametric estimation of the hemodynamic response function for any fMRI experiment.” Ciuciu, J.-B. Poline, G. Marrelec, J. Idier, Ch. Pallier, and H. Benali. IEEE Trans. Med. Imag., 22(10):1235-1251, Oct. 2003.
Parameters: |
|
---|---|
Returns: | |
Return type: | dict of xndarray instances |