Spaces and Zones

py_fort_myrmidon.Space

class py_fort_myrmidon.Space

An homogenous coordinate system for tracking data.

A Space represents an homogenous coordinate system for tracking data. I.e. coordinates from two different Space cannot be compared.

Spaces are uniquely identified with their ID()

Spaces can only be created from a Experiment with Experiment.CreateSpace().

Within a single Space , it could be relevant to define Zone. These are manipulated with CreateZone() and DeleteZone().

CreateZone(self: py_fort_myrmidon.Space, name: str) py_fort_myrmidon.Zone

Creates a new Zone in this space

Parameters:

name (str) – the name for the new Zone

Returns:

the newly created Zone

Return type:

py_fort_myrmidon.Zone

DeleteZone(self: py_fort_myrmidon.Space, zoneID: int) None

Deletes a Zone of this Space

Parameters:

zoneID (int) – the zoneID in self.Zones to delete

Raises:

IndexError – if zoneID is not in self.Zones

property ID

the unique SpaceID of this space

Type:

(int)

LocateMovieFrame(self: py_fort_myrmidon.Space, time: py_fort_myrmidon.Time) Tuple[str, int]

Locates a movie file and frame for a given time.

Parameters:

time (py_fort_myrmidon.Time) – the time to query for

Returns:

the absolute file path to the movie file int: the movie frame number that was acquired at or just after time

Return type:

str

Raises:

IndexError – if time is outside of this Space tracking data

property Name

the name for this space

Type:

(str)

property Zones

the Space’s Zone by their ZoneID

Type:

Dict[int,Zone]

py_fort_myrmidon.Zone

class py_fort_myrmidon.Zone

Defines a named region of interest for tracking and interactions

Zones defines a named region of interest for tracking and interactions. It means that two Ant, which are lying in two separate Zones will never report a collision or interaction.

Zones are uniquely identified trough their ID() in an Experiment, but they are managed and are related to a single Space. They also have a user defined Name, but it is never used internally.

By default an Ant lies in no Zone at all, which is identified by the ZoneID 0.

Zone have time valid ZoneDefinition which represents their geometries. In most cases a Zone will have a single ZoneDefinition valid for ] Time.SinceEver() ; Time.Forever() [. However it is possible to add as many different ZoneDefinitions to a Zone, as long as they do not overlap in Time. The definitions are manipulated with AddDefinition() and DeleteDefinition().

AddDefinition(self: py_fort_myrmidon.Zone, shapes: py_fort_myrmidon.ShapeList = [], start: py_fort_myrmidon.Time = {Time:-∞}, end: py_fort_myrmidon.Time = {Time:+∞}) py_fort_myrmidon.ZoneDefinition

Adds a new ZoneDefinition to this Zone

Parameters:
  • shapes (List[Shape]) – the geometry of the ZoneDefinition

  • start (Time) – the first valid Time for the ZoneDefinition

  • end (Time) – the first valid Time for the ZoneDefinition

Returns:

the new ZoneDefinition for this Zone

Return type:

ZoneDefinition

Raises:

ValueError – if start or end would make an overlapping definition with another ZoneDefinition of this Zone

property Definitions

the definitions for this Zone

Type:

List[ZoneDefinition]

DeleteDefinition(self: py_fort_myrmidon.Zone, index: int) None

Removes a ZoneDefinition

Parameters:

index (int) – the index in Definitions to remove.

Raises:

IndexError – if index >= len(self.Definitions)

property ID

the unique ID for this Zone

Type:

int

property Name

the name of the Zone

Type:

str

py_fort_myrmidon.ZoneDefinition

class py_fort_myrmidon.ZoneDefinition

Defines the geometry of a Zone during a time interval

property End

the first invalid Time for this ZoneDefinition

Type:

Time

property Shapes

the list of Shape that defines the geometry

Type:

List[Shape]

property Start

the first valid Time for this ZoneDefinition

Type:

Time