From 1ea794f762aebde45d188d9d0b36c1e3541f292b Mon Sep 17 00:00:00 2001 From: Lili Karashchuk Date: Mon, 5 Aug 2024 13:49:12 -0700 Subject: [PATCH 1/2] feat(devices): add crop offset x and y to camera --- src/aind_data_schema/components/devices.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aind_data_schema/components/devices.py b/src/aind_data_schema/components/devices.py index af5e1b33..361a76f1 100644 --- a/src/aind_data_schema/components/devices.py +++ b/src/aind_data_schema/components/devices.py @@ -325,6 +325,8 @@ class Detector(Device): bin_height: Optional[int] = Field(default=None, title="Bin height") bin_unit: SizeUnit = Field(default=SizeUnit.PX, title="Bin size unit") gain: Optional[Decimal] = Field(default=None, title="Gain") + crop_offset_x: Optional[int] = Field(default=None, title="Crop offset x") + crop_offset_y: Optional[int] = Field(default=None, title="Crop offset y") crop_width: Optional[int] = Field(default=None, title="Crop width") crop_height: Optional[int] = Field(default=None, title="Crop width") crop_unit: SizeUnit = Field(default=SizeUnit.PX, title="Crop size unit") From 0aef4818af861253af85c3f8264d11eb95498d79 Mon Sep 17 00:00:00 2001 From: Lili Karashchuk Date: Mon, 5 Aug 2024 14:22:58 -0700 Subject: [PATCH 2/2] add crop offset to example files to make tests pass --- examples/aibs_smartspim_instrument.json | 4 +++- examples/aind_smartspim_instrument.json | 4 +++- examples/ephys_rig.json | 12 ++++++++++++ examples/exaspim_instrument.json | 4 +++- examples/fip_behavior_rig.json | 10 +++++++++- examples/fip_behavior_rig.py | 4 ++++ examples/fip_ophys_rig.json | 10 +++++++++- examples/fip_ophys_rig.py | 4 ++++ 8 files changed, 47 insertions(+), 5 deletions(-) diff --git a/examples/aibs_smartspim_instrument.json b/examples/aibs_smartspim_instrument.json index eb4fb226..96ec359d 100644 --- a/examples/aibs_smartspim_instrument.json +++ b/examples/aibs_smartspim_instrument.json @@ -98,6 +98,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -506,4 +508,4 @@ ], "daqs": [], "notes": null -} \ No newline at end of file +} diff --git a/examples/aind_smartspim_instrument.json b/examples/aind_smartspim_instrument.json index c3d4985b..24644996 100644 --- a/examples/aind_smartspim_instrument.json +++ b/examples/aind_smartspim_instrument.json @@ -118,6 +118,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -633,4 +635,4 @@ ], "daqs": [], "notes": null -} \ No newline at end of file +} diff --git a/examples/ephys_rig.json b/examples/ephys_rig.json index 0c24018a..a2ff3f39 100644 --- a/examples/ephys_rig.json +++ b/examples/ephys_rig.json @@ -64,6 +64,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -171,6 +173,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -354,6 +358,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -430,6 +436,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -506,6 +514,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -582,6 +592,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", diff --git a/examples/exaspim_instrument.json b/examples/exaspim_instrument.json index 16173d8a..1f29994f 100644 --- a/examples/exaspim_instrument.json +++ b/examples/exaspim_instrument.json @@ -95,6 +95,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -455,4 +457,4 @@ } ], "notes": null -} \ No newline at end of file +} diff --git a/examples/fip_behavior_rig.json b/examples/fip_behavior_rig.json index 9d52b708..87f2b6cf 100644 --- a/examples/fip_behavior_rig.json +++ b/examples/fip_behavior_rig.json @@ -138,6 +138,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -213,6 +215,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -390,6 +394,8 @@ "bin_height": 4, "bin_unit": "pixel", "gain": "2", + "crop_offset_x": 0, + "crop_offset_y": 0, "crop_width": 200, "crop_height": 200, "crop_unit": "pixel", @@ -434,6 +440,8 @@ "bin_height": 4, "bin_unit": "pixel", "gain": "2", + "crop_offset_x": 0, + "crop_offset_y": 0, "crop_width": 200, "crop_height": 200, "crop_unit": "pixel", @@ -937,4 +945,4 @@ } ], "notes": null -} \ No newline at end of file +} diff --git a/examples/fip_behavior_rig.py b/examples/fip_behavior_rig.py index aaed6e58..ea422f2d 100644 --- a/examples/fip_behavior_rig.py +++ b/examples/fip_behavior_rig.py @@ -169,6 +169,8 @@ bin_width=4, bin_height=4, bin_mode="Additive", + crop_offset_x=0, + crop_offset_y=0, crop_width=200, crop_height=200, gain=2, @@ -187,6 +189,8 @@ bin_width=4, bin_height=4, bin_mode="Additive", + crop_offset_x=0, + crop_offset_y=0, crop_width=200, crop_height=200, gain=2, diff --git a/examples/fip_ophys_rig.json b/examples/fip_ophys_rig.json index ec64ba66..ae027456 100644 --- a/examples/fip_ophys_rig.json +++ b/examples/fip_ophys_rig.json @@ -124,6 +124,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -199,6 +201,8 @@ "bin_height": null, "bin_unit": "pixel", "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, "crop_width": null, "crop_height": null, "crop_unit": "pixel", @@ -376,6 +380,8 @@ "bin_height": 4, "bin_unit": "pixel", "gain": "2", + "crop_offset_x": 0, + "crop_offset_y": 0, "crop_width": 200, "crop_height": 200, "crop_unit": "pixel", @@ -420,6 +426,8 @@ "bin_height": 4, "bin_unit": "pixel", "gain": "2", + "crop_offset_x": 0, + "crop_offset_y": 0, "crop_width": 200, "crop_height": 200, "crop_unit": "pixel", @@ -891,4 +899,4 @@ } ], "notes": null -} \ No newline at end of file +} diff --git a/examples/fip_ophys_rig.py b/examples/fip_ophys_rig.py index 86dcf71f..015e56e7 100644 --- a/examples/fip_ophys_rig.py +++ b/examples/fip_ophys_rig.py @@ -115,6 +115,8 @@ bin_width=4, bin_height=4, bin_mode="Additive", + crop_offset_x=0, + crop_offset_y=0, crop_width=200, crop_height=200, gain=2, @@ -133,6 +135,8 @@ bin_width=4, bin_height=4, bin_mode="Additive", + crop_offset_x=0, + crop_offset_y=0, crop_width=200, crop_height=200, gain=2,