示例#1
0
文件: ogen.py 项目: vrhaynes/pynwb
 def __init__(self, **kwargs):
     device, description, excitation_lambda, location = popargs(
         'device', 'description', 'excitation_lambda', 'location', kwargs)
     call_docval_func(super(OptogeneticStimulusSite, self).__init__, kwargs)
     self.device = device
     self.description = description
     self.excitation_lambda = excitation_lambda
     self.location = location
示例#2
0
 def __init__(self, **kwargs):
     data, bits_per_pixel, dimension, format, field_of_view = popargs(
         'data', 'bits_per_pixel', 'dimension', 'format', 'field_of_view', kwargs)
     call_docval_func(super(AImage, self).__init__, kwargs)
     self.data = data
     self.bits_per_pixel = bits_per_pixel
     self.dimension = format
     self.field_of_view = field_of_view
示例#3
0
文件: file.py 项目: Qiyu815/pynwb
    def add_unit(self, **kwargs):
        """
        Add a unit to the unit table.
        See :py:meth:`~pynwb.core.DynamicTable.add_row` for more details.

        """
        self.__check_units()
        call_docval_func(self.units.add_unit, kwargs)
示例#4
0
 def __init__(self, **kwargs):
     """Construct a new PoseEstimationSeries representing pose estimates for a particular body part."""
     reference_frame, confidence, confidence_definition = popargs(
         'reference_frame', 'confidence', 'confidence_definition', kwargs)
     call_docval_func(super().__init__, kwargs)
     self.reference_frame = reference_frame
     self.confidence = confidence
     self.confidence_definition = confidence_definition
示例#5
0
 def __init__(self, **kwargs):
     bits_per_pixel, dimension, format, field_of_view = popargs(
         'bits_per_pixel', 'dimension', 'format', 'field_of_view', kwargs)
     call_docval_func(super().__init__, kwargs)
     self.bits_per_pixel = bits_per_pixel
     self.dimension = dimension
     self.format = format
     self.field_of_view = field_of_view
示例#6
0
 def __init__(self, **kwargs):
     super().__init__(
         **{
             kwargs_item: kwargs[kwargs_item]
             for kwargs_item in kwargs.copy() if kwargs_item != 'devices'
         })
     call_docval_func(super(NwbImageSeries, self).__init__, kwargs)
     self.devices = kwargs['devices']
示例#7
0
 def _func(self, **kwargs):
     call_docval_func(super(cls, self).__init__, kwargs)
     for conf in clsconf:
         attr_name = conf['attr']
         add_name = conf['add']
         container = popargs(attr_name, kwargs)
         add = getattr(self, add_name)
         add(container)
示例#8
0
文件: file.py 项目: Qiyu815/pynwb
 def add_epoch_column(self, **kwargs):
     """
     Add a column to the electrode table.
     See :py:meth:`~pynwb.core.TimeIntervals.add_column` for more details
     """
     self.__check_epochs()
     self.epoch_tags.update(kwargs.pop('tags', list()))
     call_docval_func(self.epochs.add_column, kwargs)
示例#9
0
 def __init__(self, **kwargs):
     field_of_view, imaging_plane, pmt_gain, scan_line_rate = popargs(
         'field_of_view', 'imaging_plane', 'pmt_gain', 'scan_line_rate',
         kwargs)
     call_docval_func(super(TwoPhotonSeries, self).__init__, kwargs)
     self.field_of_view = field_of_view
     self.imaging_plane = imaging_plane
     self.pmt_gain = pmt_gain
     self.scan_line_rate = scan_line_rate
示例#10
0
 def __init__(self, **kwargs):
     call_docval_func(super(MultiContainerInterface, self).__init__, kwargs)
     if isinstance(self.__clsconf__, dict):
         attr_name = self.__clsconf__['attr']
         self.fields[attr_name] = LabelledDict(attr_name)
     else:
         for d in self.__clsconf__:
             attr_name = d['attr']
             self.fields[attr_name] = LabelledDict(attr_name)
示例#11
0
 def __init__(self, **kwargs):
     if kwargs.get('description', None) is None:
         kwargs['description'] = "data on spiking units"
     call_docval_func(super(Units, self).__init__, kwargs)
     if 'spike_times' not in self.colnames:
         self.__has_spike_times = False
     self.__electrode_table = getargs('electrode_table', kwargs)
     self.waveform_rate = getargs('waveform_rate', kwargs)
     self.waveform_unit = getargs('waveform_unit', kwargs)
     self.resolution = getargs('resolution', kwargs)
示例#12
0
 def __init__(self, **kwargs):
     super().__init__(
         **{
             kwargs_item: kwargs[kwargs_item]
             for kwargs_item in kwargs.copy()
             if kwargs_item not in ['description', 'content']
         })
     call_docval_func(super(AssociatedFiles, self).__init__, kwargs)
     self.description = kwargs['description']
     self.content = kwargs['content']
