pynwb.ophys module

class pynwb.ophys.DfOverF(source, roi_response_series)

Bases: pynwb.core.NWBContainer

dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (ie, same names for ROIs and for image planes).

Parameters:
  • source (str) – The source of the data represented in this Module Interface.
  • roi_response_series (RoiResponseSeries) – RoiResponseSeries or any subtype.
roi_response_series
class pynwb.ophys.Fluorescence(source, roi_response_series)

Bases: pynwb.core.NWBContainer

Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).

Parameters:
  • source (str) – the source of the data represented in this Module Interface
  • roi_response_series (RoiResponseSeries) – RoiResponseSeries or any subtype.
roi_response_series
class pynwb.ophys.ImageSegmentation(name, source, plane_segmentation)

Bases: pynwb.core.NWBContainer

Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.

Parameters:
  • name (str) – name of PlaneSegmentation.
  • source (str) – The source of the data represented in this Module Interface.
  • plane_segmentation (PlaneSegmentation) – ImagePlane class.
plane_segmentation
class pynwb.ophys.ImagingPlane(name, source, optical_channel, description, device, excitation_lambda, imaging_rate, indicator, location, manifold, conversion, unit, reference_frame, parent=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this electrode
  • source (str) – the source of the data
  • optical_channel (list or OpticalChannel) – One of possibly many groups storing channelspecific data.
  • description (str) – Description of this ImagingPlane.
  • device (str) – Name of device in /general/devices
  • excitation_lambda (str) – Excitation wavelength.
  • imaging_rate (str) – Rate images are acquired, in Hz.
  • indicator (str) – Calcium indicator
  • location (str) – Location of image plane.
  • manifold (Iterable) – Physical position of each pixel. height, weight, x, y, z.
  • conversion (float) – Multiplier to get from stored values to specified unit (e.g., 1e-3 for millimeters)
  • unit (str) – Base unit that coordinates are stored in (e.g., Meters).
  • reference_frame (str) – Describes position and reference frame of manifold based on position of first element in manifold.
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
conversion
description
device
excitation_lambda
imaging_rate
indicator
location
manifold
optical_channel
reference_frame
unit
class pynwb.ophys.OpticalChannel(name, source, description, emission_lambda, parent=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this electrode
  • source (str) – the source of the data
  • description (str) – Any notes or comments about the channel.
  • emission_lambda (str) – Emission lambda for channel.
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
description
emission_lambda
class pynwb.ophys.PlaneSegmentation(name, source, description, roi_list, imaging_plane, reference_images)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – name of PlaneSegmentation.
  • source (str) – the source of the data
  • description (str) – Description of image plane, recording wavelength, depth, etc.
  • roi_list (Iterable) – List of ROIs in this imaging plane.
  • imaging_plane (ImagingPlane) – link to ImagingPlane group from which this TimeSeries data was generated.
  • reference_images (ImageSeries) – One or more image stacks that the masks apply to (can be oneelement stack).
description
imaging_plane
reference_images
roi_list
class pynwb.ophys.ROI(name, source, roi_description, pix_mask, pix_mask_weight, img_mask, reference_images)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this ROI
  • source (str) – the source of the data
  • roi_description (str) – Description of this ROI.
  • pix_mask (Iterable) – List of pixels (x,y) that compose the mask.
  • pix_mask_weight (Iterable) – Weight of each pixel listed in pix_mask.
  • img_mask (Iterable) – ROI mask, represented in 2D ([y][x]) intensity image.
  • reference_images (ImageSeries) – One or more image stacks that the masks apply to (can be oneelement stack).
img_mask
pix_mask
pix_mask_weight
roi_description
class pynwb.ophys.RoiResponseSeries(name, source, data, unit, roi_names, segmenttation_interface, resolution=0.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments=no comments, description=no description, control=None, control_description=None, parent=None)

Bases: pynwb.base.TimeSeries

ROI responses over an imaging plane. Each row in data[] should correspond to the signal from one ROI.

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (list or ndarray or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • unit (str) – The base unit of measurement (should be SI unit)
  • roi_names (Iterable) – List of ROIs represented, one name for each row of data[].
  • segmenttation_interface (ImageSegmentation) – Link to ImageSegmentation.
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • timestamps (list or ndarray or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
roi_names
segmenttation_interface
class pynwb.ophys.TwoPhotonSeries(name, source, data, unit, format, field_of_view, imaging_plane, pmt_gain, scan_line_rate, external_file=None, starting_frame=None, bits_per_pixel=None, dimension=[nan], resolution=0.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments=no comments, description=no description, control=None, control_description=None, parent=None)

Bases: pynwb.image.ImageSeries

A special case of optical imaging.

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (list or ndarray or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • unit (str) – The base unit of measurement (should be SI unit)
  • format (str) – Format of image. Three types: 1) Image format; tiff, png, jpg, etc. 2) external 3) raw.
  • field_of_view (list or ndarray or TimeSeries) – Width, height and depth of image, or imaged area (meters).
  • imaging_plane (ImagingPlane) – Imaging plane class/pointer.
  • pmt_gain (float) – Photomultiplier gain.
  • scan_line_rate (float) – Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.
  • external_file (Iterable) – Path or URL to one or more external file(s). Field only present if format=external. Either external_file or data must be specified, but not both.
  • starting_frame (Iterable) – Each entry is the frame number in the corresponding external_file variable. This serves as an index to what frames each file contains.
  • bits_per_pixel (int) – Number of bit per image pixel
  • dimension (Iterable) – Number of pixels on x, y, (and z) axes.
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • timestamps (list or ndarray or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
field_of_view
imaging_plane
pmt_gain
scan_line_rate