Skip to content

Commit f80592e

Browse files
Merge pull request #1011 from TheDeanLab/1008-laser-digital-only-modulation-doesnt-work
1008 laser digital only modulation doesnt work
2 parents 2f416f4 + 6589ca7 commit f80592e

40 files changed

+886
-527
lines changed

src/navigate/model/data_sources/bdv_data_source.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
# Standard Imports
3333
import os
34-
from multiprocessing.managers import DictProxy
3534
import logging
35+
from typing import Any, Dict
3636

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

121121
def set_metadata_from_configuration_experiment(
122-
self, configuration: DictProxy, microscope_name: str = None
122+
self, configuration: Dict[str, Any], microscope_name: str = None
123123
) -> None:
124124
"""Sets the metadata from according to the microscope configuration.
125125
126126
Parameters
127127
----------
128-
configuration : DictProxy
128+
configuration : Dict[str, Any]
129129
The configuration experiment.
130130
microscope_name : str
131131
The microscope name

src/navigate/model/data_sources/data_source.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232

3333
# Standard Library Imports
3434
import logging
35+
from typing import Any, Dict
3536

3637
# Third Party Imports
3738
import numpy.typing as npt
3839

3940
# Local Imports
40-
from multiprocessing.managers import DictProxy
4141

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

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

81-
#: bool: Has the data source been closed?
81+
# bool: Has the data source been closed?
8282
self._closed = True
8383

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

101101
#: int: Size of the data source in x dimension.
102+
self.shape_x = 1
103+
102104
#: int: Size of the data source in y dimension.
105+
self.shape_y = 1
106+
103107
#: int: Size of the data source in z dimension.
108+
self.shape_z = 1
109+
104110
#: int: Size of the data source in t dimension.
111+
self.shape_t = 1
112+
105113
#: int: Size of the data source in c dimension.
106-
self.shape_x, self.shape_y, self.shape_z, self.shape_t, self.shape_c = (
107-
1,
108-
1,
109-
1,
110-
1,
111-
1,
112-
)
114+
self.shape_c = 1
115+
113116
#: int: Number of positions in the data source.
114117
self.positions = 1
115118

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

122125
@property
123126
def nbytes(self) -> int:
124-
"""Getter for the size of this data source in bytes."
127+
"""Getter for the size of this data source in bytes.
125128
126129
Does not account for pyramidal data sources. That process is handled by the
127130
bdv_data_source class, which is a child of this class.
128131
129132
Returns
130133
-------
131-
int
134+
total_bytes : int
132135
Size of this data source in bytes.
133136
"""
134137
total_bits = (
@@ -216,13 +219,13 @@ def setup(self):
216219
pass
217220

218221
def set_metadata_from_configuration_experiment(
219-
self, configuration: DictProxy, microscope_name: str = None
222+
self, configuration: Dict[str, Any], microscope_name: str = None
220223
) -> None:
221224
"""Sets the metadata from according to the microscope configuration.
222225
223226
Parameters
224227
----------
225-
configuration : DictProxy
228+
configuration : Dict[str, Any]
226229
Configuration experiment.
227230
microscope_name : str
228231
The microscope name

src/navigate/model/data_sources/pyramidal_data_source.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
# POSSIBILITY OF SUCH DAMAGE.
3232

3333
# Standard library imports
34-
from multiprocessing.managers import DictProxy
3534
import logging
35+
from typing import Any, Dict
3636

3737
# Third-party imports
3838
import numpy as np
@@ -154,13 +154,13 @@ def nbytes(self) -> int:
154154
).sum()
155155

156156
def set_metadata_from_configuration_experiment(
157-
self, configuration: DictProxy, microscope_name: str = None
157+
self, configuration: Dict[str, Any], microscope_name: str = None
158158
) -> None:
159159
"""Sets the metadata from according to the microscope configuration.
160160
161161
Parameters
162162
----------
163-
configuration : DictProxy
163+
configuration : Dict[str, Any]
164164
The configuration experiment.
165165
microscope_name : str
166166
The microscope name

0 commit comments

Comments
 (0)