The PyJAMAS API¶
The PyJAMAS API can be invoked by creating a PyJAMAS object:
from pyjamas.pjscore import PyJAMAS
pjs = PyJAMAS()
The pjs object contains attributes that hold important data about the image and annotations. Here are a few of them:
pjs.slices: (numpy.ndarray) the image data as an array of dimensions C x H x W where C is the number of channels or timepoints, H is the height, and W is the width.
pjs.height: (int) the height of the image (number of rows in the numpy array).
pjs.width: (int) the width of the image (number of columns in the numpy array).
pjs.n_frames: (int) the number of frames in the image (number of channels in the numpy array).
pjs.curslice: (int) the index of the current frame of the image.
pjs.polylines: (list) a list of length pjs.n_frames, where each element is a list of the polylines on that frame.
pjs.polyline_ids: (list) a list of length pjs.n_frames, where each element is a list of the polyline ids on that frame. pjs.polylines and pjs.polyline_ids are in the same order so that the id at pjs.polyline_ids[t][i] corresponds to the polyline at pjs.polylines[t][i]
pjs.fiducials: (list) a list of length pjs.n_frames, where each element is a list of the fiducial coordinates on that frame.
pjs.brush_size: (int) the size of the width of polyline outlines. This parameter is also used in many functions to determine the margin around polylines to consider a part of the object.
pjs.batch_classifier: a class that implements fit and predict methods for machine learning applications. pjs.batch_classifier contains functions for applying the tool to many frames, while pjs.batch_classifier.classifier contains the actual classifier object.
The pjs object also contains a set of attributes that provide access to the PyJAMAS API. The attributes are instances of different submodules in the pyjamas.rcallbacks package. The attributes are:
The methods included in each attribute are described below.