sl-shared-assets 1.0.0rc14__tar.gz → 1.0.0rc16__tar.gz
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-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/PKG-INFO +1 -1
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/source/api.rst +7 -21
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/pyproject.toml +1 -1
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/src/sl_shared_assets/__init__.py +21 -9
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/src/sl_shared_assets/cli.py +1 -1
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/data_classes/__init__.py +63 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/data_classes/configuration_data.py +64 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/data_classes/runtime_data.py +233 -0
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/data_classes.py → sl_shared_assets-1.0.0rc16/src/sl_shared_assets/data_classes/session_data.py +60 -481
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/data_classes/surgery_data.py +152 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/server/__init__.py +8 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/server/job.py +140 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/server/server.py +213 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/suite2p/__init__.py +8 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/suite2p/multi_day.py +225 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/suite2p/single_day.py +563 -0
- sl_shared_assets-1.0.0rc16/src/sl_shared_assets/tools/__init__.py +8 -0
- {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc16/src/sl_shared_assets/tools}/ascension_tools.py +3 -2
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/__init__.pyi +0 -51
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/ascension_tools.pyi +0 -68
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/cli.pyi +0 -28
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/data_classes.pyi +0 -799
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/packaging_tools.pyi +0 -52
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/server.py +0 -300
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/server.pyi +0 -117
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/suite2p.py +0 -456
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/suite2p.pyi +0 -188
- sl_shared_assets-1.0.0rc14/src/sl_shared_assets/transfer_tools.pyi +0 -53
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/.gitignore +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/LICENSE +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/README.md +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/Makefile +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/make.bat +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/source/conf.py +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/source/index.rst +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/docs/source/welcome.rst +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/envs/slsa_dev_lin.yml +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/envs/slsa_dev_lin_spec.txt +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/src/sl_shared_assets/py.typed +0 -0
- {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc16/src/sl_shared_assets/tools}/packaging_tools.py +0 -0
- {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc16/src/sl_shared_assets/tools}/transfer_tools.py +0 -0
- {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc16}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sl-shared-assets
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0rc16
|
|
4
4
|
Summary: Stores assets shared between multiple Sun (NeuroAI) lab data pipelines.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Sun-Lab-NBB/sl-shared-assets
|
|
6
6
|
Project-URL: Documentation, https://sl-shared-assets-api-docs.netlify.app/
|
|
@@ -21,29 +21,22 @@ Command Line Interfaces
|
|
|
21
21
|
:prog: sl-ascend
|
|
22
22
|
:nested: full
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.. automodule:: sl_shared_assets.
|
|
24
|
+
Tools
|
|
25
|
+
=====
|
|
26
|
+
.. automodule:: sl_shared_assets.tools
|
|
27
27
|
:members:
|
|
28
28
|
:undoc-members:
|
|
29
29
|
:show-inheritance:
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.. automodule:: sl_shared_assets.transfer_tools
|
|
34
|
-
:members:
|
|
35
|
-
:undoc-members:
|
|
36
|
-
:show-inheritance:
|
|
37
|
-
|
|
38
|
-
Suite2P Configuration Classes
|
|
39
|
-
=============================
|
|
31
|
+
Suite2P Configuration
|
|
32
|
+
=====================
|
|
40
33
|
.. automodule:: sl_shared_assets.suite2p
|
|
41
34
|
:members:
|
|
42
35
|
:undoc-members:
|
|
43
36
|
:show-inheritance:
|
|
44
37
|
|
|
45
|
-
General
|
|
46
|
-
|
|
38
|
+
General Data and Configuration Classes
|
|
39
|
+
======================================
|
|
47
40
|
.. automodule:: sl_shared_assets.data_classes
|
|
48
41
|
:members:
|
|
49
42
|
:undoc-members:
|
|
@@ -55,10 +48,3 @@ Compute Server Tools
|
|
|
55
48
|
:members:
|
|
56
49
|
:undoc-members:
|
|
57
50
|
:show-inheritance:
|
|
58
|
-
|
|
59
|
-
Ascension Tools
|
|
60
|
-
===============
|
|
61
|
-
.. automodule:: sl_shared_assets.ascension_tools
|
|
62
|
-
:members:
|
|
63
|
-
:undoc-members:
|
|
64
|
-
:show-inheritance:
|
|
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
|
|
|
8
8
|
# Project metdata section. Provides the genral ID information about the project.
|
|
9
9
|
[project]
|
|
10
10
|
name = "sl-shared-assets"
|
|
11
|
-
version = "1.0.
|
|
11
|
+
version = "1.0.0rc16"
|
|
12
12
|
description = "Stores assets shared between multiple Sun (NeuroAI) lab data pipelines."
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
license = { file = "LICENSE" }
|
|
@@ -7,31 +7,35 @@ Authors: Ivan Kondratyev (Inkaros), Kushaan Gupta, Yuantao Deng
|
|
|
7
7
|
|
|
8
8
|
from ataraxis_base_utilities import console
|
|
9
9
|
|
|
10
|
+
from .tools import transfer_directory, calculate_directory_checksum
|
|
10
11
|
from .server import Server, ServerCredentials
|
|
11
|
-
from .suite2p import
|
|
12
|
-
Suite2PConfiguration,
|
|
13
|
-
)
|
|
12
|
+
from .suite2p import MultiDayS2PConfiguration, SingleDayS2PConfiguration
|
|
14
13
|
from .data_classes import (
|
|
14
|
+
RawData,
|
|
15
15
|
DrugData,
|
|
16
16
|
ImplantData,
|
|
17
17
|
SessionData,
|
|
18
18
|
SubjectData,
|
|
19
19
|
SurgeryData,
|
|
20
20
|
InjectionData,
|
|
21
|
+
MesoscopeData,
|
|
21
22
|
ProcedureData,
|
|
23
|
+
ProcessedData,
|
|
24
|
+
DeepLabCutData,
|
|
22
25
|
ZaberPositions,
|
|
23
26
|
ExperimentState,
|
|
24
|
-
|
|
27
|
+
VRPCDestinations,
|
|
28
|
+
ConfigurationData,
|
|
25
29
|
MesoscopePositions,
|
|
30
|
+
VRPCPersistentData,
|
|
26
31
|
ProjectConfiguration,
|
|
27
32
|
HardwareConfiguration,
|
|
28
33
|
RunTrainingDescriptor,
|
|
29
34
|
LickTrainingDescriptor,
|
|
30
35
|
ExperimentConfiguration,
|
|
36
|
+
ScanImagePCPersistentData,
|
|
31
37
|
MesoscopeExperimentDescriptor,
|
|
32
38
|
)
|
|
33
|
-
from .transfer_tools import transfer_directory
|
|
34
|
-
from .packaging_tools import calculate_directory_checksum
|
|
35
39
|
|
|
36
40
|
# Ensures console is enabled when this library is imported
|
|
37
41
|
if not console.enabled:
|
|
@@ -41,12 +45,21 @@ __all__ = [
|
|
|
41
45
|
# Server module
|
|
42
46
|
"Server",
|
|
43
47
|
"ServerCredentials",
|
|
44
|
-
# Suite2p
|
|
45
|
-
"
|
|
48
|
+
# Suite2p package
|
|
49
|
+
"SingleDayS2PConfiguration",
|
|
50
|
+
"MultiDayS2PConfiguration",
|
|
46
51
|
# Data classes module
|
|
47
52
|
"DrugData",
|
|
48
53
|
"ImplantData",
|
|
49
54
|
"SessionData",
|
|
55
|
+
"RawData",
|
|
56
|
+
"ProcessedData",
|
|
57
|
+
"ConfigurationData",
|
|
58
|
+
"DeepLabCutData",
|
|
59
|
+
"VRPCPersistentData",
|
|
60
|
+
"ScanImagePCPersistentData",
|
|
61
|
+
"MesoscopeData",
|
|
62
|
+
"VRPCDestinations",
|
|
50
63
|
"SubjectData",
|
|
51
64
|
"SurgeryData",
|
|
52
65
|
"InjectionData",
|
|
@@ -60,7 +73,6 @@ __all__ = [
|
|
|
60
73
|
"LickTrainingDescriptor",
|
|
61
74
|
"ExperimentConfiguration",
|
|
62
75
|
"MesoscopeExperimentDescriptor",
|
|
63
|
-
"ProcessingTracker",
|
|
64
76
|
# Transfer tools module
|
|
65
77
|
"transfer_directory",
|
|
66
78
|
# Packaging tools module
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""This package provides the classes used to store data acquired at various stages of the data workflow and to
|
|
2
|
+
configure various pipelines used in the Sun lab. These classes are used across all stages of data acquisition,
|
|
3
|
+
preprocessing, and processing in the lab, across multiple machines (PCs). Many classes in this package are designed to
|
|
4
|
+
be saved to disk as .yaml files and restored from the .yaml files as needed."""
|
|
5
|
+
|
|
6
|
+
from .runtime_data import (
|
|
7
|
+
ZaberPositions,
|
|
8
|
+
MesoscopePositions,
|
|
9
|
+
HardwareConfiguration,
|
|
10
|
+
RunTrainingDescriptor,
|
|
11
|
+
LickTrainingDescriptor,
|
|
12
|
+
MesoscopeExperimentDescriptor,
|
|
13
|
+
)
|
|
14
|
+
from .session_data import (
|
|
15
|
+
RawData,
|
|
16
|
+
SessionData,
|
|
17
|
+
MesoscopeData,
|
|
18
|
+
ProcessedData,
|
|
19
|
+
DeepLabCutData,
|
|
20
|
+
VRPCDestinations,
|
|
21
|
+
ConfigurationData,
|
|
22
|
+
VRPCPersistentData,
|
|
23
|
+
ProjectConfiguration,
|
|
24
|
+
ScanImagePCPersistentData,
|
|
25
|
+
replace_root_path,
|
|
26
|
+
)
|
|
27
|
+
from .surgery_data import (
|
|
28
|
+
DrugData,
|
|
29
|
+
ImplantData,
|
|
30
|
+
SubjectData,
|
|
31
|
+
SurgeryData,
|
|
32
|
+
InjectionData,
|
|
33
|
+
ProcedureData,
|
|
34
|
+
)
|
|
35
|
+
from .configuration_data import ExperimentState, ExperimentConfiguration
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"DrugData",
|
|
39
|
+
"ImplantData",
|
|
40
|
+
"SessionData",
|
|
41
|
+
"RawData",
|
|
42
|
+
"ProcessedData",
|
|
43
|
+
"ConfigurationData",
|
|
44
|
+
"DeepLabCutData",
|
|
45
|
+
"VRPCPersistentData",
|
|
46
|
+
"ScanImagePCPersistentData",
|
|
47
|
+
"MesoscopeData",
|
|
48
|
+
"VRPCDestinations",
|
|
49
|
+
"SubjectData",
|
|
50
|
+
"SurgeryData",
|
|
51
|
+
"InjectionData",
|
|
52
|
+
"ProcedureData",
|
|
53
|
+
"ZaberPositions",
|
|
54
|
+
"ExperimentState",
|
|
55
|
+
"MesoscopePositions",
|
|
56
|
+
"ProjectConfiguration",
|
|
57
|
+
"HardwareConfiguration",
|
|
58
|
+
"RunTrainingDescriptor",
|
|
59
|
+
"LickTrainingDescriptor",
|
|
60
|
+
"ExperimentConfiguration",
|
|
61
|
+
"MesoscopeExperimentDescriptor",
|
|
62
|
+
"replace_root_path",
|
|
63
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""This module provides classes used to configure data acquisition and processing runtimes in the Sun lab.
|
|
2
|
+
Classes from this library are saved as .yaml files to be edited by the user when a new project and / or session
|
|
3
|
+
is created by the sl-experiment library. The runtime settings are then loaded from user-edited .yaml files by various
|
|
4
|
+
lab pipelines."""
|
|
5
|
+
|
|
6
|
+
import copy
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from dataclasses import field, dataclass
|
|
9
|
+
|
|
10
|
+
from ataraxis_data_structures import YamlConfig
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass()
|
|
14
|
+
class ExperimentState:
|
|
15
|
+
"""Encapsulates the information used to set and maintain the desired experiment and Mesoscope-VR system state.
|
|
16
|
+
|
|
17
|
+
Primarily, experiment runtime logic (task logic) is resolved by the Unity game engine. However, the Mesoscope-VR
|
|
18
|
+
system configuration may also need to change throughout the experiment to optimize the runtime by disabling or
|
|
19
|
+
reconfiguring specific hardware modules. For example, some experiment stages may require the running wheel to be
|
|
20
|
+
locked to prevent the animal from running, and other may require the VR screens to be turned off.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
experiment_state_code: int
|
|
24
|
+
"""The integer code of the experiment state. Experiment states do not have a predefined meaning, Instead, each
|
|
25
|
+
project is expected to define and follow its own experiment state code mapping. Typically, the experiment state
|
|
26
|
+
code is used to denote major experiment stages, such as 'baseline', 'task', 'cooldown', etc. Note, the same
|
|
27
|
+
experiment state code can be used by multiple sequential ExperimentState instances to change the VR system states
|
|
28
|
+
while maintaining the same experiment state."""
|
|
29
|
+
vr_state_code: int
|
|
30
|
+
"""One of the supported VR system state-codes. Currently, the Mesoscope-VR system supports two state codes. State
|
|
31
|
+
code '1' denotes 'REST' state and code '2' denotes 'RUN' state. Note, multiple consecutive ExperimentState
|
|
32
|
+
instances with different experiment state codes can reuse the same VR state code."""
|
|
33
|
+
state_duration_s: float
|
|
34
|
+
"""The time, in seconds, to maintain the current combination of the experiment and VR states."""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass()
|
|
38
|
+
class ExperimentConfiguration(YamlConfig):
|
|
39
|
+
"""Stores the configuration of a single experiment runtime.
|
|
40
|
+
|
|
41
|
+
Primarily, this includes the sequence of experiment and Virtual Reality (Mesoscope-VR) states that defines the flow
|
|
42
|
+
of the experiment runtime. During runtime, the main runtime control function traverses the sequence of states
|
|
43
|
+
stored in this class instance start-to-end in the exact order specified by the user. Together with custom Unity
|
|
44
|
+
projects that define the task logic (how the system responds to animal interactions with the VR system) this class
|
|
45
|
+
allows flexibly implementing a wide range of experiments.
|
|
46
|
+
|
|
47
|
+
Each project should define one or more experiment configurations and save them as .yaml files inside the project
|
|
48
|
+
'configuration' folder. The name for each configuration file is defined by the user and is used to identify and load
|
|
49
|
+
the experiment configuration when 'sl-run-experiment' CLI command exposed by the sl-experiment library is executed.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
cue_map: dict[int, float] = field(default_factory=lambda: {0: 30.0, 1: 30.0, 2: 30.0, 3: 30.0, 4: 30.0})
|
|
53
|
+
"""A dictionary that maps each integer-code associated with a wall cue used in the Virtual Reality experiment
|
|
54
|
+
environment to its length in real-world centimeters. It is used to map each VR cue to the distance the animal needs
|
|
55
|
+
to travel to fully traverse the wall cue region from start to end."""
|
|
56
|
+
experiment_states: dict[str, ExperimentState] = field(
|
|
57
|
+
default_factory=lambda: {
|
|
58
|
+
"baseline": ExperimentState(experiment_state_code=1, vr_state_code=1, state_duration_s=30),
|
|
59
|
+
"experiment": ExperimentState(experiment_state_code=2, vr_state_code=2, state_duration_s=120),
|
|
60
|
+
"cooldown": ExperimentState(experiment_state_code=3, vr_state_code=1, state_duration_s=15),
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
"""A dictionary that uses human-readable state-names as keys and ExperimentState instances as values. Each
|
|
64
|
+
ExperimentState instance represents a phase of the experiment."""
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"""This module provides classes used to store the training and experiment data acquired by the sl-experiment library.
|
|
2
|
+
Some classes from this library store raw data later processed by Sun lab data processing pipelines. Others are used to
|
|
3
|
+
restore the Mesoscope-VR system to the same state across training or experiment sessions of the same animal.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
from ataraxis_data_structures import YamlConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass()
|
|
12
|
+
class HardwareConfiguration(YamlConfig):
|
|
13
|
+
"""This class is used to save the runtime hardware configuration parameters as a .yaml file.
|
|
14
|
+
|
|
15
|
+
This information is used to read and decode the data saved to the .npz log files during runtime as part of data
|
|
16
|
+
processing.
|
|
17
|
+
|
|
18
|
+
Notes:
|
|
19
|
+
All fields in this dataclass initialize to None. During log processing, any log associated with a hardware
|
|
20
|
+
module that provides the data stored in a field will be processed, unless that field is None. Therefore, setting
|
|
21
|
+
any field in this dataclass to None also functions as a flag for whether to parse the log associated with the
|
|
22
|
+
module that provides this field's information.
|
|
23
|
+
|
|
24
|
+
This class is automatically configured by MesoscopeExperiment and BehaviorTraining classes from sl-experiment
|
|
25
|
+
library to facilitate log parsing.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
cue_map: dict[int, float] | None = None
|
|
29
|
+
"""MesoscopeExperiment instance property. Stores the dictionary that maps the integer id-codes associated with each
|
|
30
|
+
wall cue in the Virtual Reality task environment with distances in real-world centimeters animals should run on the
|
|
31
|
+
wheel to fully traverse the cue region on a linearized track."""
|
|
32
|
+
cm_per_pulse: float | None = None
|
|
33
|
+
"""EncoderInterface instance property. Stores the conversion factor used to translate encoder pulses into
|
|
34
|
+
real-world centimeters."""
|
|
35
|
+
maximum_break_strength: float | None = None
|
|
36
|
+
"""BreakInterface instance property. Stores the breaking torque, in Newton centimeters, applied by the break to
|
|
37
|
+
the edge of the running wheel when it is engaged at 100% strength."""
|
|
38
|
+
minimum_break_strength: float | None = None
|
|
39
|
+
"""BreakInterface instance property. Stores the breaking torque, in Newton centimeters, applied by the break to
|
|
40
|
+
the edge of the running wheel when it is engaged at 0% strength (completely disengaged)."""
|
|
41
|
+
lick_threshold: int | None = None
|
|
42
|
+
"""LickInterface instance property. Determines the threshold, in 12-bit Analog to Digital Converter (ADC) units,
|
|
43
|
+
above which an interaction value reported by the lick sensor is considered a lick (compared to noise or non-lick
|
|
44
|
+
touch)."""
|
|
45
|
+
valve_scale_coefficient: float | None = None
|
|
46
|
+
"""ValveInterface instance property. To dispense precise water volumes during runtime, ValveInterface uses power
|
|
47
|
+
law equation applied to valve calibration data to determine how long to keep the valve open. This stores the
|
|
48
|
+
scale_coefficient of the power law equation that describes the relationship between valve open time and dispensed
|
|
49
|
+
water volume, derived from calibration data."""
|
|
50
|
+
valve_nonlinearity_exponent: float | None = None
|
|
51
|
+
"""ValveInterface instance property. To dispense precise water volumes during runtime, ValveInterface uses power
|
|
52
|
+
law equation applied to valve calibration data to determine how long to keep the valve open. This stores the
|
|
53
|
+
nonlinearity_exponent of the power law equation that describes the relationship between valve open time and
|
|
54
|
+
dispensed water volume, derived from calibration data."""
|
|
55
|
+
torque_per_adc_unit: float | None = None
|
|
56
|
+
"""TorqueInterface instance property. Stores the conversion factor used to translate torque values reported by the
|
|
57
|
+
sensor as 12-bit Analog to Digital Converter (ADC) units, into real-world Newton centimeters (N·cm) of torque that
|
|
58
|
+
had to be applied to the edge of the running wheel to produce the observed ADC value."""
|
|
59
|
+
screens_initially_on: bool | None = None
|
|
60
|
+
"""ScreenInterface instance property. Stores the initial state of the Virtual Reality screens at the beginning of
|
|
61
|
+
the session runtime."""
|
|
62
|
+
recorded_mesoscope_ttl: bool | None = None
|
|
63
|
+
"""TTLInterface instance property. A boolean flag that determines whether the processed session recorded brain
|
|
64
|
+
activity data with the mesoscope."""
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@dataclass()
|
|
68
|
+
class LickTrainingDescriptor(YamlConfig):
|
|
69
|
+
"""This class is used to save the description information specific to lick training sessions as a .yaml file.
|
|
70
|
+
|
|
71
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
72
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
73
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
74
|
+
|
|
75
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
76
|
+
trained animal.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
experimenter: str
|
|
80
|
+
"""The ID of the experimenter running the session."""
|
|
81
|
+
mouse_weight_g: float
|
|
82
|
+
"""The weight of the animal, in grams, at the beginning of the session."""
|
|
83
|
+
dispensed_water_volume_ml: float
|
|
84
|
+
"""Stores the total water volume, in milliliters, dispensed during runtime."""
|
|
85
|
+
minimum_reward_delay: int
|
|
86
|
+
"""Stores the minimum delay, in seconds, that can separate the delivery of two consecutive water rewards."""
|
|
87
|
+
maximum_reward_delay_s: int
|
|
88
|
+
"""Stores the maximum delay, in seconds, that can separate the delivery of two consecutive water rewards."""
|
|
89
|
+
maximum_water_volume_ml: float
|
|
90
|
+
"""Stores the maximum volume of water the system is allowed to dispense during training."""
|
|
91
|
+
maximum_training_time_m: int
|
|
92
|
+
"""Stores the maximum time, in minutes, the system is allowed to run the training for."""
|
|
93
|
+
experimenter_notes: str = "Replace this with your notes."
|
|
94
|
+
"""This field is not set during runtime. It is expected that each experimenter replaces this field with their
|
|
95
|
+
notes made during runtime."""
|
|
96
|
+
experimenter_given_water_volume_ml: float = 0.0
|
|
97
|
+
"""The additional volume of water, in milliliters, administered by the experimenter to the animal after the session.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@dataclass()
|
|
102
|
+
class RunTrainingDescriptor(YamlConfig):
|
|
103
|
+
"""This class is used to save the description information specific to run training sessions as a .yaml file.
|
|
104
|
+
|
|
105
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
106
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
107
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
108
|
+
|
|
109
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
110
|
+
trained animal.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
experimenter: str
|
|
114
|
+
"""The ID of the experimenter running the session."""
|
|
115
|
+
mouse_weight_g: float
|
|
116
|
+
"""The weight of the animal, in grams, at the beginning of the session."""
|
|
117
|
+
dispensed_water_volume_ml: float
|
|
118
|
+
"""Stores the total water volume, in milliliters, dispensed during runtime."""
|
|
119
|
+
final_run_speed_threshold_cm_s: float
|
|
120
|
+
"""Stores the final running speed threshold, in centimeters per second, that was active at the end of training."""
|
|
121
|
+
final_run_duration_threshold_s: float
|
|
122
|
+
"""Stores the final running duration threshold, in seconds, that was active at the end of training."""
|
|
123
|
+
initial_run_speed_threshold_cm_s: float
|
|
124
|
+
"""Stores the initial running speed threshold, in centimeters per second, used during training."""
|
|
125
|
+
initial_run_duration_threshold_s: float
|
|
126
|
+
"""Stores the initial running duration threshold, in seconds, used during training."""
|
|
127
|
+
increase_threshold_ml: float
|
|
128
|
+
"""Stores the volume of water delivered to the animal, in milliliters, that triggers the increase in the running
|
|
129
|
+
speed and duration thresholds."""
|
|
130
|
+
run_speed_increase_step_cm_s: float
|
|
131
|
+
"""Stores the value, in centimeters per second, used by the system to increment the running speed threshold each
|
|
132
|
+
time the animal receives 'increase_threshold' volume of water."""
|
|
133
|
+
run_duration_increase_step_s: float
|
|
134
|
+
"""Stores the value, in seconds, used by the system to increment the duration threshold each time the animal
|
|
135
|
+
receives 'increase_threshold' volume of water."""
|
|
136
|
+
maximum_water_volume_ml: float
|
|
137
|
+
"""Stores the maximum volume of water the system is allowed to dispense during training."""
|
|
138
|
+
maximum_training_time_m: int
|
|
139
|
+
"""Stores the maximum time, in minutes, the system is allowed to run the training for."""
|
|
140
|
+
experimenter_notes: str = "Replace this with your notes."
|
|
141
|
+
"""This field is not set during runtime. It is expected that each experimenter will replace this field with their
|
|
142
|
+
notes made during runtime."""
|
|
143
|
+
experimenter_given_water_volume_ml: float = 0.0
|
|
144
|
+
"""The additional volume of water, in milliliters, administered by the experimenter to the animal after the session.
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@dataclass()
|
|
149
|
+
class MesoscopeExperimentDescriptor(YamlConfig):
|
|
150
|
+
"""This class is used to save the description information specific to experiment sessions as a .yaml file.
|
|
151
|
+
|
|
152
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
153
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
154
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
155
|
+
|
|
156
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
157
|
+
animal participating in the experiment runtime.
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
experimenter: str
|
|
161
|
+
"""The ID of the experimenter running the session."""
|
|
162
|
+
mouse_weight_g: float
|
|
163
|
+
"""The weight of the animal, in grams, at the beginning of the session."""
|
|
164
|
+
dispensed_water_volume_ml: float
|
|
165
|
+
"""Stores the total water volume, in milliliters, dispensed during runtime."""
|
|
166
|
+
experimenter_notes: str = "Replace this with your notes."
|
|
167
|
+
"""This field is not set during runtime. It is expected that each experimenter will replace this field with their
|
|
168
|
+
notes made during runtime."""
|
|
169
|
+
experimenter_given_water_volume_ml: float = 0.0
|
|
170
|
+
"""The additional volume of water, in milliliters, administered by the experimenter to the animal after the session.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@dataclass()
|
|
175
|
+
class ZaberPositions(YamlConfig):
|
|
176
|
+
"""This class is used to save Zaber motor positions as a .yaml file to reuse them between sessions.
|
|
177
|
+
|
|
178
|
+
The class is specifically designed to store, save, and load the positions of the LickPort and HeadBar motors
|
|
179
|
+
(axes). It is used to both store Zaber motor positions for each session for future analysis and to restore the same
|
|
180
|
+
Zaber motor positions across consecutive runtimes for the same project and animal combination.
|
|
181
|
+
|
|
182
|
+
Notes:
|
|
183
|
+
All positions are saved using native motor units. All class fields initialize to default placeholders that are
|
|
184
|
+
likely NOT safe to apply to the VR system. Do not apply the positions loaded from the file unless you are
|
|
185
|
+
certain they are safe to use.
|
|
186
|
+
|
|
187
|
+
Exercise caution when working with Zaber motors. The motors are powerful enough to damage the surrounding
|
|
188
|
+
equipment and manipulated objects. Do not modify the data stored inside the .yaml file unless you know what you
|
|
189
|
+
are doing.
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
headbar_z: int = 0
|
|
193
|
+
"""The absolute position, in native motor units, of the HeadBar z-axis motor."""
|
|
194
|
+
headbar_pitch: int = 0
|
|
195
|
+
"""The absolute position, in native motor units, of the HeadBar pitch-axis motor."""
|
|
196
|
+
headbar_roll: int = 0
|
|
197
|
+
"""The absolute position, in native motor units, of the HeadBar roll-axis motor."""
|
|
198
|
+
lickport_z: int = 0
|
|
199
|
+
"""The absolute position, in native motor units, of the LickPort z-axis motor."""
|
|
200
|
+
lickport_x: int = 0
|
|
201
|
+
"""The absolute position, in native motor units, of the LickPort x-axis motor."""
|
|
202
|
+
lickport_y: int = 0
|
|
203
|
+
"""The absolute position, in native motor units, of the LickPort y-axis motor."""
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
@dataclass()
|
|
207
|
+
class MesoscopePositions(YamlConfig):
|
|
208
|
+
"""This class is used to save the real and virtual Mesoscope objective positions as a .yaml file to reuse it
|
|
209
|
+
between experiment sessions.
|
|
210
|
+
|
|
211
|
+
Primarily, the class is used to help the experimenter to position the Mesoscope at the same position across
|
|
212
|
+
multiple imaging sessions. It stores both the physical (real) position of the objective along the motorized
|
|
213
|
+
X, Y, Z, and Roll axes and the virtual (ScanImage software) tip, tilt, and fastZ focus axes.
|
|
214
|
+
|
|
215
|
+
Notes:
|
|
216
|
+
Since the API to read and write these positions automatically is currently not available, this class relies on
|
|
217
|
+
the experimenter manually entering all positions and setting the mesoscope to these positions when necessary.
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
mesoscope_x_position: float = 0.0
|
|
221
|
+
"""The X-axis position, in centimeters, of the Mesoscope objective used during session runtime."""
|
|
222
|
+
mesoscope_y_position: float = 0.0
|
|
223
|
+
"""The Y-axis position, in centimeters, of the Mesoscope objective used during session runtime."""
|
|
224
|
+
mesoscope_roll_position: float = 0.0
|
|
225
|
+
"""The Roll-axis position, in degrees, of the Mesoscope objective used during session runtime."""
|
|
226
|
+
mesoscope_z_position: float = 0.0
|
|
227
|
+
"""The Z-axis position, in centimeters, of the Mesoscope objective used during session runtime."""
|
|
228
|
+
mesoscope_fast_z_position: float = 0.0
|
|
229
|
+
"""The Fast-Z-axis position, in micrometers, of the Mesoscope objective used during session runtime."""
|
|
230
|
+
mesoscope_tip_position: float = 0.0
|
|
231
|
+
"""The Tilt-axis position, in degrees, of the Mesoscope objective used during session runtime."""
|
|
232
|
+
mesoscope_tilt_position: float = 0.0
|
|
233
|
+
"""The Tip-axis position, in degrees, of the Mesoscope objective used during session runtime."""
|