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

field device_type: Literal['CameraController'] = 'CameraController'[source]
Validated by:
  • _set_name

field frame_rate: int | None = 30[source]

Frame rate of the trigger to all cameras

Constraints:
  • ge = 0

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"
      }
   }
}

Fields:
field center: Point2f = Point2f(x=0.0, y=0.0)[source]

Center of the circle (px)

field radius: float = 1[source]

Radius of the circle (px)

Constraints:
  • ge = 0

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"
   ]
}

Fields:
field x: float [Required][source]

X coordinate of the point (px)

field y: float [Required][source]

Y coordinate of the point (px)

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:
field height: int = 0[source]

Height of the rectangle

Constraints:
  • ge = 0

field width: int = 0[source]

Width of the rectangle

Constraints:
  • ge = 0

field x: int = 0[source]

X coordinate of the top-left corner

Constraints:
  • ge = 0

field y: int = 0[source]

Y coordinate of the top-left corner

Constraints:
  • ge = 0

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 binning: int = 1[source]

Binning

Constraints:
  • ge = 1

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 exposure: int = 1000[source]

Exposure time

Constraints:
  • ge = 100

Validated by:
  • _set_name

field gain: float = 0[source]

Gain

Constraints:
  • ge = 0

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:
field serial_number: str [Required][source]

Camera serial number

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]
Parameters:

v (Rect)

Return type:

Rect

class aind_behavior_services.rig.cameras.SpinnakerCameraAdcBitDepth(value)[source]

Bases: IntEnum

ADC10BIT = 1[source]
ADC12BIT = 2[source]
ADC8BIT = 0[source]
class aind_behavior_services.rig.cameras.SpinnakerCameraPixelFormat(value)[source]

Bases: IntEnum

B10 = 101[source]
B12 = 102[source]
B16 = 103[source]
B8 = 100[source]
BAYERBG10 = 48[source]
BAYERBG10P = 38[source]
BAYERBG10PACKED = 33[source]
BAYERBG12 = 49[source]
BAYERBG12P = 23[source]
BAYERBG12PACKED = 15[source]
BAYERBG16 = 10[source]
BAYERBG8 = 6[source]
BAYERGB10 = 50[source]
BAYERGB10P = 37[source]
BAYERGB10PACKED = 32[source]
BAYERGB12 = 51[source]
BAYERGB12P = 22[source]
BAYERGB12PACKED = 14[source]
BAYERGB16 = 9[source]
BAYERGB8 = 5[source]
BAYERGR10 = 52[source]
BAYERGR10P = 35[source]
BAYERGR10PACKED = 30[source]
BAYERGR12 = 53[source]
BAYERGR12P = 20[source]
BAYERGR12PACKED = 12[source]
BAYERGR16 = 7[source]
BAYERGR8 = 3[source]
BAYERRG10 = 54[source]
BAYERRG10P = 36[source]
BAYERRG10PACKED = 31[source]
BAYERRG12 = 55[source]
BAYERRG12P = 21[source]
BAYERRG12PACKED = 13[source]
BAYERRG16 = 8[source]
BAYERRG8 = 4[source]
BGR10 = 85[source]
BGR10P = 86[source]
BGR12 = 87[source]
BGR12P = 88[source]
BGR14 = 89[source]
BGR16 = 90[source]
BGR565P = 91[source]
BGR8 = 27[source]
BGRA10 = 78[source]
BGRA10P = 79[source]
BGRA12 = 80[source]
BGRA12P = 81[source]
BGRA14 = 82[source]
BGRA16 = 83[source]
BGRA8 = 28[source]
CONFIDENCE1 = 139[source]
CONFIDENCE16 = 142[source]
CONFIDENCE1P = 140[source]
CONFIDENCE32F = 143[source]
CONFIDENCE8 = 141[source]
COORD3D_A10P = 125[source]
COORD3D_A12P = 126[source]
COORD3D_A16 = 127[source]
COORD3D_A32F = 128[source]
COORD3D_A8 = 124[source]
COORD3D_ABC10P = 106[source]
COORD3D_ABC10P_PLANAR = 107[source]
COORD3D_ABC12P = 108[source]
COORD3D_ABC12P_PLANAR = 109[source]
COORD3D_ABC16 = 110[source]
COORD3D_ABC16_PLANAR = 111[source]
COORD3D_ABC32F = 112[source]
COORD3D_ABC32F_PLANAR = 113[source]
COORD3D_ABC8 = 104[source]
COORD3D_ABC8_PLANAR = 105[source]
COORD3D_AC10P = 116[source]
COORD3D_AC10P_PLANAR = 117[source]
COORD3D_AC12P = 118[source]
COORD3D_AC12P_PLANAR = 119[source]
COORD3D_AC16 = 120[source]
COORD3D_AC16_PLANAR = 121[source]
COORD3D_AC32F = 122[source]
COORD3D_AC32F_PLANAR = 123[source]
COORD3D_AC8 = 114[source]
COORD3D_AC8_PLANAR = 115[source]
COORD3D_B10P = 130[source]
COORD3D_B12P = 131[source]
COORD3D_B16 = 132[source]
COORD3D_B32F = 133[source]
COORD3D_B8 = 129[source]
COORD3D_C10P = 135[source]
COORD3D_C12P = 136[source]
COORD3D_C16 = 137[source]
COORD3D_C32F = 138[source]
COORD3D_C8 = 134[source]
G10 = 97[source]
G12 = 98[source]
G16 = 99[source]
G8 = 96[source]
MONO10 = 43[source]
MONO10P = 34[source]
MONO10PACKED = 29[source]
MONO12 = 44[source]
MONO12P = 19[source]
MONO12PACKED = 11[source]
MONO14 = 45[source]
MONO16 = 1[source]
MONO16S = 46[source]
MONO1P = 39[source]
MONO2P = 40[source]
MONO32F = 47[source]
MONO4P = 41[source]
MONO8 = 0[source]
MONO8S = 42[source]
R10 = 93[source]
R12 = 94[source]
R16 = 95[source]
R8 = 92[source]
RGB10 = 65[source]
RGB10P = 67[source]
RGB10P32 = 68[source]
RGB10_PLANAR = 66[source]
RGB12 = 69[source]
RGB12P = 71[source]
RGB12_PLANAR = 70[source]
RGB14 = 72[source]
RGB16 = 73[source]
RGB16S = 74[source]
RGB16_PLANAR = 76[source]
RGB32F = 75[source]
RGB565P = 77[source]
RGB8 = 63[source]
RGB8PACKED = 2[source]
RGB8_PLANAR = 64[source]
RGBA10 = 57[source]
RGBA10P = 58[source]
RGBA12 = 59[source]
RGBA12P = 60[source]
RGBA14 = 61[source]
RGBA16 = 62[source]
RGBA32F = 84[source]
RGBA8 = 56[source]
YCBCR411_8 = 26[source]
YCBCR422_8 = 25[source]
YCBCR8 = 24[source]
YUV411PACKED = 16[source]
YUV422PACKED = 17[source]
YUV444PACKED = 18[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 container_extension: str = 'mp4'[source]

Container extension

field frame_rate: int = 30[source]

Encoding frame rate

Constraints:
  • ge = 0

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

field video_writer_type: Literal['FFMPEG'] = 'FFMPEG'[source]
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])

