navigate Logo

Getting Started

  • Computer Considerations
  • Computer Power Configuration
  • Software Installation
  • Launching Navigate
  • Configuring Navigate
  • Acquiring Data
  • Smart Acquisition Routines

User Guide

  • Supported Hardware
  • Supported File Formats
  • User Interface Walkthrough
  • Setting Up a Microscope
  • Acquiring Data
  • Case Studies

Development

  • Contributing Guidelines
  • Developer Install
  • Software Architecture
  • Developer Architecture Concepts
  • Feature Container
  • REST API
  • Plugin Architecture
  • Adding New Hardware

Troubleshooting & Known Issues

  • Troubleshooting
  • Known Issues

Plugins

  • navigate Plugin Template
  • navigate Confocal Projection
  • navigate at Scale
  • navigate Constant Velocity Acquisition
  • navigate MMCore
  • navigate ilastik Server
  • navigate Photoactivation

Reference

  • Implemented Microscopes
  • Software API
    • navigate.config
    • navigate.controller
    • navigate.controller.configurator
    • navigate.log_files
    • navigate.model
      • navigate.model.analysis
      • navigate.model.concurrency
      • navigate.model.data_sources
        • navigate.model.data_sources.logger
        • navigate.model.data_sources.get_data_source
        • navigate.model.data_sources.bdv_data_source
        • navigate.model.data_sources.data_source
        • navigate.model.data_sources.pyramidal_data_source
        • navigate.model.data_sources.tiff_data_source
        • navigate.model.data_sources.zarr_data_source
      • navigate.model.device_startup_functions
      • navigate.model.devices
      • navigate.model.features
      • navigate.model.metadata_sources
      • navigate.model.microscope
      • navigate.model.model
      • navigate.model.plugins_model
      • navigate.model.resolution_change
      • navigate.model.waveforms
    • navigate.tools
    • navigate.view
navigate
  • Software API
  • navigate.model
  • navigate.model.data_sources
  • navigate.model.data_sources.pyramidal_data_source
  • navigate.model.data_sources.pyramidal_data_source.PyramidalDataSource
  • View page source

navigate.model.data_sources.pyramidal_data_source.PyramidalDataSource

class navigate.model.data_sources.pyramidal_data_source.PyramidalDataSource(file_name: str = None, mode: str = 'w')

Bases: DataSource

General class for data sources that store data in a pyramidal structure.

Implements resolution/subdivision calculations and __getitem__ with indexing by subdivision.

__init__(file_name: str = None, mode: str = 'w') → None

Initializes the PyramidalDataSource.

Parameters:
  • file_name (str) – The name of the file to write to.

  • mode (str) – The mode to open the file in. Must be “w” for write or “r” for read.

Methods

__init__([file_name, mode])

Initializes the PyramidalDataSource.

close()

Clean up any leftover file pointers, etc.

get_data([timepoint, position, channel, z, ...])

Get data according to timepoint, position, channel and z-axis id

get_shape_from_metadata()

Refresh geometry and discard cached pyramid shapes and chunks.

get_slice(x, y, c[, z, t, p, subdiv])

Get a 3D slice of the dataset for a single c, t, p, subdiv.

read()

Read data from file.

set_image_format(image_format)

Set the confirmed acquisition format before writing the first frame.

set_metadata(metadata_config)

Sets the metadata

set_metadata_from_configuration_experiment(...)

Sets the metadata from according to the microscope configuration.

setup()

Additional steps for establishing the initial file setup.

write(data, **kw)

Writes 2D image to the data source.

Attributes

  • data

  • mode

  • nbytes

  • resolutions

  • shape

  • shapes

  • subdivisions

  • voxel_size

  • logger

  • file_name

  • metadata

  • bits

  • significant_bits

  • dx

  • dy

  • dz

  • dt

  • dc

  • shape_x

  • shape_y

  • shape_z

  • shape_t

  • shape_c

  • positions

close() → None

Clean up any leftover file pointers, etc.

get_data(timepoint: int = 0, position: int = 0, channel: int = 0, z: int = -1, resolution: int = 1) → Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str]]

Get data according to timepoint, position, channel and z-axis id

Parameters:
  • timepoint (int) – The timepoint value

  • position (int) – The position id in multi-position table

  • channel (int) – The channel id

  • z (int) – The index of Z in a Z-stack. Return all z if -1.

  • resolution (int) – values from 1, 2, 4, 8

Returns:

