Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/navigate/model/data_sources/bdv_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

# Standard Imports
import os
from multiprocessing.managers import DictProxy
import logging
from typing import Any, Dict

# Third Party Imports
import h5py
Expand Down Expand Up @@ -119,13 +119,13 @@ def get_slice(self, x, y, c, z=0, t=0, p=0, subdiv=0) -> npt.ArrayLike:
return self.image[setup][z, y, x]

def set_metadata_from_configuration_experiment(
self, configuration: DictProxy, microscope_name: str = None
self, configuration: Dict[str, Any], microscope_name: str = None
) -> None:
"""Sets the metadata from according to the microscope configuration.

Parameters
----------
configuration : DictProxy
configuration : Dict[str, Any]
The configuration experiment.
microscope_name : str
The microscope name
Expand Down
31 changes: 17 additions & 14 deletions src/navigate/model/data_sources/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@

# Standard Library Imports
import logging
from typing import Any, Dict

# Third Party Imports
import numpy.typing as npt

# Local Imports
from multiprocessing.managers import DictProxy

# Logger Setup
p = __name__.split(".")[1]
Expand Down Expand Up @@ -75,10 +75,10 @@ def __init__(self, file_name: str = "", mode: str = "w") -> None:
#: npt.ArrayLike: Pointer to the metadata.
self.metadata = None # Expect a metadata object

#: str: Mode to open the file in. Can be 'r' or 'w'.
# str: Mode to open the file in. Can be 'r' or 'w'.
self._mode = None

#: bool: Has the data source been closed?
# bool: Has the data source been closed?
self._closed = True

#: int: Number of bits per pixel.
Expand All @@ -99,17 +99,20 @@ def __init__(self, file_name: str = "", mode: str = "w") -> None:
self.dc = 1 # step size between channels, should always be 1

#: int: Size of the data source in x dimension.
self.shape_x = 1

#: int: Size of the data source in y dimension.
self.shape_y = 1

#: int: Size of the data source in z dimension.
self.shape_z = 1

#: int: Size of the data source in t dimension.
self.shape_t = 1

#: int: Size of the data source in c dimension.
self.shape_x, self.shape_y, self.shape_z, self.shape_t, self.shape_c = (
1,
1,
1,
1,
1,
)
self.shape_c = 1

#: int: Number of positions in the data source.
self.positions = 1

Expand All @@ -121,14 +124,14 @@ def __init__(self, file_name: str = "", mode: str = "w") -> None:

@property
def nbytes(self) -> int:
"""Getter for the size of this data source in bytes."
"""Getter for the size of this data source in bytes.

Does not account for pyramidal data sources. That process is handled by the
bdv_data_source class, which is a child of this class.

Returns
-------
int
total_bytes : int
Size of this data source in bytes.
"""
total_bits = (
Expand Down Expand Up @@ -216,13 +219,13 @@ def setup(self):
pass

def set_metadata_from_configuration_experiment(
self, configuration: DictProxy, microscope_name: str = None
self, configuration: Dict[str, Any], microscope_name: str = None
) -> None:
"""Sets the metadata from according to the microscope configuration.

Parameters
----------
configuration : DictProxy
configuration : Dict[str, Any]
Configuration experiment.
microscope_name : str
The microscope name
Expand Down
6 changes: 3 additions & 3 deletions src/navigate/model/data_sources/pyramidal_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# POSSIBILITY OF SUCH DAMAGE.

# Standard library imports
from multiprocessing.managers import DictProxy
import logging
from typing import Any, Dict

# Third-party imports
import numpy as np
Expand Down Expand Up @@ -154,13 +154,13 @@ def nbytes(self) -> int:
).sum()

def set_metadata_from_configuration_experiment(
self, configuration: DictProxy, microscope_name: str = None
self, configuration: Dict[str, Any], microscope_name: str = None
) -> None:
"""Sets the metadata from according to the microscope configuration.

Parameters
----------
configuration : DictProxy
configuration : Dict[str, Any]
The configuration experiment.
microscope_name : str
The microscope name
Expand Down
Loading
Loading