aind_behavior_services.rig package¶
Submodules¶
aind_behavior_services.rig.cameras module¶
- pydantic model aind_behavior_services.rig.cameras.CameraController[source]¶
Bases:
Device
,Generic
[TCamera
]Show JSON schema
{ "title": "CameraController", "type": "object", "properties": { "device_type": { "const": "CameraController", "default": "CameraController", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "cameras": { "additionalProperties": { "anyOf": [ { "$ref": "#/$defs/WebCamera" }, { "$ref": "#/$defs/SpinnakerCamera" } ] }, "description": "Cameras to be instantiated", "title": "Cameras", "type": "object" }, "frame_rate": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": 30, "description": "Frame rate of the trigger to all cameras", "title": "Frame Rate" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "Rect": { "properties": { "x": { "default": 0, "description": "X coordinate of the top-left corner", "minimum": 0, "title": "X", "type": "integer" }, "y": { "default": 0, "description": "Y coordinate of the top-left corner", "minimum": 0, "title": "Y", "type": "integer" }, "width": { "default": 0, "description": "Width of the rectangle", "minimum": 0, "title": "Width", "type": "integer" }, "height": { "default": 0, "description": "Height of the rectangle", "minimum": 0, "title": "Height", "type": "integer" } }, "title": "Rect", "type": "object" }, "SpinnakerCamera": { "properties": { "device_type": { "const": "SpinnakerCamera", "default": "SpinnakerCamera", "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "serial_number": { "description": "Camera serial number", "title": "Serial Number", "type": "string" }, "binning": { "default": 1, "description": "Binning", "minimum": 1, "title": "Binning", "type": "integer" }, "color_processing": { "default": "Default", "description": "Color processing", "enum": [ "Default", "NoColorProcessing" ], "title": "Color Processing", "type": "string" }, "exposure": { "default": 1000, "description": "Exposure time", "minimum": 100, "title": "Exposure", "type": "integer" }, "gain": { "default": 0, "description": "Gain", "minimum": 0, "title": "Gain", "type": "number" }, "gamma": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "Gamma. If None, will disable gamma correction.", "title": "Gamma" }, "adc_bit_depth": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraAdcBitDepth" }, { "type": "null" } ], "default": 0, "description": "ADC bit depth. If None will be left as default." }, "pixel_format": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraPixelFormat" }, { "type": "null" } ], "default": 0, "description": "Pixel format. If None will be left as default." }, "region_of_interest": { "$ref": "#/$defs/Rect", "default": { "x": 0, "y": 0, "width": 0, "height": 0 }, "description": "Region of interest" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "required": [ "serial_number" ], "title": "SpinnakerCamera", "type": "object" }, "SpinnakerCameraAdcBitDepth": { "enum": [ 0, 1, 2 ], "title": "SpinnakerCameraAdcBitDepth", "type": "integer" }, "SpinnakerCameraPixelFormat": { "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "title": "SpinnakerCameraPixelFormat", "type": "integer" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" }, "WebCamera": { "properties": { "device_type": { "const": "WebCamera", "default": "WebCamera", "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "index": { "default": 0, "description": "Camera index", "minimum": 0, "title": "Index", "type": "integer" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "title": "WebCamera", "type": "object" } }, "required": [ "cameras" ] }
- Fields:
- Validators:
- field cameras: Dict[str, TCamera] [Required][source]¶
Cameras to be instantiated
- Validated by:
_set_name
- pydantic model aind_behavior_services.rig.cameras.Circle[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Circle", "type": "object", "properties": { "center": { "$ref": "#/$defs/Point2f", "default": { "x": 0.0, "y": 0.0 }, "description": "Center of the circle (px)" }, "radius": { "default": 1, "description": "Radius of the circle (px)", "minimum": 0, "title": "Radius", "type": "number" } }, "$defs": { "Point2f": { "properties": { "x": { "description": "X coordinate of the point (px)", "title": "X", "type": "number" }, "y": { "description": "Y coordinate of the point (px)", "title": "Y", "type": "number" } }, "required": [ "x", "y" ], "title": "Point2f", "type": "object" } } }
- aind_behavior_services.rig.cameras.FFMPEG_INPUT = '-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear'[source]¶
Default input arguments
- aind_behavior_services.rig.cameras.FFMPEG_OUTPUT_16BIT = '-vf "scale=out_color_matrix=bt709:out_range=full,format=rgb48le,scale=out_range=full" -c:v hevc_nvenc -pix_fmt p010le -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Default output arguments for 16-bit video encoding
- aind_behavior_services.rig.cameras.FFMPEG_OUTPUT_8BIT = '-vf "scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Default output arguments for 8-bit video encoding
- pydantic model aind_behavior_services.rig.cameras.Point2f[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Point2f", "type": "object", "properties": { "x": { "description": "X coordinate of the point (px)", "title": "X", "type": "number" }, "y": { "description": "Y coordinate of the point (px)", "title": "Y", "type": "number" } }, "required": [ "x", "y" ] }
- pydantic model aind_behavior_services.rig.cameras.Rect[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Rect", "type": "object", "properties": { "x": { "default": 0, "description": "X coordinate of the top-left corner", "minimum": 0, "title": "X", "type": "integer" }, "y": { "default": 0, "description": "Y coordinate of the top-left corner", "minimum": 0, "title": "Y", "type": "integer" }, "width": { "default": 0, "description": "Width of the rectangle", "minimum": 0, "title": "Width", "type": "integer" }, "height": { "default": 0, "description": "Height of the rectangle", "minimum": 0, "title": "Height", "type": "integer" } } }
- Fields:
- pydantic model aind_behavior_services.rig.cameras.SpinnakerCamera[source]¶
Bases:
Device
Show JSON schema
{ "title": "SpinnakerCamera", "type": "object", "properties": { "device_type": { "const": "SpinnakerCamera", "default": "SpinnakerCamera", "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "serial_number": { "description": "Camera serial number", "title": "Serial Number", "type": "string" }, "binning": { "default": 1, "description": "Binning", "minimum": 1, "title": "Binning", "type": "integer" }, "color_processing": { "default": "Default", "description": "Color processing", "enum": [ "Default", "NoColorProcessing" ], "title": "Color Processing", "type": "string" }, "exposure": { "default": 1000, "description": "Exposure time", "minimum": 100, "title": "Exposure", "type": "integer" }, "gain": { "default": 0, "description": "Gain", "minimum": 0, "title": "Gain", "type": "number" }, "gamma": { "anyOf": [ { "minimum": 0, "type": "number" }, { "type": "null" } ], "default": null, "description": "Gamma. If None, will disable gamma correction.", "title": "Gamma" }, "adc_bit_depth": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraAdcBitDepth" }, { "type": "null" } ], "default": 0, "description": "ADC bit depth. If None will be left as default." }, "pixel_format": { "anyOf": [ { "$ref": "#/$defs/SpinnakerCameraPixelFormat" }, { "type": "null" } ], "default": 0, "description": "Pixel format. If None will be left as default." }, "region_of_interest": { "$ref": "#/$defs/Rect", "default": { "x": 0, "y": 0, "width": 0, "height": 0 }, "description": "Region of interest" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "Rect": { "properties": { "x": { "default": 0, "description": "X coordinate of the top-left corner", "minimum": 0, "title": "X", "type": "integer" }, "y": { "default": 0, "description": "Y coordinate of the top-left corner", "minimum": 0, "title": "Y", "type": "integer" }, "width": { "default": 0, "description": "Width of the rectangle", "minimum": 0, "title": "Width", "type": "integer" }, "height": { "default": 0, "description": "Height of the rectangle", "minimum": 0, "title": "Height", "type": "integer" } }, "title": "Rect", "type": "object" }, "SpinnakerCameraAdcBitDepth": { "enum": [ 0, 1, 2 ], "title": "SpinnakerCameraAdcBitDepth", "type": "integer" }, "SpinnakerCameraPixelFormat": { "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "title": "SpinnakerCameraPixelFormat", "type": "integer" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" } }, "required": [ "serial_number" ] }
- Fields:
- Validators:
- field adc_bit_depth: SpinnakerCameraAdcBitDepth | None = SpinnakerCameraAdcBitDepth.ADC8BIT[source]¶
ADC bit depth. If None will be left as default.
- Validated by:
_set_name
- field color_processing: Literal['Default', 'NoColorProcessing'] = 'Default'[source]¶
Color processing
- Validated by:
_set_name
- field device_type: Literal['SpinnakerCamera'] = 'SpinnakerCamera'[source]¶
Device type
- Validated by:
_set_name
- field gamma: float | None = None[source]¶
Gamma. If None, will disable gamma correction.
- Constraints:
ge = 0
- Validated by:
_set_name
- field pixel_format: SpinnakerCameraPixelFormat | None = SpinnakerCameraPixelFormat.MONO8[source]¶
Pixel format. If None will be left as default.
- Validated by:
_set_name
- field region_of_interest: Rect = Rect(x=0, y=0, width=0, height=0)[source]¶
Region of interest
- Validated by:
_set_name
- field video_writer: VideoWriter | None = None[source]¶
Video writer. If not provided, no video will be saved.
- Validated by:
_set_name
- validator validate_roi » region_of_interest[source]¶
- pydantic model aind_behavior_services.rig.cameras.VideoWriterFfmpeg[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "VideoWriterFfmpeg", "type": "object", "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } } }
- Fields:
- field input_arguments: str = '-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear'[source]¶
Input arguments
- field output_arguments: str = '-vf "scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author="Allen Institute for Neural Dynamics" -maxrate 700M -bufsize 350M'[source]¶
Output arguments
- class aind_behavior_services.rig.cameras.VideoWriterFfmpegFactory(bit_depth=8, video_writer_ffmpeg_kwargs=None)[source]¶
Bases:
object
- Parameters:
bit_depth (Literal[8, 16])
video_writer_ffmpeg_kwargs (Dict[str, Any])
- update_video_writer_ffmpeg_kwargs(video_writer)[source]¶
- Parameters:
video_writer (VideoWriterFfmpeg)
- pydantic model aind_behavior_services.rig.cameras.VideoWriterOpenCv[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "VideoWriterOpenCv", "type": "object", "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } } }
- Fields:
- pydantic model aind_behavior_services.rig.cameras.WebCamera[source]¶
Bases:
Device
Show JSON schema
{ "title": "WebCamera", "type": "object", "properties": { "device_type": { "const": "WebCamera", "default": "WebCamera", "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "index": { "default": 0, "description": "Camera index", "minimum": 0, "title": "Index", "type": "integer" }, "video_writer": { "anyOf": [ { "$ref": "#/$defs/VideoWriter" }, { "type": "null" } ], "default": null, "description": "Video writer. If not provided, no video will be saved." } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "VideoWriter": { "discriminator": { "mapping": { "FFMPEG": "#/$defs/VideoWriterFfmpeg", "OPENCV": "#/$defs/VideoWriterOpenCv" }, "propertyName": "video_writer_type" }, "oneOf": [ { "$ref": "#/$defs/VideoWriterFfmpeg" }, { "$ref": "#/$defs/VideoWriterOpenCv" } ] }, "VideoWriterFfmpeg": { "properties": { "video_writer_type": { "const": "FFMPEG", "default": "FFMPEG", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "mp4", "description": "Container extension", "title": "Container Extension", "type": "string" }, "output_arguments": { "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M", "description": "Output arguments", "title": "Output Arguments", "type": "string" }, "input_arguments": { "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear", "description": "Input arguments", "title": "Input Arguments", "type": "string" } }, "title": "VideoWriterFfmpeg", "type": "object" }, "VideoWriterOpenCv": { "properties": { "video_writer_type": { "const": "OPENCV", "default": "OPENCV", "title": "Video Writer Type", "type": "string" }, "frame_rate": { "default": 30, "description": "Encoding frame rate", "minimum": 0, "title": "Frame Rate", "type": "integer" }, "container_extension": { "default": "avi", "description": "Container extension", "title": "Container Extension", "type": "string" }, "four_cc": { "default": "FMP4", "description": "Four character code", "title": "Four Cc", "type": "string" } }, "title": "VideoWriterOpenCv", "type": "object" } } }
- Fields:
- Validators:
aind_behavior_services.rig.harp module¶
- pydantic model aind_behavior_services.rig.harp.HarpClockGenerator[source]¶
Bases:
HarpTimestampGeneratorGen3
Show JSON schema
{ "title": "HarpClockGenerator", "type": "object", "properties": { "device_type": { "const": "TimestampGeneratorGen3", "default": "TimestampGeneratorGen3", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "who_am_i": { "const": 1158, "default": 1158, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" }, "connected_clock_outputs": { "default": [], "description": "Connected clock outputs", "items": { "$ref": "#/$defs/ConnectedClockOutput" }, "title": "Connected Clock Outputs", "type": "array" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "ConnectedClockOutput": { "properties": { "target_device": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Optional device name to provide user additional information", "title": "Target Device" }, "output_channel": { "description": "Output channel", "minimum": 0, "title": "Output Channel", "type": "integer" } }, "required": [ "output_channel" ], "title": "ConnectedClockOutput", "type": "object" } }, "deprecated": true, "required": [ "port_name" ] }
- Fields:
- Validators:
- pydantic model aind_behavior_services.rig.harp.HarpLickometer[source]¶
Bases:
HarpLicketySplit
Show JSON schema
{ "title": "HarpLickometer", "type": "object", "properties": { "device_type": { "const": "LicketySplit", "default": "LicketySplit", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" }, "who_am_i": { "const": 1400, "default": 1400, "title": "Who Am I", "type": "integer" }, "serial_number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device serial number", "title": "Serial Number" }, "port_name": { "description": "Device port name", "title": "Port Name", "type": "string" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" } }, "deprecated": true, "required": [ "port_name" ] }
- Fields:
- Validators:
aind_behavior_services.rig.network module¶
- pydantic model aind_behavior_services.rig.network.ZmqConnection[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "ZmqConnection", "type": "object", "properties": { "connection_string": { "default": "@tcp://localhost:5556", "description": "The connection string for the ZMQ socket.", "title": "Connection String", "type": "string" }, "topic": { "default": "", "title": "Topic", "type": "string" } } }
- Fields:
aind_behavior_services.rig.visual_stimulation module¶
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayCalibration[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "DisplayCalibration", "type": "object", "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "$defs": { "DisplayExtrinsics": { "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "Vector3": { "properties": { "x": { "default": 0, "description": "X coordinate of the point", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the point", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the point", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- field extrinsics: DisplayExtrinsics = DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27))[source]¶
Extrinsics
- field intrinsics: DisplayIntrinsics = DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15)[source]¶
Intrinsics
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayExtrinsics[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "DisplayExtrinsics", "type": "object", "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "$defs": { "Vector3": { "properties": { "x": { "default": 0, "description": "X coordinate of the point", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the point", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the point", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplayIntrinsics[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "DisplayIntrinsics", "type": "object", "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } } }
- pydantic model aind_behavior_services.rig.visual_stimulation.DisplaysCalibration[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "DisplaysCalibration", "type": "object", "properties": { "left": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Left display calibration" }, "center": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } } }, "description": "Center display calibration" }, "right": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Right display calibration" } }, "$defs": { "DisplayCalibration": { "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "title": "DisplayCalibration", "type": "object" }, "DisplayExtrinsics": { "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "Vector3": { "properties": { "x": { "default": 0, "description": "X coordinate of the point", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the point", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the point", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- field center: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27)))[source]¶
Center display calibration
- field left: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=1.0472, z=0.0), translation=Vector3(x=-16.6917756, y=1.309016, z=-3.575264)))[source]¶
Left display calibration
- field right: DisplayCalibration = DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=-1.0472, z=0.0), translation=Vector3(x=16.6917756, y=1.309016, z=-3.575264)))[source]¶
Right display calibration
- pydantic model aind_behavior_services.rig.visual_stimulation.Screen[source]¶
Bases:
Device
Show JSON schema
{ "title": "Screen", "type": "object", "properties": { "device_type": { "const": "Screen", "default": "Screen", "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "$ref": "#/$defs/DisplaysCalibration", "default": { "left": { "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } }, "center": { "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } }, "right": { "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } }, "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 } } }, "description": "Screen calibration" }, "display_index": { "default": 1, "description": "Display index", "title": "Display Index", "type": "integer" }, "target_render_frequency": { "default": 60, "description": "Target render frequency", "title": "Target Render Frequency", "type": "number" }, "target_update_frequency": { "default": 120, "description": "Target update frequency", "title": "Target Update Frequency", "type": "number" }, "texture_assets_directory": { "default": "Textures", "description": "Calibration directory", "title": "Texture Assets Directory", "type": "string" }, "brightness": { "default": 0, "description": "Brightness", "maximum": 1, "minimum": -1, "title": "Brightness", "type": "number" }, "contrast": { "default": 1, "description": "Contrast", "maximum": 1, "minimum": -1, "title": "Contrast", "type": "number" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "DisplayCalibration": { "properties": { "intrinsics": { "$ref": "#/$defs/DisplayIntrinsics", "default": { "frame_width": 1920, "frame_height": 1080, "display_width": 20.0, "display_height": 15.0 }, "description": "Intrinsics" }, "extrinsics": { "$ref": "#/$defs/DisplayExtrinsics", "default": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } }, "description": "Extrinsics" } }, "title": "DisplayCalibration", "type": "object" }, "DisplayExtrinsics": { "properties": { "rotation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 0.0, "z": 0.0 }, "description": "Rotation vector (radians)" }, "translation": { "$ref": "#/$defs/Vector3", "default": { "x": 0.0, "y": 1.309016, "z": -13.27 }, "description": "Translation (in cm)" } }, "title": "DisplayExtrinsics", "type": "object" }, "DisplayIntrinsics": { "properties": { "frame_width": { "default": 1920, "description": "Frame width (px)", "minimum": 0, "title": "Frame Width", "type": "integer" }, "frame_height": { "default": 1080, "description": "Frame height (px)", "minimum": 0, "title": "Frame Height", "type": "integer" }, "display_width": { "default": 20, "description": "Display width (cm)", "minimum": 0, "title": "Display Width", "type": "number" }, "display_height": { "default": 15, "description": "Display width (cm)", "minimum": 0, "title": "Display Height", "type": "number" } }, "title": "DisplayIntrinsics", "type": "object" }, "DisplaysCalibration": { "properties": { "left": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 1.0472, "z": 0.0 }, "translation": { "x": -16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Left display calibration" }, "center": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 }, "translation": { "x": 0.0, "y": 1.309016, "z": -13.27 } } }, "description": "Center display calibration" }, "right": { "$ref": "#/$defs/DisplayCalibration", "default": { "intrinsics": { "display_height": 15.0, "display_width": 20.0, "frame_height": 1080, "frame_width": 1920 }, "extrinsics": { "rotation": { "x": 0.0, "y": -1.0472, "z": 0.0 }, "translation": { "x": 16.6917756, "y": 1.309016, "z": -3.575264 } } }, "description": "Right display calibration" } }, "title": "DisplaysCalibration", "type": "object" }, "Vector3": { "properties": { "x": { "default": 0, "description": "X coordinate of the point", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the point", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the point", "title": "Z", "type": "number" } }, "title": "Vector3", "type": "object" } } }
- Fields:
- Validators:
- field calibration: DisplaysCalibration = DisplaysCalibration(left=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=1.0472, z=0.0), translation=Vector3(x=-16.6917756, y=1.309016, z=-3.575264))), center=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=0.0, z=0.0), translation=Vector3(x=0.0, y=1.309016, z=-13.27))), right=DisplayCalibration(intrinsics=DisplayIntrinsics(frame_width=1920, frame_height=1080, display_width=20, display_height=15), extrinsics=DisplayExtrinsics(rotation=Vector3(x=0.0, y=-1.0472, z=0.0), translation=Vector3(x=16.6917756, y=1.309016, z=-3.575264))))[source]¶
Screen calibration
- Validated by:
_set_name
- pydantic model aind_behavior_services.rig.visual_stimulation.Vector3[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Vector3", "type": "object", "properties": { "x": { "default": 0, "description": "X coordinate of the point", "title": "X", "type": "number" }, "y": { "default": 0, "description": "Y coordinate of the point", "title": "Y", "type": "number" }, "z": { "default": 0, "description": "Z coordinate of the point", "title": "Z", "type": "number" } } }
Module contents¶
- pydantic model aind_behavior_services.rig.AindBehaviorRigModel[source]¶
Bases:
SchemaVersionedModel
Show JSON schema
{ "title": "AindBehaviorRigModel", "type": "object", "properties": { "aind_behavior_services_pkg_version": { "const": "0.11.0", "default": "0.11.0", "title": "aind_behavior_services package version", "type": "string" }, "version": { "description": "schema version", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version", "type": "string" }, "computer_name": { "description": "Computer name", "title": "Computer Name", "type": "string" }, "rig_name": { "description": "Rig name", "title": "Rig Name", "type": "string" } }, "required": [ "version", "rig_name" ] }
- Fields:
aind_behavior_services_pkg_version (Literal[pkg_version])
computer_name (str)
rig_name (str)
version (str)
- Validators:
coerce_version
»aind_behavior_services_pkg_version
coerce_version
»version
- field aind_behavior_services_pkg_version: Literal[pkg_version] = '0.11.0'[source]¶
- Constraints:
pattern = ^(0|[1-9]d*).(0|[1-9]d*).(0|[1-9]d*)(?:-((?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*)(?:.(?:0|[1-9]d*|d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:+([0-9a-zA-Z-]+(?:.[0-9a-zA-Z-]+)*))?$
- Validated by:
- pydantic model aind_behavior_services.rig.Device[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Device", "type": "object", "properties": { "device_type": { "description": "Device type", "title": "Device Type", "type": "string" }, "device_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Device name", "title": "Device Name" }, "additional_settings": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Additional settings" }, "calibration": { "anyOf": [ { "$ref": "#/$defs/BaseModel" }, { "type": "null" } ], "default": null, "description": "Calibration" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" } }, "required": [ "device_type" ] }
- Fields:
additional_settings (pydantic.main.BaseModel | None)
calibration (pydantic.main.BaseModel | None)
device_type (str)
name (str | None)
- Validators:
_set_name
»all fields