pynwb.image module

class pynwb.image.ImageSeries(name, source, data, unit='None', format='None', 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.base.TimeSeries

General image data that is common between acquisition and stimulus time series. The image data can be stored in the HDF5 file or it will be stored as an external image file.

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 or Iterable) – 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.
  • 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 (Iterable 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
bits_per_pixel
dimension
external_file
starting_frame
format
class pynwb.image.IndexSeries(name, source, data, unit, indexed_timeseries, 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

Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed.

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 (Iterable 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)
  • indexed_timeseries (TimeSeries) – HDF5 link to TimeSeries containing images that are indexed.
  • 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 (Iterable 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
indexed_timeseries
class pynwb.image.ImageMaskSeries(name, source, data, unit, masked_imageseries, format, 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

An alpha mask that is applied to a presented visual stimulus. The data[] array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it’s explicitly changed.

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)
  • masked_imageseries (ImageSeries) – Link to ImageSeries that mask is applied to.
  • format (str) – Format of image. Three types: 1) Image format; tiff, png, jpg, etc. 2) external 3) raw.
  • 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
masked_imageseries
class pynwb.image.OpticalSeries(name, source, data, unit, format, distance, field_of_view, orientation, 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

Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (eg, how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.

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.
  • distance (float) – Distance from camera/monitor to target/eye.
  • field_of_view (list or ndarray or TimeSeries) – Width, height and depth of image, or imaged area (meters).
  • orientation (str) – Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.
  • 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
distance
field_of_view
orientation