sl-shared-assets 4.0.0__py3-none-any.whl → 5.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sl-shared-assets might be problematic. Click here for more details.
- sl_shared_assets/__init__.py +45 -42
- sl_shared_assets/command_line_interfaces/__init__.py +3 -0
- sl_shared_assets/command_line_interfaces/configure.py +173 -0
- sl_shared_assets/command_line_interfaces/manage.py +226 -0
- sl_shared_assets/data_classes/__init__.py +33 -32
- sl_shared_assets/data_classes/configuration_data.py +267 -79
- sl_shared_assets/data_classes/runtime_data.py +11 -11
- sl_shared_assets/data_classes/session_data.py +226 -289
- sl_shared_assets/data_classes/surgery_data.py +6 -6
- sl_shared_assets/server/__init__.py +24 -4
- sl_shared_assets/server/job.py +6 -7
- sl_shared_assets/server/pipeline.py +570 -0
- sl_shared_assets/server/server.py +57 -25
- sl_shared_assets/tools/__init__.py +9 -8
- sl_shared_assets/tools/packaging_tools.py +14 -25
- sl_shared_assets/tools/project_management_tools.py +602 -523
- sl_shared_assets/tools/transfer_tools.py +88 -23
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/METADATA +46 -202
- sl_shared_assets-5.0.0.dist-info/RECORD +23 -0
- sl_shared_assets-5.0.0.dist-info/entry_points.txt +3 -0
- sl_shared_assets/__init__.pyi +0 -91
- sl_shared_assets/cli.py +0 -500
- sl_shared_assets/cli.pyi +0 -106
- sl_shared_assets/data_classes/__init__.pyi +0 -75
- sl_shared_assets/data_classes/configuration_data.pyi +0 -235
- sl_shared_assets/data_classes/runtime_data.pyi +0 -157
- sl_shared_assets/data_classes/session_data.pyi +0 -379
- sl_shared_assets/data_classes/surgery_data.pyi +0 -89
- sl_shared_assets/server/__init__.pyi +0 -11
- sl_shared_assets/server/job.pyi +0 -205
- sl_shared_assets/server/server.pyi +0 -298
- sl_shared_assets/tools/__init__.pyi +0 -19
- sl_shared_assets/tools/ascension_tools.py +0 -265
- sl_shared_assets/tools/ascension_tools.pyi +0 -68
- sl_shared_assets/tools/packaging_tools.pyi +0 -58
- sl_shared_assets/tools/project_management_tools.pyi +0 -239
- sl_shared_assets/tools/transfer_tools.pyi +0 -53
- sl_shared_assets-4.0.0.dist-info/RECORD +0 -36
- sl_shared_assets-4.0.0.dist-info/entry_points.txt +0 -7
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/WHEEL +0 -0
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
from enum import StrEnum
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from dataclasses import field, dataclass
|
|
4
|
-
|
|
5
|
-
from _typeshed import Incomplete
|
|
6
|
-
from ataraxis_data_structures import YamlConfig
|
|
7
|
-
|
|
8
|
-
class AcquisitionSystems(StrEnum):
|
|
9
|
-
"""Defines the set of data acquisition systems used in the Sun lab and supported by all data-related libraries."""
|
|
10
|
-
|
|
11
|
-
MESOSCOPE_VR = "mesoscope-vr"
|
|
12
|
-
|
|
13
|
-
@dataclass()
|
|
14
|
-
class ExperimentState:
|
|
15
|
-
"""Encapsulates the information used to set and maintain the desired experiment and system state.
|
|
16
|
-
|
|
17
|
-
Broadly, each experiment runtime can be conceptualized as a two-state-system. The first is the experiment task,
|
|
18
|
-
which reflects the behavior goal, the rules for achieving the goal, and the reward for achieving the goal. The
|
|
19
|
-
second is the data acquisition system state, which is a snapshot of all hardware module states that make up the
|
|
20
|
-
system that acquires the data and controls the task environment. Overall, the experiment state is about
|
|
21
|
-
'what the animal is doing', while the system state is about 'what the hardware is doing'.
|
|
22
|
-
|
|
23
|
-
Note:
|
|
24
|
-
This class is acquisition-system-agnostic. It can be used to define the ExperimentConfiguration class for any
|
|
25
|
-
valid data acquisition system.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
experiment_state_code: int
|
|
29
|
-
system_state_code: int
|
|
30
|
-
state_duration_s: float
|
|
31
|
-
initial_guided_trials: int
|
|
32
|
-
recovery_failed_trial_threshold: int
|
|
33
|
-
recovery_guided_trials: int
|
|
34
|
-
|
|
35
|
-
@dataclass()
|
|
36
|
-
class ExperimentTrial:
|
|
37
|
-
"""Encapsulates information about a single experiment trial.
|
|
38
|
-
|
|
39
|
-
All Virtual Reality tasks can be broadly conceptualized as repeating motifs (sequences) of wall cues,
|
|
40
|
-
associated with a specific goal, for which animals receive water rewards. Since some experiments can use multiple
|
|
41
|
-
trial types as part of the same experiment session, multiple instances of this class can be used to specify
|
|
42
|
-
supported trial structures and trial parameters for a given experiment.
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
cue_sequence: list[int]
|
|
46
|
-
trial_length_cm: float
|
|
47
|
-
trial_reward_size_ul: float
|
|
48
|
-
reward_zone_start_cm: float
|
|
49
|
-
reward_zone_end_cm: float
|
|
50
|
-
guidance_trigger_location_cm: float
|
|
51
|
-
|
|
52
|
-
@dataclass()
|
|
53
|
-
class MesoscopeExperimentConfiguration(YamlConfig):
|
|
54
|
-
"""Stores the configuration of a single experiment runtime that uses the Mesoscope_VR data acquisition system.
|
|
55
|
-
|
|
56
|
-
Primarily, this includes the sequence of experiment and system states that define the flow of the experiment
|
|
57
|
-
runtime and the configuration of various trials supported by the experiment runtime. During runtime, the main
|
|
58
|
-
runtime control function traverses the sequence of states stored in this class instance start-to-end in the exact
|
|
59
|
-
order specified by the user. Together with custom Unity projects, which define the task logic (how the system
|
|
60
|
-
responds to animal interactions with the VR system), this class allows flexibly implementing a wide range of
|
|
61
|
-
experiments using the Mesoscope-VR system.
|
|
62
|
-
|
|
63
|
-
Each project should define one or more experiment configurations and save them as .yaml files inside the project
|
|
64
|
-
'configuration' folder. The name for each configuration file is defined by the user and is used to identify and load
|
|
65
|
-
the experiment configuration when the 'sl-experiment' CLI command exposed by the sl-experiment library is executed.
|
|
66
|
-
|
|
67
|
-
Notes:
|
|
68
|
-
This class is designed exclusively for the Mesoscope-VR system. Any other system needs to define a separate
|
|
69
|
-
ExperimentConfiguration class to specify its experiment runtimes and additional data.
|
|
70
|
-
|
|
71
|
-
To create a new experiment configuration, use the 'sl-create-experiment' CLI command.
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
cue_map: dict[int, float] = field(default_factory=Incomplete)
|
|
75
|
-
cue_offset_cm: float = ...
|
|
76
|
-
unity_scene_name: str = ...
|
|
77
|
-
experiment_states: dict[str, ExperimentState] = field(default_factory=Incomplete)
|
|
78
|
-
trial_structures: dict[str, ExperimentTrial] = field(default_factory=Incomplete)
|
|
79
|
-
|
|
80
|
-
@dataclass()
|
|
81
|
-
class MesoscopePaths:
|
|
82
|
-
"""Stores the filesystem configuration parameters for the Mesoscope-VR data acquisition system."""
|
|
83
|
-
|
|
84
|
-
server_credentials_path: Path = ...
|
|
85
|
-
google_credentials_path: Path = ...
|
|
86
|
-
root_directory: Path = ...
|
|
87
|
-
server_storage_directory: Path = ...
|
|
88
|
-
server_working_directory: Path = ...
|
|
89
|
-
nas_directory: Path = ...
|
|
90
|
-
mesoscope_directory: Path = ...
|
|
91
|
-
harvesters_cti_path: Path = ...
|
|
92
|
-
|
|
93
|
-
@dataclass()
|
|
94
|
-
class MesoscopeSheets:
|
|
95
|
-
"""Stores the IDs of Google Sheets used by the Mesoscope-VR data acquisition system."""
|
|
96
|
-
|
|
97
|
-
surgery_sheet_id: str = ...
|
|
98
|
-
water_log_sheet_id: str = ...
|
|
99
|
-
|
|
100
|
-
@dataclass()
|
|
101
|
-
class MesoscopeCameras:
|
|
102
|
-
"""Stores the configuration parameters for the cameras used by the Mesoscope-VR system to record behavior videos."""
|
|
103
|
-
|
|
104
|
-
face_camera_index: int = ...
|
|
105
|
-
left_camera_index: int = ...
|
|
106
|
-
right_camera_index: int = ...
|
|
107
|
-
face_camera_quantization_parameter: int = ...
|
|
108
|
-
body_camera_quantization_parameter: int = ...
|
|
109
|
-
display_face_camera_frames: bool = ...
|
|
110
|
-
display_body_camera_frames: bool = ...
|
|
111
|
-
|
|
112
|
-
@dataclass()
|
|
113
|
-
class MesoscopeMicroControllers:
|
|
114
|
-
"""Stores the configuration parameters for the microcontrollers used by the Mesoscope-VR system."""
|
|
115
|
-
|
|
116
|
-
actor_port: str = ...
|
|
117
|
-
sensor_port: str = ...
|
|
118
|
-
encoder_port: str = ...
|
|
119
|
-
debug: bool = ...
|
|
120
|
-
minimum_break_strength_g_cm: float = ...
|
|
121
|
-
maximum_break_strength_g_cm: float = ...
|
|
122
|
-
wheel_diameter_cm: float = ...
|
|
123
|
-
lick_threshold_adc: int = ...
|
|
124
|
-
lick_signal_threshold_adc: int = ...
|
|
125
|
-
lick_delta_threshold_adc: int = ...
|
|
126
|
-
lick_averaging_pool_size: int = ...
|
|
127
|
-
torque_baseline_voltage_adc: int = ...
|
|
128
|
-
torque_maximum_voltage_adc: int = ...
|
|
129
|
-
torque_sensor_capacity_g_cm: float = ...
|
|
130
|
-
torque_report_cw: bool = ...
|
|
131
|
-
torque_report_ccw: bool = ...
|
|
132
|
-
torque_signal_threshold_adc: int = ...
|
|
133
|
-
torque_delta_threshold_adc: int = ...
|
|
134
|
-
torque_averaging_pool_size: int = ...
|
|
135
|
-
wheel_encoder_ppr: int = ...
|
|
136
|
-
wheel_encoder_report_cw: bool = ...
|
|
137
|
-
wheel_encoder_report_ccw: bool = ...
|
|
138
|
-
wheel_encoder_delta_threshold_pulse: int = ...
|
|
139
|
-
wheel_encoder_polling_delay_us: int = ...
|
|
140
|
-
cm_per_unity_unit: float = ...
|
|
141
|
-
screen_trigger_pulse_duration_ms: int = ...
|
|
142
|
-
auditory_tone_duration_ms: int = ...
|
|
143
|
-
valve_calibration_pulse_count: int = ...
|
|
144
|
-
sensor_polling_delay_ms: int = ...
|
|
145
|
-
valve_calibration_data: dict[int | float, int | float] | tuple[tuple[int | float, int | float], ...] = ...
|
|
146
|
-
|
|
147
|
-
@dataclass()
|
|
148
|
-
class MesoscopeAdditionalFirmware:
|
|
149
|
-
"""Stores the configuration parameters for all firmware and hardware components not assembled in the Sun lab."""
|
|
150
|
-
|
|
151
|
-
headbar_port: str = ...
|
|
152
|
-
lickport_port: str = ...
|
|
153
|
-
wheel_port: str = ...
|
|
154
|
-
unity_ip: str = ...
|
|
155
|
-
unity_port: int = ...
|
|
156
|
-
|
|
157
|
-
@dataclass()
|
|
158
|
-
class MesoscopeSystemConfiguration(YamlConfig):
|
|
159
|
-
"""Stores the hardware and filesystem configuration parameters for the Mesoscope-VR data acquisition system used in
|
|
160
|
-
the Sun lab.
|
|
161
|
-
|
|
162
|
-
This class is specifically designed to encapsulate the configuration parameters for the Mesoscope-VR system. It
|
|
163
|
-
expects the system to be configured according to the specifications available from the sl_experiment repository
|
|
164
|
-
(https://github.com/Sun-Lab-NBB/sl-experiment) and should be used exclusively by the VRPC machine
|
|
165
|
-
(main Mesoscope-VR PC).
|
|
166
|
-
|
|
167
|
-
Notes:
|
|
168
|
-
Each SystemConfiguration class is uniquely tied to a specific hardware configuration used in the lab. This
|
|
169
|
-
class will only work with the Mesoscope-VR system. Any other data acquisition and runtime management system in
|
|
170
|
-
the lab should define its own SystemConfiguration class to specify its own hardware and filesystem configuration
|
|
171
|
-
parameters.
|
|
172
|
-
"""
|
|
173
|
-
|
|
174
|
-
name: str = ...
|
|
175
|
-
paths: MesoscopePaths = field(default_factory=MesoscopePaths)
|
|
176
|
-
sheets: MesoscopeSheets = field(default_factory=MesoscopeSheets)
|
|
177
|
-
cameras: MesoscopeCameras = field(default_factory=MesoscopeCameras)
|
|
178
|
-
microcontrollers: MesoscopeMicroControllers = field(default_factory=MesoscopeMicroControllers)
|
|
179
|
-
additional_firmware: MesoscopeAdditionalFirmware = field(default_factory=MesoscopeAdditionalFirmware)
|
|
180
|
-
def __post_init__(self) -> None:
|
|
181
|
-
"""Ensures that variables converted to different types for storage purposes are always set to expected types
|
|
182
|
-
upon class instantiation."""
|
|
183
|
-
def save(self, path: Path) -> None:
|
|
184
|
-
"""Saves class instance data to disk as a 'mesoscope_system_configuration.yaml' file.
|
|
185
|
-
|
|
186
|
-
This method converts certain class variables to yaml-safe types (for example, Path objects -> strings) and
|
|
187
|
-
saves class data to disk as a .yaml file. The method is intended to be used solely by the
|
|
188
|
-
set_system_configuration_file() function and should not be called from any other context.
|
|
189
|
-
|
|
190
|
-
Args:
|
|
191
|
-
path: The path to the .yaml file to save the data to.
|
|
192
|
-
"""
|
|
193
|
-
|
|
194
|
-
_supported_configuration_files: Incomplete
|
|
195
|
-
|
|
196
|
-
def set_system_configuration_file(path: Path) -> None:
|
|
197
|
-
"""Sets the system configuration .yaml file specified by the input path as the default system configuration file for
|
|
198
|
-
the managed machine (PC).
|
|
199
|
-
|
|
200
|
-
This function is used to initially configure or override the existing configuration of any data acquisition system
|
|
201
|
-
used in the lab. The path to the configuration file is stored inside the user's data directory so that all
|
|
202
|
-
Sun lab libraries can automatically access that information during every runtime. Since the storage directory is
|
|
203
|
-
typically hidden and varies between OSes and machines, this function provides a convenient way for setting that
|
|
204
|
-
path without manually editing the storage cache.
|
|
205
|
-
|
|
206
|
-
Notes:
|
|
207
|
-
If the input path does not point to an existing file, but the file name and extension are correct, the function
|
|
208
|
-
will automatically generate a default SystemConfiguration class instance and save it under the specified path.
|
|
209
|
-
|
|
210
|
-
A data acquisition system can include multiple machines (PCs). However, the configuration file is typically
|
|
211
|
-
only present on the 'main' machine that manages all runtimes.
|
|
212
|
-
|
|
213
|
-
Args:
|
|
214
|
-
path: The path to the new system configuration file to be used by the local data acquisition system (PC).
|
|
215
|
-
|
|
216
|
-
Raises:
|
|
217
|
-
ValueError: If the input path is not a valid system configuration file or does not use a supported data
|
|
218
|
-
acquisition system name.
|
|
219
|
-
"""
|
|
220
|
-
|
|
221
|
-
def get_system_configuration_data() -> MesoscopeSystemConfiguration:
|
|
222
|
-
"""Resolves the path to the local system configuration file and loads the system configuration data.
|
|
223
|
-
|
|
224
|
-
This service function is used by all Sun lab data acquisition runtimes to load the system configuration data from
|
|
225
|
-
the shared configuration file. It supports resolving and returning the data for all data acquisition systems used
|
|
226
|
-
in the lab.
|
|
227
|
-
|
|
228
|
-
Returns:
|
|
229
|
-
The initialized SystemConfiguration class instance for the local acquisition system that stores the loaded
|
|
230
|
-
configuration parameters.
|
|
231
|
-
|
|
232
|
-
Raises:
|
|
233
|
-
FileNotFoundError: If the local machine does not have the Sun lab data directory, or the system configuration
|
|
234
|
-
file does not exist.
|
|
235
|
-
"""
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
|
|
3
|
-
from ataraxis_data_structures import YamlConfig
|
|
4
|
-
|
|
5
|
-
@dataclass()
|
|
6
|
-
class MesoscopeHardwareState(YamlConfig):
|
|
7
|
-
"""Stores configuration parameters (states) of the Mesoscope-VR system hardware modules used during training or
|
|
8
|
-
experiment runtime.
|
|
9
|
-
|
|
10
|
-
This information is used to read and decode the data saved to the .npz log files during runtime as part of data
|
|
11
|
-
processing.
|
|
12
|
-
|
|
13
|
-
Notes:
|
|
14
|
-
This class stores 'static' Mesoscope-VR system configuration that does not change during experiment or training
|
|
15
|
-
session runtime. This is in contrast to MesoscopeExperimentConfiguration class, which reflects the 'dynamic'
|
|
16
|
-
state of the Mesoscope-VR system during each experiment.
|
|
17
|
-
|
|
18
|
-
This class partially overlaps with the MesoscopeSystemConfiguration class, which is also stored in the
|
|
19
|
-
raw_data folder of each session. The primary reason to keep both classes is to ensure that the math (rounding)
|
|
20
|
-
used during runtime matches the math (rounding) used during data processing. MesoscopeSystemConfiguration does
|
|
21
|
-
not do any rounding or otherwise attempt to be repeatable, which is in contrast to hardware modules that read
|
|
22
|
-
and apply those parameters. Reading values from this class guarantees the read value exactly matches the value
|
|
23
|
-
used during runtime.
|
|
24
|
-
|
|
25
|
-
Notes:
|
|
26
|
-
All fields in this dataclass initialize to None. During log processing, any log associated with a hardware
|
|
27
|
-
module that provides the data stored in a field will be processed, unless that field is None. Therefore, setting
|
|
28
|
-
any field in this dataclass to None also functions as a flag for whether to parse the log associated with the
|
|
29
|
-
module that provides this field's information.
|
|
30
|
-
|
|
31
|
-
This class is automatically configured by _MesoscopeVRSystem class from the sl-experiment library to facilitate
|
|
32
|
-
proper log parsing.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
cm_per_pulse: float | None = ...
|
|
36
|
-
maximum_break_strength: float | None = ...
|
|
37
|
-
minimum_break_strength: float | None = ...
|
|
38
|
-
lick_threshold: int | None = ...
|
|
39
|
-
valve_scale_coefficient: float | None = ...
|
|
40
|
-
valve_nonlinearity_exponent: float | None = ...
|
|
41
|
-
torque_per_adc_unit: float | None = ...
|
|
42
|
-
screens_initially_on: bool | None = ...
|
|
43
|
-
recorded_mesoscope_ttl: bool | None = ...
|
|
44
|
-
system_state_codes: dict[str, int] | None = ...
|
|
45
|
-
|
|
46
|
-
@dataclass()
|
|
47
|
-
class LickTrainingDescriptor(YamlConfig):
|
|
48
|
-
"""Stores the task and outcome information specific to lick training sessions that use the Mesoscope-VR system."""
|
|
49
|
-
|
|
50
|
-
experimenter: str
|
|
51
|
-
mouse_weight_g: float
|
|
52
|
-
minimum_reward_delay_s: int
|
|
53
|
-
maximum_reward_delay_s: int
|
|
54
|
-
maximum_water_volume_ml: float
|
|
55
|
-
maximum_training_time_m: int
|
|
56
|
-
maximum_unconsumed_rewards: int = ...
|
|
57
|
-
dispensed_water_volume_ml: float = ...
|
|
58
|
-
pause_dispensed_water_volume_ml: float = ...
|
|
59
|
-
experimenter_notes: str = ...
|
|
60
|
-
experimenter_given_water_volume_ml: float = ...
|
|
61
|
-
preferred_session_water_volume_ml: float = ...
|
|
62
|
-
incomplete: bool = ...
|
|
63
|
-
|
|
64
|
-
@dataclass()
|
|
65
|
-
class RunTrainingDescriptor(YamlConfig):
|
|
66
|
-
"""Stores the task and outcome information specific to run training sessions that use the Mesoscope-VR system."""
|
|
67
|
-
|
|
68
|
-
experimenter: str
|
|
69
|
-
mouse_weight_g: float
|
|
70
|
-
final_run_speed_threshold_cm_s: float
|
|
71
|
-
final_run_duration_threshold_s: float
|
|
72
|
-
initial_run_speed_threshold_cm_s: float
|
|
73
|
-
initial_run_duration_threshold_s: float
|
|
74
|
-
increase_threshold_ml: float
|
|
75
|
-
run_speed_increase_step_cm_s: float
|
|
76
|
-
run_duration_increase_step_s: float
|
|
77
|
-
maximum_water_volume_ml: float
|
|
78
|
-
maximum_training_time_m: int
|
|
79
|
-
maximum_unconsumed_rewards: int = ...
|
|
80
|
-
maximum_idle_time_s: float = ...
|
|
81
|
-
dispensed_water_volume_ml: float = ...
|
|
82
|
-
pause_dispensed_water_volume_ml: float = ...
|
|
83
|
-
experimenter_notes: str = ...
|
|
84
|
-
experimenter_given_water_volume_ml: float = ...
|
|
85
|
-
preferred_session_water_volume_ml: float = ...
|
|
86
|
-
incomplete: bool = ...
|
|
87
|
-
|
|
88
|
-
@dataclass()
|
|
89
|
-
class MesoscopeExperimentDescriptor(YamlConfig):
|
|
90
|
-
"""Stores the task and outcome information specific to experiment sessions that use the Mesoscope-VR system."""
|
|
91
|
-
|
|
92
|
-
experimenter: str
|
|
93
|
-
mouse_weight_g: float
|
|
94
|
-
maximum_unconsumed_rewards: int = ...
|
|
95
|
-
dispensed_water_volume_ml: float = ...
|
|
96
|
-
pause_dispensed_water_volume_ml: float = ...
|
|
97
|
-
experimenter_notes: str = ...
|
|
98
|
-
experimenter_given_water_volume_ml: float = ...
|
|
99
|
-
preferred_session_water_volume_ml: float = ...
|
|
100
|
-
incomplete: bool = ...
|
|
101
|
-
|
|
102
|
-
@dataclass()
|
|
103
|
-
class WindowCheckingDescriptor(YamlConfig):
|
|
104
|
-
"""Stores the outcome information specific to window checking sessions that use the Mesoscope-VR system.
|
|
105
|
-
|
|
106
|
-
Notes:
|
|
107
|
-
Window Checking sessions are different from all other sessions. Unlike other sessions, their purpose is not to
|
|
108
|
-
generate data but rather to assess the suitability of the particular animal to be included in training and
|
|
109
|
-
experiment cohorts. These sessions are automatically excluded from any automated data processing and analysis.
|
|
110
|
-
"""
|
|
111
|
-
|
|
112
|
-
experimenter: str
|
|
113
|
-
experimenter_notes: str = ...
|
|
114
|
-
surgery_quality: int = ...
|
|
115
|
-
incomplete: bool = ...
|
|
116
|
-
|
|
117
|
-
@dataclass()
|
|
118
|
-
class ZaberPositions(YamlConfig):
|
|
119
|
-
"""Stores Zaber motor positions reused between experiment sessions that use the Mesoscope-VR system.
|
|
120
|
-
|
|
121
|
-
The class is specifically designed to store, save, and load the positions of the LickPort, HeadBar, and Wheel motors
|
|
122
|
-
(axes). It is used to both store Zaber motor positions for each session for future analysis and to restore the
|
|
123
|
-
Zaber motors to the same positions across consecutive runtimes for the same project and animal combination.
|
|
124
|
-
|
|
125
|
-
Notes:
|
|
126
|
-
By default, the class initializes all fields to 0, which is the position of the home sensor for each motor. The
|
|
127
|
-
class assumes that the motor groups are assembled and arranged in a way that ensures all motors can safely move
|
|
128
|
-
to the home sensor positions from any runtime configuration.
|
|
129
|
-
"""
|
|
130
|
-
|
|
131
|
-
headbar_z: int = ...
|
|
132
|
-
headbar_pitch: int = ...
|
|
133
|
-
headbar_roll: int = ...
|
|
134
|
-
lickport_z: int = ...
|
|
135
|
-
lickport_y: int = ...
|
|
136
|
-
lickport_x: int = ...
|
|
137
|
-
wheel_x: int = ...
|
|
138
|
-
|
|
139
|
-
@dataclass()
|
|
140
|
-
class MesoscopePositions(YamlConfig):
|
|
141
|
-
"""Stores the positions of real and virtual Mesoscope objective axes reused between experiment sessions that use the
|
|
142
|
-
Mesoscope-VR system.
|
|
143
|
-
|
|
144
|
-
This class is designed to help the experimenter move the Mesoscope to the same imaging plane across imaging
|
|
145
|
-
sessions. It stores both the physical (real) position of the objective along the motorized X, Y, Z, and Roll axes,
|
|
146
|
-
and the virtual (ScanImage software) tip, tilt, and fastZ (virtual zoom) axes.
|
|
147
|
-
"""
|
|
148
|
-
|
|
149
|
-
mesoscope_x: float = ...
|
|
150
|
-
mesoscope_y: float = ...
|
|
151
|
-
mesoscope_roll: float = ...
|
|
152
|
-
mesoscope_z: float = ...
|
|
153
|
-
mesoscope_fast_z: float = ...
|
|
154
|
-
mesoscope_tip: float = ...
|
|
155
|
-
mesoscope_tilt: float = ...
|
|
156
|
-
laser_power_mw: float = ...
|
|
157
|
-
red_dot_alignment_z: float = ...
|