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 __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 __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 __init__(self, prefix='', project_id=None): super(CSVConnectivityImporterForm, self).__init__(prefix, project_id) self.weights = UploadField('.csv', self, name='weights', label='Weights file (csv)', required=True) self.weights_delimiter = SimpleSelectField(DELIMITER_OPTIONS, self, name='weights_delimiter', required=True, label='Field delimiter : ', default=list(DELIMITER_OPTIONS)[0]) self.tracts = UploadField('.csv', self, name='tracts', label='Tracts file (csv)', required=True) self.tracts_delimiter = SimpleSelectField(DELIMITER_OPTIONS, self, name='tracts_delimiter', required=True, label='Field delimiter : ', default=list(DELIMITER_OPTIONS)[0]) self.input_data = DataTypeSelectField(ConnectivityIndex, self, name='input_data', required=True, label='Reference Connectivity Matrix (for node labels, 3d positions etc.)')
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 __init__(self, choices, prefix='', project_id=None): super(SimulatorPSEConfigurationFragment, self).__init__(prefix, project_id) self.pse_param1 = SimpleSelectField(choices, form=self, name='pse_param1', required=True, label="PSE param1") self.pse_param1.template = "form_fields/select_field.html" self.pse_param2 = SimpleSelectField(choices, form=self, name='pse_param2', label="PSE param2") self.pse_param2.template = "form_fields/select_field.html"
def __init__(self, prefix='', project_id=None): super(GIFTISurfaceImporterForm, self).__init__(prefix, project_id) surface_types = ALL_SURFACES_SELECTION.copy() surface_types['Specified in the file metadata'] = OPTION_READ_METADATA self.file_type = SimpleSelectField(surface_types, self, name='file_type', required=True, label='Specify file type : ', default=list(surface_types)[0]) self.data_file = UploadField( '.gii', self, name='data_file', required=True, label='Please select a .gii (LH if cortex)') self.data_file_part2 = UploadField( '.gii', self, name='data_file_part2', label="Optionally select 2'nd .gii (RH if cortex)") self.should_center = SimpleBoolField( self, name='should_center', default=False, label='Center surface using vertex means along axes')
def __init__(self, prefix='', project_id=None): super(SimulatorModelFragment, self).__init__(prefix, project_id) self.model_choices = get_ui_name_to_model() self.model = SimpleSelectField(choices=self.model_choices, form=self, name='model', required=True, label=Simulator.model.label, doc=Simulator.model.doc) self.model.template = "form_fields/select_field.html"
def __init__(self, prefix='', project_id=None, is_surface_simulation=False): super(SimulatorMonitorFragment, self).__init__(prefix, project_id) self.monitor_choices = get_ui_name_to_monitor_dict(is_surface_simulation) self.monitor = SimpleSelectField(choices=self.monitor_choices, form=self, name='monitor', required=True, label=Simulator.monitors.label, doc=Simulator.monitors.doc) self.monitor.template = "form_fields/select_field.html"
def __init__(self, prefix='', project_id=None): super(ZIPSurfaceImporterForm, self).__init__(prefix, project_id) self.uploaded = UploadField('application/zip', self, name='uploaded', required=True, label='Surface file (zip)') self.surface_type = SimpleSelectField(ALL_SURFACES_SELECTION, self, name='surface_type', required=True, label='Surface type', default=list(ALL_SURFACES_SELECTION)[0]) self.zero_based_triangles = SimpleBoolField(self, name='zero_based_triangles', default=True, label='Zero based triangles') self.should_center = SimpleBoolField(self, name='should_center', label='Center surface using vertex means along axes')
def __init__(self, prefix='', project_id=None): super(SimulatorIntegratorFragment, self).__init__(prefix, project_id) self.integrator_choices = get_ui_name_to_integrator_dict() self.integrator = SimpleSelectField(choices=self.integrator_choices, form=self, name='integrator', required=True, label=Simulator.integrator.label, doc=Simulator.integrator.doc) self.integrator.template = "form_fields/select_field.html"
def __init__(self, prefix='', project_id=None): super(ObjSurfaceImporterForm, self).__init__(prefix, project_id) self.surface_type = SimpleSelectField(ALL_SURFACES_SELECTION, self, name='surface_type', required=True, label='Specify file type :', default=list(ALL_SURFACES_SELECTION)[0]) self.data_file = UploadField('.obj', self, name='data_file', required=True, label='Please select file to import') self.should_center = SimpleBoolField(self, name='should_center', default=False, label='Center surface using vertex means along axes')
def __init__(self, model_params, equation_choices, prefix=''): super(SurfaceModelParametersForm, self).__init__(prefix) self.model_param = SimpleSelectField(model_params, self, name='model_param', required=True, label='Model parameter') self.model_param.template = 'form_fields/select_field.html' self.equation = SimpleSelectField(equation_choices, self, name='equation', required=True, label='Equation', default=self.default_equation) self.equation_params = FormField(get_form_for_equation( self.default_equation), self, name=self.NAME_EQATION_PARAMS_DIV)
def __init__(self, prefix='', project_id=None): super(SimulatorMonitorFragment, self).__init__(prefix, project_id) self.monitor_choices = get_ui_name_to_monitor_dict() self.monitor = SimpleSelectField(choices=self.monitor_choices, form=self, name='monitor', required=True, label=Simulator.monitors.label, doc=Simulator.monitors.doc) self.monitor.template = "select_field.jinja2"
def __init__(self, prefix='', project_id=None): super(SimulatorAdapterForm, self).__init__(prefix, project_id) self.connectivity = DataTypeSelectField(self.get_required_datatype(), self, name=self.get_input_name(), required=True, label="Connectivity", doc=Simulator.connectivity.doc, conditions=self.get_filters()) self.coupling_choices = get_ui_name_to_coupling_dict() self.coupling = SimpleSelectField(choices=self.coupling_choices, form=self, name='coupling', required=True, label="Coupling", doc=Simulator.coupling.doc) self.coupling.template = 'form_fields/select_field.html' self.conduction_speed = FloatField(Simulator.conduction_speed, self) self.ordered_fields = (self.connectivity, self.conduction_speed, self.coupling) self.range_params = [Simulator.connectivity, Simulator.conduction_speed]
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()
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()
def __init__(self, prefix='', project_id=None): super(SensorsImporterForm, self).__init__(prefix, project_id) self.sensors_file = UploadField( 'text/plain, .bz2', self, name='sensors_file', required=True, label='Please upload sensors file (txt or bz2 format)', doc='Expected a text/bz2 file containing sensor measurements.') self.sensors_type = SimpleSelectField(self.options, self, name='sensors_type', required=True, label='Sensors type: ', default=list(self.options)[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__
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__