sarcgraph.sg.SarcGraph.zdisc_tracking
- SarcGraph.zdisc_tracking(file_path=None, raw_frames=None, segmented_zdiscs=None, sigma=1.0, min_length=8, tp_depth=4.0, full_track_ratio=0.75, skip_merging=False, save_output=True)[source]
Track detected Z-Discs in a video. The input could be the address to a video/image sample (
file_path), raw frames as a numpy array (raw_frames), or segmented zdiscs information in a pandas datafram (segmented_zdiscs)e. If the function is run with no inputs, it will search for ‘raw-frames.npy’, or ‘segmented-zdiscs.csv’ in the specified output directorySarcGraph().output_dir.- Parameters:
file_path (str) – The address of an image or a video file to be loaded
raw_frames (np.ndarray, shape=(frames, dim_1, dim_2, channels)) – Raw input image or video given as a 4 dimensional array
segmented_zdiscs (pd.DataFrame) – Information of all detected zdiscs in every frame.
sigma (float) – Standard deviation for Gaussian kernel, by default
1.0min_length (int) – Minimum length for zdisc contours measured in pixels, by default
8tp_depth (float, optional) – the maximum distance features can move between frames, by default
4.0full_track_ratio (float, optional) – by default
0.75skip_merging (bool, optional) – skipping the merging step will result in fewer fully tracked zdiscs, by default
Falsesave_output (bool) – by default
True
- Returns:
tracked zdiscs information. Columns are
'frame'(frame number),'x'and'y'(zdiscs center position),'p1_x','p1_y','p2_x','p2_y'(zdiscs end points positions), and'particle'(id of each tracked zdisc).- Return type:
pd.DataFrame
Notes
If
SarcGraph().file_type='image', tracking will be skipped.- For a detailed description of the Trackpy package check:
- For a detailed description of the OPTICS algorithm check:
https://scikit-learn.org/stable/modules/generated/sklearn.cluster.OPTICS.html