Skip to content

Official Events

Xavier MD edited this page Jun 5, 2026 · 2 revisions

Live-processing events

Those events are computed by the LMT software, not afterwards by a BuildEvent python code.

Stop

For this event, speed at frame $f$ is calculated between frames $f - 3$ and $f + 3$ (if they do not exist, it is not a Stop event). It is a 6 frames intervals (corresponds to 0,2 s at 30 fps). A Stop event is created for the frame $f$ when calculated speed is smaller than 1 pixel.

  • $v \leq 0.17 \enspace px/frame$
  • $v \leq 5 \enspace px/s$.
Code example in Python
speed[f] = pos.mass(f+3) - pos.mass(f-3)
if speed[f] < 1:
    # create event "Stop" at frame f

Post-processing events

Generic Events

User created Events

Approach

[MASS point of one animal is moving toward another animal's MASS point thatis stopped or moving less fast (not rebuild)],

"Approach contact": [Equivalent to an Approach that ens with a Contact. The approach needs to be longer than 3 frames (0.1 s). This event ends at the frame just before the Contact event and lasts the whole time of the Approach event.],

"Approach rear": [Equivalent to a "Social approach" towards an animal that have a Rearing event at the end of the approach.],

"Center Zone": [MASS point is in center zone: $x in [168, 343] "px" "and" y in [296, 120] "px"$ $thick (approx x in [29.5, 60.2] "cm" "and" y in [52.0, 21.0] "cm")$],

"Periphery Zone": [Opposite of center zone, so if MASS point is not in center zone, it is in periphery zone],

"Detection": [Each line in the DETECTION table of the SQLite database where ANIMALID is the corresponding one. Correspond to an existing mask in LMT.],

"Break contact": "Two animals that were in contact are no longer in contact (distance between their borders is higher than MAX_DISTANCE_CONTACT_THRESHOLD (= 30 pixels for mice ~ 5 cm))",

"Oral-oral Contact": "The distance bewteen FRONT detection (head) of both animals must be smaller than MAX_DISTANCE_HEAD_HEAD_GENITAL_THRESHOLD (= 15 pixels for mice ~ 2.5 cm)",

Official Events Documentation

BuildEventApproachContact.py

  • Approach contact: Represents approaches that occur just before a contact (longer than 3 frames). This is a reduction of distance between two animals, one moving faster than the other, until they come into contact. The event ends at the frame just before contact and lasts the entire duration of the approach.

BuildEventApproachRear.py

  • Approach rear: Animal A is approaching Animal B, which is in a reared posture at the end of the approach. Social approaches are considered (within 2 body lengths of one another). Rearings are considered "in contact" for computation purposes.

BuildEventCenterPeripheryLocation.py

  • Center Zone: The animal is in the center zone of the cage (xa=149, xb=363, ya=318, yb=98).
  • Periphery Zone: The animal is at the periphery of the cage (opposite event from Center Zone).

BuildEventDetection.py

  • Detection: Marks frames when the animal is detected in the system.

BuildEventFlickering.py

  • Flickering: Detects when the animal is flickering, i.e., when it is moving very fast but without much displacement (e.g., during a tremor or a seizure). Flickering is calculated on 19 frames (centered window, equal to 0.6 second) and with at least 7 frames (0.2 second).

BuildEventFollowZone.py

  • FollowZone: Events representing one animal following another.
  • FollowZone Isolated: One animal following another while isolated from group following scenarios.

BuildEventGetAway.py

  • Get away: Represents escape behavior. At least one animal should move, with Animal A's speed greater than Animal B's speed, and Animal A moving away from B.

BuildEventGroup2.py

  • Group2: Two animals are in contact with each other.

BuildEventGroup3.py

  • Group3: Three animals are in contact with each other (requires at least 3 animals in the experiment).

BuildEventGroup3MakeBreak.py

  • Group 3 make: Tracks the formation of three-animal groups.
  • Group 3 break: Tracks the dissolution of three-animal groups.

BuildEventGroup4.py

  • Group4: Four animals are in contact (equivalent to Group2 and Group3 events at higher complexity).

BuildEventGroup4MakeBreak.py

  • Group 4 make: Tracks the formation of four-animal groups.
  • Group 4 break: Tracks the dissolution of four-animal groups.

BuildEventLongChase.py

  • longChase: A succession of events from: Train2, Contact, Follow, Break contact, Escape. This represents a prolonged chase behavior between two or more animals.

BuildEventMove.py

  • Move: Reverse of the Stop event (built-in event) to identify when animals are moving.
  • Move isolated: Animal A is moving and not in contact with any other animal.
  • Move in contact: Animal A is moving and in contact with another animal.

BuildEventMoveSpeedCategories.py

  • Move high speed: Animal A is moving at an instant speed within a specific range (high speed category). The animal has stopped being detected as stationary and is moving above the HIGH_SPEED_MOVE_THRESHOLD.

BuildEventNest3.py

  • Nest3_: Nest event for 3 animals. Assumes no occlusion and does not work with anonymous animals. Requires exactly 4 animals to be defined in the experiment.

BuildEventNest4.py

  • Nest4_: Nest event for 4 animals. Assumes no occlusion. Related events include Nest3, Group2, Group3, and Group4.

BuildEventOralGenitalContact.py

  • Oral-genital Contact: Contact between one animal's oral region (mouth/snout) and another animal's genital region.

BuildEventOralOralContact.py

  • Oral-oral Contact: Contact between the oral regions (mouth/snout) of two animals, typically involving head-to-head interaction.

BuildEventOralSideSequence.py

  • seq oral oral - oral genital: Sequence involving transitions from oral-oral contact to oral-genital contact patterns.
  • seq oral geni - oral oral: Sequence involving transitions from oral-genital contact to oral-oral contact patterns.

BuildEventOtherContact.py

  • Other contact: Contact that is not classified as any of the specific contact types (e.g., not oral-oral, oral-genital, side-by-side, etc.). Represents all remaining contact types.

BuildEventPassiveAnogenitalSniff.py

  • Passive oral-genital Contact: Represents the passive partner in an oral-genital contact (the inverse/receiving end of an Oral-genital Contact).

BuildEventRear5.py

  • Rear isolated: Animal is rearing/standing on hind legs while not in contact with other animals.
  • Rear in contact: Animal is rearing/standing on hind legs while in contact with one or more other animals.

BuildEventRearCenterPeriphery.py

  • Rear in centerWindow: Animal is rearing while located in the center zone of the arena.
  • Rear at periphery: Animal is rearing while located at the periphery of the arena.

BuildEventSAP.py

  • SAP: Animal A is stopped (built-in event). Represents Stopped And in contact or isolated scenarios. Derived from the Stop event, indicating when animals are stationary.

BuildEventSideBySide.py

  • Side by side Contact: Two animals are in contact while positioned side-by-side (parallel orientation in the same direction).

BuildEventSideBySideOpposite.py

  • Side by side Contact, opposite way: Two animals are in contact while positioned side-by-side but facing opposite directions (head-to-tail or tail-to-head orientation).

BuildEventSocialApproach.py

  • Social approach: One animal approaching another in a social context. Must be within approximately 2 body lengths (social distance) for the approach to be considered social.

BuildEventSocialEscape.py

  • Social escape: One animal escaping from another in a social context, typically occurring during or following social interactions. Represents withdrawal from social contact.

BuildEventStop.py

  • Stop in contact: Animal is stationary and in contact with another animal.
  • Stop isolated: Animal is stationary and not in contact with any other animal.

BuildEventTrain2.py

  • Train2: Two animals are following each other with nose-to-anogenital contacts while moving. This represents a coordinated following behavior during mating sequences.

BuildEventTrain3.py

  • Train3: Three animals are following each other with nose-to-anogenital contacts while moving. This is a combination of Train2 events (Train2 events must be calculated before this event). Requires at least 3 animals in the experiment.

BuildEventTrain4.py

  • Train4: Four animals are following each other with nose-to-anogenital contacts while moving. This is a combination of Train2 events (Train2 events must be calculated before this event). Requires at least 4 animals in the experiment.

BuildEventWallJump.py

  • WallJump: Animal is jumping against the wall of the arena, typically representing escape or exploratory behavior.

Clone this wiki locally