construct_video_writer_ffmpeg()[source]
Return type:

VideoWriterFfmpeg

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:
field container_extension: str = 'avi'[source]

Container extension

field four_cc: str = 'FMP4'[source]

Four character code

field frame_rate: int = 30[source]

Encoding frame rate

Constraints:
  • ge = 0

field video_writer_type: Literal['OPENCV'] = 'OPENCV'[source]
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:

field device_type: Literal['WebCamera'] = 'WebCamera'[source]

Device type

Validated by:
  • _set_name

field index: int = 0[source]

Camera index

Constraints:
  • ge = 0

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

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.harp.validate_harp_clock_output(rig)[source]
Parameters:

rig (TRig)

Return type:

TRig

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:
field connection_string: str = '@tcp://localhost:5556'[source]

The connection string for the ZMQ socket.

field topic: str = ''[source]

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:
field rotation: Vector3 = Vector3(x=0.0, y=0.0, z=0.0)[source]

Rotation vector (radians)

field translation: Vector3 = Vector3(x=0.0, y=1.309016, z=-13.27)[source]

Translation (in cm)

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"
      }
   }
}

Fields:
field display_height: float = 15[source]

Display width (cm)

Constraints:
  • ge = 0

field display_width: float = 20[source]

Display width (cm)

Constraints:
  • ge = 0

field frame_height: int = 1080[source]

Frame height (px)

Constraints:
  • ge = 0

field frame_width: int = 1920[source]

Frame width (px)

Constraints:
  • ge = 0

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 brightness: float = 0[source]

Brightness

Constraints:
  • ge = -1

  • le = 1

Validated by:
  • _set_name

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

field contrast: float = 1[source]

Contrast

Constraints:
  • ge = -1

  • le = 1

Validated by:
  • _set_name

field device_type: Literal['Screen'] = 'Screen'[source]

Device type

Validated by:
  • _set_name

field display_index: int = 1[source]

Display index

Validated by:
  • _set_name

field target_render_frequency: float = 60[source]

Target render frequency

Validated by:
  • _set_name

field target_update_frequency: float = 120[source]

Target update frequency

Validated by:
  • _set_name

field texture_assets_directory: str = 'Textures'[source]

Calibration directory

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"
      }
   }
}

Fields:
field x: float = 0[source]

X coordinate of the point

field y: float = 0[source]

Y coordinate of the point

field z: float = 0[source]

Z coordinate of the point

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:
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:
field computer_name: str [Optional][source]

Computer name

field rig_name: str [Required][source]

Rig name

field version: str [Required][source]

schema version

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

field additional_settings: BaseModel | None = None[source]

Additional settings

Validated by:
  • _set_name

field calibration: BaseModel | None = None[source]

Calibration

Validated by:
  • _set_name

field device_type: str [Required][source]

Device type

Validated by:
  • _set_name

field name: str | None = None (alias 'device_name')[source]

Device name

Validated by:
  • _set_name