Skip to content

07. Developing Plugins

Hauke Jürgen Mönck edited this page Mar 19, 2018 · 6 revisions

Developing BioTracker plugins

For building a sample, see the Sampletracker repository. This is a full example doing some thresholding on an input image.
By copying the sample project you are given the MVC structure and can start coding right away. Nevertheless, here is a short introduction to the structure.

You can get started with the BioTrackerTrackingAlgorithm::doTracking function, which does the actual tracking, in the case of the sampletracker thresholding. The other classes are related to housekeeping tasks: Wrapping GUI input and structuring the MVC pattern.

The interface project provides you with more useful interface classes to build a MVC patterned tracker. The basic things a plugin must do are the following: Provide the core with two "IView" objects, one representing the Parameter and Element view. Then it needs a Qt slot to receive frames and a Qt signal to send a frame back to the core.

After doing your tracking you need to send back a matrix for displaying by the core. For instance, you might have created a binarized version of the input and want it displayed. If you want to have the trackpoints rendered onto the original image, just send forth the matrix as you received it and store the trackpoints in the "Tracked Trajectory". This is basically a tree structure storing all the tracks. Make sure your tracked elements are inserted at the corresponding point in time and that the trajectory is marked "valid".


Schematic of the trajectory structure.

Once you are done with any tracking relevant task finalize it by emitting the "TrackingDone" signal. This tells the core it may now proceed to render the frame, load the next frame and in consequence call the tracking plugin again. Hence be careful with any task done after emitting the signal for concurrency reasons.