Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/aind_metadata_mapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Init package"""

__version__ = "0.29.0"
__version__ = "0.29.1"
14 changes: 1 addition & 13 deletions src/aind_metadata_mapper/mesoscope/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ class MesoscopeEtl(GenericEtl[JobSettings]):
"""Class to manage transforming mesoscope platform json and metadata into
a Session model."""

_STRUCTURE_LOOKUP_DICT = {
385: "VISp",
394: "VISam",
402: "VISal",
409: "VISl",
417: "VISrl",
533: "VISpm",
312782574: "VISli",
}

# TODO: Deprecate this constructor. Use GenericEtl constructor instead
def __init__(self, job_settings: Union[JobSettings, str]):
"""
Expand Down Expand Up @@ -240,9 +230,7 @@ def _transform(self, extracted_source: dict, meta: dict) -> Session:
magnification=self.job_settings.magnification,
fov_scale_factor=0.78,
imaging_depth=plane["targeted_depth"],
targeted_structure=self._STRUCTURE_LOOKUP_DICT[
plane["targeted_structure_id"]
],
targeted_structure=plane["targeted_structure_id"],
scanimage_roi_index=plane["scanimage_roi_index"],
fov_width=meta[0]["SI.hRoiManager.pixelsPerLine"],
fov_height=meta[0]["SI.hRoiManager.linesPerFrame"],
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/mesoscope/example_movie_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 190,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 230,
"scanimage_power": 42,
Expand All @@ -196,7 +196,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 232,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 257,
"scanimage_power": 42,
Expand Down Expand Up @@ -224,7 +224,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 136,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 176,
"scanimage_power": 28,
Expand All @@ -245,7 +245,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 282,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 307,
"scanimage_power": 28,
Expand Down Expand Up @@ -273,7 +273,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 72,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 112,
"scanimage_power": 12,
Expand All @@ -294,7 +294,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 326,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 351,
"scanimage_power": 12,
Expand Down Expand Up @@ -322,7 +322,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 30,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 70,
"scanimage_power": 5,
Expand All @@ -343,7 +343,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 364,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 389,
"scanimage_power": 5,
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/mesoscope/example_platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 190,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 230,
"scanimage_power": 42,
Expand All @@ -78,7 +78,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 232,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 257,
"scanimage_power": 42,
Expand Down Expand Up @@ -108,7 +108,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 136,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 176,
"scanimage_power": 28,
Expand All @@ -129,7 +129,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 282,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 307,
"scanimage_power": 28,
Expand Down Expand Up @@ -159,7 +159,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 72,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 112,
"scanimage_power": 12,
Expand All @@ -180,7 +180,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 326,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 351,
"scanimage_power": 12,
Expand Down Expand Up @@ -210,7 +210,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.56,
"targeted_depth": 30,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 70,
"scanimage_power": 5,
Expand All @@ -231,7 +231,7 @@
"targeted_x": -2015.51,
"targeted_y": -275.6,
"targeted_depth": 364,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 389,
"scanimage_power": 5,
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/mesoscope/example_session_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"targeted_x": -672.96,
"targeted_y": -616.7,
"targeted_depth": 164,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 105,
"scanimage_power": 41,
Expand All @@ -201,7 +201,7 @@
"targeted_x": -672.96,
"targeted_y": -616.7,
"targeted_depth": 259,
"targeted_structure_id": 385,
"targeted_structure_id": "VISp",
"scanimage_roi_index": 0,
"scanimage_scanfield_z": 195,
"scanimage_power": 41,
Expand All @@ -228,7 +228,7 @@
"targeted_x": -1340.28,
"targeted_y": 617.08,
"targeted_depth": 159,
"targeted_structure_id": 402,
"targeted_structure_id": "VISal",
"scanimage_roi_index": 1,
"scanimage_scanfield_z": 116,
"scanimage_power": 41,
Expand All @@ -249,7 +249,7 @@
"targeted_x": -1340.28,
"targeted_y": 617.1,
"targeted_depth": 255,
"targeted_structure_id": 402,
"targeted_structure_id": "VISal",
"scanimage_roi_index": 1,
"scanimage_scanfield_z": 207,
"scanimage_power": 41,
Expand All @@ -276,7 +276,7 @@
"targeted_x": 758.15,
"targeted_y": -876.71,
"targeted_depth": 175,
"targeted_structure_id": 394,
"targeted_structure_id": "VISam",
"scanimage_roi_index": 2,
"scanimage_scanfield_z": 92,
"scanimage_power": 55,
Expand All @@ -297,7 +297,7 @@
"targeted_x": 758.15,
"targeted_y": -876.7,
"targeted_depth": 255,
"targeted_structure_id": 394,
"targeted_structure_id": "VISam",
"scanimage_roi_index": 2,
"scanimage_scanfield_z": 167,
"scanimage_power": 55,
Expand All @@ -324,7 +324,7 @@
"targeted_x": 107.36,
"targeted_y": -915.45,
"targeted_depth": 189,
"targeted_structure_id": 533,
"targeted_structure_id": "VISpm",
"scanimage_roi_index": 3,
"scanimage_scanfield_z": 112,
"scanimage_power": 50,
Expand All @@ -345,7 +345,7 @@
"targeted_x": 107.36,
"targeted_y": -915.4,
"targeted_depth": 265,
"targeted_structure_id": 533,
"targeted_structure_id": "VISpm",
"scanimage_roi_index": 3,
"scanimage_scanfield_z": 183,
"scanimage_power": 50,
Expand Down