Пример #1
0
class BoldMonitorForm(MonitorForm):
    def __init__(self, prefix='', project_id=None):
        super(BoldMonitorForm, self).__init__(prefix, project_id)
        self.period = ScalarField(Bold.period, self)
        self.equation_choices = get_ui_name_to_monitor_equation_dict()
        self.equation = SimpleSelectField(self.equation_choices,
                                          self,
                                          name='equation',
                                          required=True,
                                          label='Equation')

    def fill_trait(self, datatype):
        super(BoldMonitorForm, self).fill_trait(datatype)
        datatype.period = self.period.data
        datatype.equation = self.equation.data()
Пример #2
0
class MultiplicativeNoiseForm(NoiseForm):
    def __init__(self, prefix=''):
        super(MultiplicativeNoiseForm, self).__init__(prefix)
        self.nsig = ArrayField(Multiplicative.nsig, self)
        self.equation_choices = get_ui_name_to_equation_dict()
        self.equation = SimpleSelectField(self.equation_choices,
                                          self,
                                          name='equation',
                                          required=True,
                                          label='Equation')

    def fill_trait(self, datatype):
        super(MultiplicativeNoiseForm, self).fill_trait(datatype)
        datatype.nsig = self.nsig.data
        datatype.b = self.equation.data()
Пример #3
0
class IntegratorStochasticForm(IntegratorForm):
    template = 'form_fields/select_field.html'

    def __init__(self, prefix=''):
        super(IntegratorStochasticForm, self).__init__(prefix)
        # TODO: show select box with Noise types
        # self.noise = FormField(MultiplicativeNoiseForm, self, name='noise', label='Noise')
        self.noise_choices = get_ui_name_to_noise_dict()
        self.noise = SimpleSelectField(self.noise_choices,
                                       self,
                                       name='noise',
                                       required=True,
                                       label='Noise')

    def fill_trait(self, datatype):
        super(IntegratorStochasticForm, self).fill_trait(datatype)
        datatype.noise = self.noise.data()

    def fill_from_trait(self, trait):
        # type: (Integrator) -> None
        self.noise.data = trait.noise.__class__
Пример #4
0
class BoldMonitorForm(MonitorForm):
    def __init__(self,
                 variables_of_interest_indexes,
                 prefix='',
                 project_id=None):
        super(BoldMonitorForm, self).__init__(variables_of_interest_indexes,
                                              prefix, project_id)
        self.period = ScalarField(Bold.period, self)
        self.hrf_kernel_choices = get_ui_name_to_monitor_equation_dict()
        self.hrf_kernel = SimpleSelectField(self.hrf_kernel_choices,
                                            self,
                                            name='hrf_kernel',
                                            required=True,
                                            label='Equation')

    def fill_trait(self, datatype):
        super(BoldMonitorForm, self).fill_trait(datatype)
        datatype.period = self.period.data
        datatype.hrf_kernel = self.hrf_kernel.data()

    def fill_from_trait(self, trait):
        super(BoldMonitorForm, self).fill_from_trait(trait)
        self.hrf_kernel.data = trait.hrf_kernel.__class__