示例#13
0
    def add_invalid_time_interval(self, **kwargs):
        """
        Add a trial to the trial table.
        See :py:meth:`~hdmf.common.DynamicTable.add_row` for more details.

        Required fields are *start_time*, *stop_time*, and any columns that have
        been added (through calls to `add_invalid_times_columns`).
        """
        self.__check_invalid_times()
        call_docval_func(self.invalid_times.add_interval, kwargs)
示例#14
0
 def __init__(self, **kwargs):
     imaging_plane, reference_images = popargs('imaging_plane', 'reference_images', kwargs)
     if kwargs.get('name') is None:
         kwargs['name'] = imaging_plane.name
     columns, colnames = getargs('columns', 'colnames', kwargs)
     call_docval_func(super(PlaneSegmentation, self).__init__, kwargs)
     self.imaging_plane = imaging_plane
     if isinstance(reference_images, ImageSeries):
         reference_images = (reference_images,)
     self.reference_images = reference_images
示例#15
0
 def __init__(self, **kwargs):
     call_docval_func(super(ElectrodeGroup, self).__init__, kwargs)
     description, location, device, position = popargs('description', 'location', 'device', 'position', kwargs)
     self.description = description
     self.location = location
     self.device = device
     if position and len(position) != 3:
         raise Exception('ElectrodeGroup position argument must have three elements: x, y, z, but received: %s'
                         % position)
     self.position = position
示例#16
0
 def __init__(self, **kwargs):
     bits_per_pixel, dimension, external_file, starting_frame, format = popargs(
         'bits_per_pixel', 'dimension', 'external_file', 'starting_frame', 'format', kwargs)
     call_docval_func(super(ImageSeries, self).__init__, kwargs)
     if external_file is None and self.data is None:
         raise ValueError('must supply either external_file or data to ' + self.name)
     self.bits_per_pixel = bits_per_pixel
     self.dimension = dimension
     self.external_file = external_file
     self.starting_frame = starting_frame
     self.format = format
示例#17
0
    def __init__(self, **kwargs):
        lower_tier_table = popargs('lower_tier_table', kwargs)

        # Initialize the DynamicTable
        call_docval_func(super().__init__, kwargs)
        if self['next_tier'].target.table is None:
            if lower_tier_table is not None:
                self['next_tier'].target.table = lower_tier_table
            else:
                raise ValueError(
                    'lower_tier_table constructor argument required')
示例#18
0
 def __init__(self, **kwargs):
     super().__init__(**{kwargs_item: kwargs[kwargs_item]
                         for kwargs_item in kwargs.copy()
                         if kwargs_item != 'system'
                         if kwargs_item != 'amplifier'
                         if kwargs_item != 'adc_circuit'
                         })
     call_docval_func(super(DataAcqDevice, self).__init__, kwargs)
     self.system = kwargs['system']
     self.amplifier = kwargs['amplifier']
     self.adc_circuit = kwargs['adc_circuit']
示例#19
0
 def __init__(self, **kwargs):
     super().__init__(
         **{
             kwargs_item: kwargs[kwargs_item]
             for kwargs_item in kwargs.copy() if kwargs_item not in
             ['meters_per_pixel', 'camera_name', 'model', 'lens']
         })
     call_docval_func(super(CameraDevice, self).__init__, kwargs)
     self.meters_per_pixel = kwargs['meters_per_pixel']
     self.camera_name = kwargs['camera_name']
     self.model = kwargs['model']
     self.lens = kwargs['lens']
示例#20
0
 def __init__(self, **kwargs):
     slice, seal, description, location, resistance, filtering, initial_access_resistance, device = popargs(
         'slice', 'seal', 'description', 'location', 'resistance',
         'filtering', 'initial_access_resistance', 'device', kwargs)
     call_docval_func(super().__init__, kwargs)
     self.slice = slice
     self.seal = seal
     self.description = description
     self.location = location
     self.resistance = resistance
     self.filtering = filtering
     self.initial_access_resistance = initial_access_resistance
     self.device = device
示例#21
0
 def __init__(self, **kwargs):
     seq_table, taxa_table, distances, tree = popargs('seq_table', 'taxa_table', 'distances', 'tree', kwargs)
     call_docval_func(super().__init__, {'name': 'root'})
     self.seq_table = seq_table
     self.taxa_table = taxa_table
     self.distances = distances
     self.tree = tree
     self._sanity = False
     self._sanity_features = 5
     self.__labels = None
     self.__n_emb_components = self.taxa_table['embedding'].data.shape[1] if 'embedding' in self.taxa_table else 0
     self.label_key = 'id'
     self.__rev = False
示例#22
0
 def __init__(self, **kwargs):
     subject = popargs('subject', kwargs)
     ontology_objects, ontology_terms = popargs('ontology_objects', 'ontology_terms', kwargs)
     call_docval_func(super().__init__, kwargs)
     self.subject = subject
     if ontology_objects is not None:
         self.ontology_objects = ontology_objects
     else:
         self.ontology_objects = OntologyTable()
     if ontology_terms is not None:
         self.ontology_terms = ontology_terms
     else:
         self.ontology_terms = OntologyMap()
