Fork me on GitHub

pyhrf.ui.vb_jde_analyser module

class pyhrf.ui.vb_jde_analyser.JDEVEMAnalyser(hrfDuration=25.0, sigmaH=0.1, fast=True, computeContrast=True, nbClasses=2, PLOT=False, nItMax=100, nItMin=1, scale=False, beta=1.0, estimateSigmaH=True, estimateHRF=True, TrueHrfFlag=False, HrfFilename='hrf.nii', estimateDrifts=True, hyper_prior_sigma_H=1000, dt=0.6, estimateBeta=True, contrasts=None, simulation=False, estimateLabels=True, LabelsFilename=None, MFapprox=False, estimateMixtParam=True, constrained=False, InitVar=0.5, InitMean=2.0, MiniVemFlag=False, NbItMiniVem=5, zero_constraint=True, output_drifts=False, drifts_type='poly')

Bases: pyhrf.ui.jde.JDEAnalyser

Class that handles parcel-wise which is done according to the input data parcellation by default, and also takes care of merging parcel-specific outputs at the end of the JDE VEM analysis.

Parameters:
  • hrfDuration (float) – duration of the HRF in seconds.
  • sigmaH (float) – initial HRF variance.
  • fast (bool) – running fast VEM with C extensions.
  • computeContrast (bool) – compute the contrasts defined in contrasts input.
  • nbClasses (int) – number of classes for the response levels.
  • PLOT (bool) – plotting flag for convergence curves.
  • nItMax (int) – maximum number of iterations.
  • nItMin (int) – minimum number of iterations.
  • scale (bool) – divide the data fidelity term during m_h step by the number of voxels.
  • beta (float) – initial value of spatial Potts regularization parameter.
  • estimateSigmaH (bool) – estimate or not the HRF variance.
  • estimateHRF (bool) – estimate or not the HRF.
  • TrueHrfFlag (bool) – if true, HRF will be fixed to the simulated value.
  • HrfFilename (str) – filename of the output HRF.
  • estimateDrifts (bool) – if true drifts are estimated, otherwise drifts are marginalized.
  • hyper_prior_sigma_H (int) – hyper-prior on sigma_H. If zero, no prior is applied.
  • dt (float) – time resolution of the estimated HRF (in seconds).
  • estimateBeta (bool) – estimate or not the Potts spatial regularization parameter.
  • contrasts (OrderedDict) – contrasts to be evaluated.
  • simulation (bool) – indicates whether the run corresponds to a simulation example or not.
  • estimateLabels (bool) – estimate or not the labels.
  • LabelsFilename (str) – filename containing the labels.
  • MFapprox (bool) – using the Mean Field approximation in labels estimation.
  • estimateMixtParam (bool) – estimate or not the mixture parameters.
  • constrained (bool) – if true, the following constraints are added: positivity and norm = 1.
  • InitVar (float) – initial value of active and inactive gaussian variances.
  • InitMean (float) – initial value of active gaussian means.
  • MiniVemFlag (bool) – estimate or not the best initialization of MixtParam and gamma_h.
  • NbItMiniVem (int) – number of iterations in Mini VEM algorithm.
  • zero_constraint (bool) – if true, add zeros at the beginning and the end of the HRF.
  • output_drifts (bool) – save the estimated drifts.
  • drifts_type (str) – type of the drift basis (‘poly’ or ‘cos’).
analyse_roi(roiData)

ROI analysis of the fMRI data.

Parameters:roiData (FmriData) – fMRI data to be analyzed.
Returns:packed outputs.
Return type:dict of xndarray
parametersComments = {'HrfFilename': 'HRF filename', 'InitMean': 'initial value of active gaussian means', 'InitVar': 'initial value of active and inactive gaussian variances', 'LabelsFilename': 'labels filename', 'MFapprox': 'using of the Mean Field approximation in labels estimation', 'MiniVemFlag': 'if true, estimate the best initialisation of MixtParam and gamma_h', 'NbItMiniVem': 'number of iterations in Mini VEM algorithm', 'PLOT': 'plotting flag for convergence curves', 'TrueHrfFlag': 'if true, HRF will be fixed to the simulated value', 'beta': 'initial value of spatial Potts regularization parameter', 'constrained': 'adding constrains: positivity and norm = 1 ', 'contrasts': 'contrasts to be evaluated', 'drifts_type': 'type of the drift basis (default="polynomial")', 'dt': 'time resolution of the estimated HRF (in seconds)', 'estimateBeta': 'estimate or not the Potts spatial regularization parameter', 'estimateDrifts': 'explicit drift estimation (if false, drifts are marginalized', 'estimateHRF': 'estimate or not the HRF', 'estimateLabels': 'estimate or not the labels', 'estimateMixtParam': 'estimate or not the mixture parameters', 'estimateSigmaH': 'estimate or not the HRF variance', 'fast': 'running fast VEM with C extensions', 'hrfDuration': 'duration of the HRF (in seconds)', 'hyper_prior_sigma_H': 'parameter of the hyper-prior on sigma_H (if zero, no prior is applied)', 'nItMax': 'maximum number of iterations', 'nItMin': 'minimum number of iterations', 'nbClasses': 'number of classes for the response levels', 'scale': 'if true, the data fidelity term is divide by the number of voxels, otherwise it does nothing', 'sigmaH': 'initial HRF variance', 'simulation': 'indicates whether the run corresponds to a simulation example or not'}
parametersToShow = ['dt', 'hrfDuration', 'nItMax', 'nItMin', 'estimateSigmaH', 'estimateHRF', 'TrueHrfFlag', 'HrfFilename', 'estimateBeta', 'estimateLabels', 'LabelsFilename', 'MFapprox', 'estimateDrifts', 'estimateMixtParam', 'InitVar', 'InitMean', 'scale', 'nbClasses', 'fast', 'PLOT', 'sigmaH', 'contrasts', 'hyper_prior_sigma_H', 'constrained', 'simulation', 'MiniVemFlag', 'NbItMiniVem']
pyhrf.ui.vb_jde_analyser.change_dim(labels)

Change labels dimension from (ncond, nclass, nvox) to (nclass, ncond, nvox).

pyhrf.ui.vb_jde_analyser.run_analysis(**params)

Function to run the JDE VEM analyzer with parallel computation