Exemplo n.º 1
0
    def __init__(self, hrfDuration=25., 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=.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"):

        XmlInitable.__init__(self)
        JDEAnalyser.__init__(self, outputPrefix='jde_vem_')


        # Important thing : all parameters must have default values
        self.dt = dt
        #self.driftType = driftType
        self.hrfDuration = hrfDuration
        self.nbClasses = nbClasses
        self.nItMax = nItMax
        self.estimateSigmaH = estimateSigmaH
        self.scale = scale
        self.estimateDrifts = estimateDrifts
        self.PLOT = PLOT
        self.fast = fast
        self.simulation = simulation
        self.beta = beta
        self.sigmaH = sigmaH
        self.estimateHRF = estimateHRF
        self.TrueHrfFlag = TrueHrfFlag
        self.HrfFilename = HrfFilename
        self.nItMin = nItMin
        self.estimateBeta = estimateBeta
        self.estimateMixtParam = estimateMixtParam
        self.estimateLabels = estimateLabels
        self.LabelsFilename = LabelsFilename
        self.MFapprox = MFapprox
        self.InitVar = InitVar
        self.InitMean = InitMean
        self.MiniVemFlag = MiniVemFlag
        self.NbItMiniVem = NbItMiniVem
        if contrasts is None:
            contrasts = OrderedDict()
        self.contrasts = contrasts
        self.computeContrast = computeContrast
        self.hyper_prior_sigma_H = hyper_prior_sigma_H
        self.constrained = constrained
        self.zero_constraint = zero_constraint
        self.output_drifts = output_drifts
        self.drifts_type = drifts_type


        logger.info("VEM analyzer:")
        logger.info(" - estimate sigma H: %s", str(self.estimateSigmaH))
        logger.info(" - init sigma H: %f", self.sigmaH)
        logger.info(" - hyper_prior_sigma_H: %f", self.hyper_prior_sigma_H)
        logger.info(" - estimate drift: %s", str(self.estimateDrifts))
Exemplo n.º 2
0
    def __init__(self, onsets=DEFAULT_ONSETS,
                 durations=DEFAULT_STIM_DURATIONS,
                 simulation_file=DEFAULT_SIMULATION_FILE):

        XmlInitable.__init__(self)
        assert isinstance(onsets, dict)
        assert durations is None or isinstance(durations, dict)

        self.onsets = onsets
        self.durations = durations
        self.simulation_file = simulation_file
Exemplo n.º 3
0
    def __init__(self, onsets=DEFAULT_ONSETS,
                 durations=DEFAULT_STIM_DURATIONS,
                 bold_file=DEFAULT_BOLD_SURF_FILE):

        XmlInitable.__init__(self)
        assert isinstance(onsets, dict)
        assert durations is None or isinstance(durations, dict)

        self.onsets = onsets
        self.durations = durations
        self.bold_file = bold_file
Exemplo n.º 4
0
    def __init__(self,
                 onsets=DEFAULT_ONSETS,
                 durations=DEFAULT_STIM_DURATIONS,
                 simulation_file=DEFAULT_SIMULATION_FILE):

        XmlInitable.__init__(self)
        assert isinstance(onsets, dict)
        assert durations is None or isinstance(durations, dict)

        self.onsets = onsets
        self.durations = durations
        self.simulation_file = simulation_file
Exemplo n.º 5
0
    def __init__(self,
                 onsets=DEFAULT_ONSETS,
                 durations=DEFAULT_STIM_DURATIONS,
                 bold_file=DEFAULT_BOLD_SURF_FILE):

        XmlInitable.__init__(self)
        assert isinstance(onsets, dict)
        assert durations is None or isinstance(durations, dict)

        self.onsets = onsets
        self.durations = durations
        self.bold_file = bold_file
Exemplo n.º 6
0
    def __init__(self, onsets=DEFAULT_ONSETS,
                 durations=DEFAULT_STIM_DURATIONS,
                 bold_file=DEFAULT_BOLD_VOL_FILE):

        XmlInitable.__init__(self)
        assert isinstance(onsets, (dict, OrderedDict))
        assert durations is None or isinstance(durations, (dict, OrderedDict))
        #assert bold_file.endswith('nii') or bold_file.endswith('nii.gz')

        self.onsets = onsets
        self.durations = durations
        self.bold_file = bold_file
Exemplo n.º 7
0
    def __init__(self, sampler=BOLDGibbsSampler(), osfMax=4, dtMin=.4,
                 dt=.6, driftParam=4, driftType='polynomial',
                 outputPrefix='jde_mcmc_', randomSeed=None, pass_error=True,
                 copy_sampler=True):

        XmlInitable.__init__(self)
        JDEAnalyser.__init__(self, outputPrefix, pass_error=pass_error)

        self.sampler = sampler
        self.osfMax = osfMax
        self.dtMin = dtMin
        self.dt = dt
        self.driftLfdParam = driftParam
        self.driftLfdType = driftType
        self.copy_sampler = copy_sampler
Exemplo n.º 8
0
    def __init__(self, sampler=BOLDGibbsSampler(), osfMax=4, dtMin=.4,
                 dt=.6, driftParam=4, driftType='polynomial',
                 outputPrefix='jde_mcmc_', randomSeed=None, pass_error=True,
                 copy_sampler=True):

        XmlInitable.__init__(self)
        JDEAnalyser.__init__(self, outputPrefix, pass_error=pass_error)

        self.sampler = sampler
        self.osfMax = osfMax
        self.dtMin = dtMin
        self.dt = dt
        self.driftLfdParam = driftParam
        self.driftLfdType = driftType
        self.copy_sampler = copy_sampler
    def __init__(self,
                 hrfDuration=25.,
                 dt=.5,
                 fast=True,
                 constrained=False,
                 nbClasses=2,
                 PLOT=False,
                 nItMax=1,
                 nItMin=1,
                 scale=False,
                 beta=1.0,
                 simulation=None,
                 fmri_data=None,
                 computeContrast=True,
                 estimateH=True,
                 estimateG=True,
                 use_hyperprior=False,
                 estimateSigmaH=True,
                 estimateSigmaG=True,
                 positivity=False,
                 sigmaH=0.0001,
                 sigmaG=0.0001,
                 sigmaMu=0.0001,
                 physio=True,
                 gammaH=1000,
                 gammaG=1000,
                 zero_constrained=False,
                 estimateLabels=True,
                 estimateMixtParam=True,
                 contrasts=None,
                 InitVar=0.5,
                 InitMean=2.0,
                 estimateA=True,
                 estimateC=True,
                 estimateBeta=True,
                 estimateNoise=True,
                 estimateLA=True,
                 phy_params=PHY_PARAMS_KHALIDOV11,
                 prior='no',
                 n_session=1):

        XmlInitable.__init__(self)
        JDEAnalyser.__init__(self, outputPrefix='jde_vem_asl_')

        # Important thing : all parameters must have default values
        self.hrfDuration = hrfDuration
        self.dt = dt
        self.fast = fast
        self.constrained = constrained
        self.nbClasses = nbClasses
        self.PLOT = PLOT
        self.nItMax = nItMax
        self.nItMin = nItMin
        self.scale = scale
        self.beta = beta
        self.simulation = simulation
        self.fmri_data = fmri_data
        self.estimateH = estimateH
        self.estimateG = estimateG
        self.estimateSigmaH = estimateSigmaH
        self.estimateSigmaG = estimateSigmaG
        self.sigmaH = sigmaH
        self.sigmaG = sigmaG
        self.sigmaMu = sigmaMu
        self.gammaH = gammaH
        self.gammaG = gammaG
        self.estimateLabels = estimateLabels
        self.estimateMixtParam = estimateMixtParam
        self.InitVar = InitVar
        self.InitMean = InitMean
        self.estimateA = estimateA
        self.estimateC = estimateC
        self.estimateBeta = estimateBeta
        self.estimateNoise = estimateNoise
        self.estimateLA = estimateLA
        self.use_hyperprior = use_hyperprior
        self.positivity = positivity
        self.physio = physio
        self.prior = prior
        if contrasts is None:
            contrasts = OrderedDict()
        self.contrasts = contrasts
        self.computeContrast = computeContrast
        self.phy_params = phy_params
        self.n_session = n_session
        self.zc = zero_constrained

        logger.info("VEM analyzer:")
        logger.info(" - estimate sigma H: %s", str(self.estimateSigmaH))
        logger.info(" - init sigma H: %f", self.sigmaH)
        logger.info(" - estimate drift and perfusion baseline: %s",
                    str(self.estimateLA))
Exemplo n.º 10
0
 def __init__(self, p=1, c='a'):
     XmlInitable.__init__(self)
     self.param1 = p
     self.param2 = c
Exemplo n.º 11
0
    def __init__(self, hrfDuration=25., dt=.5, fast=True, constrained=False,
                 nbClasses=2, PLOT=False, nItMax=1, nItMin=1, scale=False,
                 beta=1.0, simulation=None, fmri_data=None, computeContrast=True,
                 estimateH=True, estimateG=True, use_hyperprior=False,
                 estimateSigmaH=True, estimateSigmaG=True, positivity=False,
                 sigmaH=0.0001, sigmaG=0.0001, sigmaMu=0.0001, physio=True,
                 gammaH=1000, gammaG=1000, zero_constrained=False,
                 estimateLabels=True, estimateMixtParam=True, contrasts=None,
                 InitVar=0.5, InitMean=2.0, estimateA=True, estimateC=True,
                 estimateBeta=True, estimateNoise=True, estimateLA=True,
                 phy_params=PHY_PARAMS_KHALIDOV11, prior='no', n_session=1):

        XmlInitable.__init__(self)
        JDEAnalyser.__init__(self, outputPrefix='jde_vem_asl_')

        # Important thing : all parameters must have default values
        self.hrfDuration = hrfDuration
        self.dt = dt
        self.fast = fast
        self.constrained = constrained
        self.nbClasses = nbClasses
        self.PLOT = PLOT
        self.nItMax = nItMax
        self.nItMin = nItMin
        self.scale = scale
        self.beta = beta
        self.simulation = simulation
        self.fmri_data = fmri_data
        self.estimateH = estimateH
        self.estimateG = estimateG
        self.estimateSigmaH = estimateSigmaH
        self.estimateSigmaG = estimateSigmaG
        self.sigmaH = sigmaH
        self.sigmaG = sigmaG
        self.sigmaMu = sigmaMu
        self.gammaH = gammaH
        self.gammaG = gammaG
        self.estimateLabels = estimateLabels
        self.estimateMixtParam = estimateMixtParam
        self.InitVar = InitVar
        self.InitMean = InitMean
        self.estimateA = estimateA
        self.estimateC = estimateC
        self.estimateBeta = estimateBeta
        self.estimateNoise = estimateNoise
        self.estimateLA = estimateLA
        self.use_hyperprior = use_hyperprior
        self.positivity = positivity
        self.physio = physio
        self.prior = prior
        if contrasts is None:
            contrasts = OrderedDict()
        self.contrasts = contrasts
        self.computeContrast = computeContrast
        self.phy_params = phy_params
        self.n_session = n_session
        self.zc = zero_constrained

        logger.info("VEM analyzer:")
        logger.info(" - estimate sigma H: %s", str(self.estimateSigmaH))
        logger.info(" - init sigma H: %f", self.sigmaH)
        logger.info(" - estimate drift and perfusion baseline: %s",
                    str(self.estimateLA))
Exemplo n.º 12
0
 def __init__(self, p=1, c='a'):
     XmlInitable.__init__(self)
     self.param1 = p
     self.param2 = c