Supplementary information and algorithm notes on: An advanced method to characterise function of the Drosophila heart by means of an optical flow algorithm
This repository provides supplementary information to the aforementioned publication. This supplementary, along with the publication, provides all relevant information to faciliate understanding of the presented method. However it does not pose a fully integrated software solution and skips handling most corner cases. Corner cases are subject to evaluation for biological relevance and fine tuning to your individual case.
- hm_doOpticalFlow applies the OF algorithm itself, resulting in vector data for later procession
- hm_OFCGetQuadstates is just management code around the following two functions
- hm_angleToQuadstate converts the vector data into states which translate into: "Nothing", "Contraction", "Relaxation" and "Not sure"
- hm_filterQuadstate cleans the previously retrieved quadstates to be uniform (intitially upper and lower half were defined inversely) and reduces some noise and uncertainty.
- hm_OFCGetIntervalsFromQuadstate merely aggregates quadstates into basic signatures and wraps around hm_intervalRules
- hm_intervalRules is a helper to indentify segments of quadstates and merge them into larger segments by (definable) rules. Eg. a segment of "contraction" followed by a segment of "relaxation" with a "Nothing" segment of maximum length X shall be defined as a "Heartbeat" segment. These definition should go along with your biological definition for event-boundaries.
- hm_signatureToIntervals map signatures to SOHA style intervals
- hm_waveSpeedBeats Management code to apply speed calulation to single beats (provided by any interval detection) and respect the timing/windowsize/etc
- hm_waveSpeedbyShiftBeats Actual wavespeed calculation for single beats. The strategy is described in hm_waveSpeedBeats and the publication.
Interval detection relies on some simple of the direction histograms. For those, max value, larger sum and many more seemed to work all reasonably well. However, this did not yield an exact major direction for each frame.
- directions Applies a gaussian to a direction histogram
- angularMovement contains management to help execution and plotting of data generated by directions.m and friends.