pynwb.image module¶
-
class
pynwb.image.
ImageSeries
(name, data=None, unit=None, format=None, external_file=None, starting_frame=[0], bits_per_pixel=None, dimension=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None)[source]¶ 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 - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 3D or 4D. The first dimension must be time (frame). The second and third dimensions represent x and y. The optional fourth dimension represents z. - 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 (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – 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. If external_file is not provided, then this value will be None - bits_per_pixel (
int
) – DEPRECATED: Number of bits per image pixel - dimension (
Iterable
) – Number of pixels on x, y, (and z) axes. - resolution (
str
or float) – The smallest meaningful difference (in specified unit) between values in data - conversion (
str
or float) – Scalar to multiply each element in data to convert it to the specified unit - timestamps (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
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
-
dimension
¶ Number of pixels on x, y, (and z) axes.
-
external_file
¶ 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
¶ Each entry is the frame number in the corresponding external_file variable. This serves as an index to what frames each file contains. If external_file is not provided, then this value will be None
-
format
¶ - Image format; tiff, png, jpg, etc. 2) external 3) raw.
Type: Format of image. Three types
-
bits_per_pixel
¶
-
namespace
= 'core'¶
-
neurodata_type
= 'ImageSeries'¶
- name (
-
class
pynwb.image.
IndexSeries
(name, data, indexed_timeseries, unit=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None)[source]¶ 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 - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Must be 1D, where the first dimension must be time (frame) - indexed_timeseries (
TimeSeries
) – HDF5 link to TimeSeries containing images that are indexed. - unit (
str
) – The base unit of measurement (should be SI unit) - resolution (
str
or float) – The smallest meaningful difference (in specified unit) between values in data - conversion (
str
or float) – Scalar to multiply each element in data to convert it to the specified unit - timestamps (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
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
-
indexed_timeseries
¶ HDF5 link to TimeSeries containing images that are indexed.
-
namespace
= 'core'¶
-
neurodata_type
= 'IndexSeries'¶
- name (
-
class
pynwb.image.
ImageMaskSeries
(name, masked_imageseries, data=None, unit=None, format=None, external_file=None, starting_frame=[0], bits_per_pixel=None, dimension=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None)[source]¶ 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 - masked_imageseries (
ImageSeries
) – Link to ImageSeries that mask is applied to. - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 3D or 4D. The first dimension must be time (frame). The second and third dimensions represent x and y. The optional fourth dimension represents z. - 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 (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – 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. If external_file is not provided, then this value will be None - bits_per_pixel (
int
) – DEPRECATED: Number of bits per image pixel - dimension (
Iterable
) – Number of pixels on x, y, (and z) axes. - resolution (
str
or float) – The smallest meaningful difference (in specified unit) between values in data - conversion (
str
or float) – Scalar to multiply each element in data to convert it to the specified unit - timestamps (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
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
-
masked_imageseries
¶ Link to ImageSeries that mask is applied to.
-
namespace
= 'core'¶
-
neurodata_type
= 'ImageMaskSeries'¶
- name (
-
class
pynwb.image.
OpticalSeries
(name, data, distance, field_of_view, orientation, unit=None, format=None, external_file=None, starting_frame=[0], bits_per_pixel=None, dimension=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None)[source]¶ 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 - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Images presented to subject, either grayscale or RGB. May be 3D or 4D. The first dimension must be time (frame). The second and third dimensions represent x and y. The optional fourth dimension must be length 3 and represents the RGB value for color images. - distance (float) – Distance from camera/monitor to target/eye.
- field_of_view (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
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. - 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 (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – 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. If external_file is not provided, then this value will be None - bits_per_pixel (
int
) – DEPRECATED: Number of bits per image pixel - dimension (
Iterable
) – Number of pixels on x, y, (and z) axes. - resolution (
str
or float) – The smallest meaningful difference (in specified unit) between values in data - conversion (
str
or float) – Scalar to multiply each element in data to convert it to the specified unit - timestamps (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
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
-
distance
¶ Distance from camera/monitor to target/eye.
-
field_of_view
¶ Width, height and depth of image, or imaged area (meters).
-
orientation
¶ Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.
-
namespace
= 'core'¶
-
neurodata_type
= 'OpticalSeries'¶
- name (
-
class
pynwb.image.
GrayscaleImage
(name, data, resolution=None, description=None)[source]¶ Bases:
pynwb.base.Image
Parameters: - name (
str
) – The name of this TimeSeries dataset - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Data of image. Must be 2D - resolution (float) – pixels / cm
- description (
str
) – description of image
-
namespace
= 'core'¶
-
neurodata_type
= 'GrayscaleImage'¶
- name (
-
class
pynwb.image.
RGBImage
(name, data, resolution=None, description=None)[source]¶ Bases:
pynwb.base.Image
Parameters: - name (
str
) – The name of this TimeSeries dataset - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Data of image. Must be 3D where the third dimension has length 3 and represents the RGB value - resolution (float) – pixels / cm
- description (
str
) – description of image
-
namespace
= 'core'¶
-
neurodata_type
= 'RGBImage'¶
- name (
-
class
pynwb.image.
RGBAImage
(name, data, resolution=None, description=None)[source]¶ Bases:
pynwb.base.Image
Parameters: - name (
str
) – The name of this TimeSeries dataset - data (
ndarray
orlist
ortuple
orDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Data of image. Must be 3D where the third dimension has length 4 and represents the RGBA value - resolution (float) – pixels / cm
- description (
str
) – description of image
-
namespace
= 'core'¶
-
neurodata_type
= 'RGBAImage'¶
- name (