AllenNeuralDynamics / AllenNeuralDynamics/Aind.Physiology.Fip
Add ability for experimenter to specify patch cord connections
- Langage dominant
- C#
- Étoiles
- 0
- Forks
- 0
- Merge moyen
- 15 j 20 h
- PR mergées (30 j)
- 1
Description
As currently designed, the FIP system has four patch cords which are designed to be connected to implanted fibers during an experiment. However, not all mice have four implanted fibers. So, in cases where n_fibers < 4 (which is currently most cases), some patch cords are left unused (generally just laid next to the mouse).
The aind-data-schema `DataStream` object requires a list of `active_devices` and `connections` which are meant to capture this in metadata. Currently, the FIP metadata mapper checks the mouse's `procedures.json`, which contains a record of implanted fibers, then makes the following two assumptions:
* Only N patch cords are in use, with N being equal to the number of implanted fibers
* Patch cords are connected to like-numbered fibers, such that patch_cord_k connects to fiber_k, where k = 0, 1, ..., N
This method for populating `active_devices` and `connections` works so long as the above two assumptions are **always** obeyed at experiment time. But it does not account for the possibility that some patch cords with corresponding fibers are unused (if, for example, a given fiber has broken or otherwise becomes unusable) or if an experimenter wishes to deliberately change the order.
Instead, some method should exist to prompt the experimenter to enter this information at the beginning of an experiment. This information should then be propagated to the `fip.json` extracted metadata, which can then be used by the mapper to create `active_devices` and `connections`. The precise format of this information is not critical, but needs to convey two pieces of information:
1) which patch cables are in use
2) which implanted fiber each patch cord connects to.
One suggested format would be a list of dictionaries of this format:
```
"patch_cord_fiber_connections": [
{"patch_cable_0": "fiber_0"},
{"patch_cable_1": "fiber_1"},
...
{"patch_cable_N": "fiber_N"},
]
```
or maybe more simply:
```
"patch_cord_fiber_connections": {
0: 0,
1: 1,
...
N: N
}
```
This would be flexible in case the FIP system was ever modified to have more (or less) than 4 patch cords.
After this is implemented, the mapper could be modified to make a couple simple checks that:
* All referenced fibers exist in the procedures for the given subject
* The number of active patch cords is less than or equal to the number of implanted fibers
* No duplicate mappings exist (i.e. each patch cord maps to only one fiber)
Benefits of this change are:
* Avoiding assumptions about patch cord to fiber connections
* Adding experimental flexibility in case the patch cord to fiber mapping needs be changed at experiment-time
* Simplifying mapper logic
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.