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
withExperiment.CreateSpace()
.Within a single Space , it could be relevant to define
Zone
. These are manipulated withCreateZone()
andDeleteZone()
.- 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:
- 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
- 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:
- Raises:
IndexError – if time is outside of this Space tracking data
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 anExperiment
, but they are managed and are related to a singleSpace
. They also have a user definedName
, 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 singleZoneDefinition
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 withAddDefinition()
andDeleteDefinition()
.- 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:
- Returns:
the new
ZoneDefinition
for this Zone- Return type:
- 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)