data – Image data

Return type:

npt.ArrayLike

Raises:

NotImplementedError – If not implemented in a derived class.

get_shape_from_metadata() → None

Refresh geometry and discard cached pyramid shapes and chunks.

get_slice(x, y, c, z=0, t=0, p=0, subdiv=0) → Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str]]

Get a 3D slice of the dataset for a single c, t, p, subdiv.

Parameters:
  • x (int or slice) – x indices to grab

  • y (int or slice) – y indices to grab

  • c (int) – Single channel

  • z (int or slice) – z indices to grab

  • t (int) – Single timepoint

  • p (int) – Single position

  • subdiv (int) – Subdivision of the dataset to index along

Returns:

3D (z, y, x) slice of data set

Return type:

npt.ArrayLike

Raises:

NotImplementedError – If the method is not implemented in a derived class.

read() → None

Read data from file.

Raises:

NotImplementedError – If not implemented in a derived class.

set_image_format(image_format: CameraImageFormat) → None

Set the confirmed acquisition format before writing the first frame.

Parameters:

image_format (CameraImageFormat) – Normalized array dtype and meaningful camera precision.

set_metadata(metadata_config: dict) → None

Sets the metadata

Parameters:

metadata_config (dict) – shape configuration: “c”, “z”, “t”, “p”, “is_dynamic”, “per_stack”

set_metadata_from_configuration_experiment(configuration: Dict[str, Any], microscope_name: str = None) → None

Sets the metadata from according to the microscope configuration.

Parameters:
  • configuration (Dict[str, Any]) – The configuration experiment.

  • microscope_name (str) – The microscope name

setup()

Additional steps for establishing the initial file setup.

write(data: Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str]], **kw) → None

Writes 2D image to the data source.

Parameters:
  • data (npt.ArrayLike) – Data to write to file.

  • **kw (dict) – Additional keyword arguments.

Raises:

NotImplementedError – If not implemented in a derived class.

bits

Number of bits per pixel.

Type:

int

property data: Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str]]

Return array representation of data stored in data source.

Returns:

Array representation of data stored in data source.

Return type:

npt.ArrayLike

Raises:

NotImplementedError – If not implemented in a derived class.

dc

Step size between channels (always 1)

Type:

float

dt

The time interval between frames (seconds).

Type:

float

dx

Pixel size in x dimension (microns). float: Pixel size in y dimension (microns). float: Pixel size in z dimension (microns).

Type:

float

dy

Pixel size in x dimension (microns). float: Pixel size in y dimension (microns). float: Pixel size in z dimension (microns).

Type:

float

dz

Pixel size in x dimension (microns). float: Pixel size in y dimension (microns). float: Pixel size in z dimension (microns).

Type:

float

file_name

Name of the file to read/write from.

Type:

str

logger

Logger for this class.

Type:

logging.Logger

metadata

Pointer to the metadata.

Type:

npt.ArrayLike

property mode: str

Getter for the mode of the data source.

Returns:

Mode of the data source.

Return type:

str

property nbytes: int

Getter for image size.

Size in bytes. Overrides base class. Accounts for subdivisions.

Returns:

size – The size of the image in bytes.

Return type:

int

positions

Number of positions in the data source.

Type:

int

property resolutions: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Getter for resolutions.

Store as XYZ per BDV spec.

Returns:

resolutions – The resolutions.

Return type:

npt.NDArray

property shape: tuple

Getter for the shape as XYCZT.

Returns:

Shape of the data source in XYCZT format.

Return type:

tuple

shape_c

Size of the data source in c dimension.

Type:

int

shape_t

Size of the data source in t dimension.

Type:

int

shape_x

Size of the data source in x dimension.

Type:

int

shape_y

Size of the data source in y dimension.

Type:

int

shape_z

Size of the data source in z dimension.

Type:

int

property shapes: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Getter for image shape.

Store as ZYX rather than XYZ, per BDV spec.

Returns:

shapes – The shapes.

Return type:

npt.NDArray

significant_bits

Confirmed camera precision, separate from storage width.

Type:

int or None

property subdivisions: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Getter for subdivisions.

Store as XYZ per BDV spec.

Returns:

subdivisions – The subdivisions.

Return type:

npt.NDArray

property voxel_size: tuple

Getter for the voxel size

Returns:

Voxel size in x, y, z dimensions.

Return type:

tuple

Previous Next

© Copyright 2026, Dean Lab, UT Southwestern Medical Center.