Source code for Movie

# CellTracking.py
# By MW, Jun 2013
# GPLv3+
#
# Module containing the movie class

import imp, logging
Cells = imp.load_source("Cells", './bin/Movies/Cells/Cells.py')

[docs]class Movie : """Class representing a movie""" def __init__(self) : self.Channels = imp.load_source("Channels", './bin/Movies/Channels/Channels.py') # Loading the Movie class self.Cells = Cells.Cells(self)
[docs] def get_frame_nb(self) : """Function that returns the number of frames of the Loader""" channels = self.Channels.get_channels_dict() if len(channels) > 0 : return channels.values()[0].get_frame_nb() else : logging.error("No channel has been instanciated yet. Sorry")
[docs] def get_frame(self, index, channel) : """Return a frame (as a CV object) given its index and the channel where it comes from in the player""" return self.Channels.get_channel(channel).get_frame(index)
[docs] def get_size(self) : channels = self.Channels.get_channels_dict() if len(channels) > 0 : return channels.values()[0].get_size() else : logging.error("No channel has been instanciated yet. Sorry")