示例#23
0
    def add_epoch(self, **kwargs):
        """

        Creates a new Epoch object. Epochs are used to track intervals
        in an experiment, such as exposure to a certain type of stimuli
        (an interval where orientation gratings are shown, or of
        sparse noise) or a different paradigm (a rat exploring an
        enclosure versus sleeping between explorations)
        """
        self.__check_epochs()
        if kwargs['tags'] is not None:
            self.epoch_tags.update(kwargs['tags'])
        call_docval_func(self.epochs.add_interval, kwargs)
示例#24
0
 def __init__(self, **kwargs):
     axis_1_phase_map, axis_1_power_map, axis_2_phase_map, axis_2_power_map, axis_descriptions, \
         focal_depth_image, sign_map, vasculature_image = popargs(
             'axis_1_phase_map', 'axis_1_power_map', 'axis_2_phase_map', 'axis_2_power_map',
             'axis_descriptions', 'focal_depth_image', 'sign_map', 'vasculature_image', kwargs)
     call_docval_func(super(ImagingRetinotopy, self).__init__, kwargs)
     self.axis_1_phase_map = axis_1_phase_map
     self.axis_1_power_map = axis_1_power_map
     self.axis_2_phase_map = axis_2_phase_map
     self.axis_2_power_map = axis_2_power_map
     self.axis_descriptions = axis_descriptions
     self.focal_depth_image = focal_depth_image
     self.sign_map = sign_map
     self.vasculature_image = vasculature_image
 def __init__(self, **kwargs):
     super().__init__(**{kwargs_item: kwargs[kwargs_item]
                         for kwargs_item in kwargs.copy()
                         if kwargs_item != 'targeted_location'
                         if kwargs_item != 'targeted_x'
                         if kwargs_item != 'targeted_y'
                         if kwargs_item != 'targeted_z'
                         if kwargs_item != 'units'
                         })
     call_docval_func(super(NwbElectrodeGroup, self).__init__, kwargs)
     self.targeted_location = kwargs['targeted_location']
     self.targeted_x = kwargs['targeted_x']
     self.targeted_y = kwargs['targeted_y']
     self.targeted_z = kwargs['targeted_z']
     self.units = kwargs['units']
示例#26
0
    def add_electrode(self, **kwargs):
        """
        Add a unit to the unit table.
        See :py:meth:`~hdmf.common.DynamicTable.add_row` for more details.

        Required fields are *x*, *y*, *z*, *imp*, *location*, *filtering*,
        *group* and any columns that have been added
        (through calls to `add_electrode_columns`).
        """
        self.__check_electrodes()
        d = _copy.copy(
            kwargs['data']) if kwargs.get('data') is not None else kwargs
        if d.get('group_name', None) is None:
            d['group_name'] = d['group'].name
        call_docval_func(self.electrodes.add_row, d)
示例#27
0
 def __init__(self, **kwargs):
     kwargs['name'] = 'subject'
     call_docval_func(super(Subject, self).__init__, kwargs)
     self.age = getargs('age', kwargs)
     self.description = getargs('description', kwargs)
     self.genotype = getargs('genotype', kwargs)
     self.sex = getargs('sex', kwargs)
     self.species = getargs('species', kwargs)
     self.subject_id = getargs('subject_id', kwargs)
     self.weight = getargs('weight', kwargs)
     date_of_birth = getargs('date_of_birth', kwargs)
     if date_of_birth and date_of_birth.tzinfo is None:
         self.date_of_birth = _add_missing_timezone(date_of_birth)
     else:
         self.date_of_birth = date_of_birth
示例#28
0
def get_manager(**kwargs):
    '''
    Get a BuildManager to use for I/O using the given extensions. If no extensions are provided,
    return a BuildManager that uses the core namespace
    '''
    type_map = call_docval_func(get_type_map, kwargs)
    return BuildManager(type_map)
示例#29
0
 def __init__(self, **kwargs):
     call_docval_func(super().__init__, kwargs)
     notes, description = getargs('notes', 'description', kwargs)
     if notes != '':
         warn(
             'The `notes` argument of ScratchData.__init__ will be deprecated. Use description instead.',
             PendingDeprecationWarning)
         if notes != '' and description != '':
             raise ValueError(
                 'Cannot provide both notes and description to ScratchData.__init__. The description '
                 'argument is recommended.')
         description = notes
     if not description:
         warn(
             'ScratchData.description will be required in a future major release of PyNWB.',
             PendingDeprecationWarning)
     self.description = description
示例#30
0
 def __init__(self, **kwargs):
     columns = kwargs['columns']
     if columns is None:
         taxon_id, rep_idx, taxa_table = popargs('taxon_id', 'rep_idx',
                                                 'taxa_table', kwargs)
         if not isinstance(taxon_id, VectorData):
             taxon_id = VectorData('taxon_id',
                                   'NCBI accession',
                                   data=taxon_id)
         if not isinstance(rep_idx, VectorData):
             if taxa_table is None:
                 raise ValueError('taxa_table must be provided if writing')
             rep_idx = DynamicTableRegion('rep_idx', rep_idx,
                                          'representative taxon',
                                          taxa_table)
         kwargs['columns'] = [taxon_id, rep_idx]
     call_docval_func(super().__init__, kwargs)