Operation: cut lines to size
The operation scans the image along the given lines. Stop when no point
above threshold is found within a range of 6 pixels perpendicular
to the line. Segments along a line are merged if the gap size is
smaller than minConnected*gapFactor and if the length of the
segment is at least minConnected.
Options

min connected: The minimal number of connected pixel that are counted as a segment.
gap factor: gap factor multiplied with min connected gives the maximal length of gaps that will be ignored.
threshold: The intensity threshold for the
tracing of the line. If no pixel above threshold is found near the last
position the tracing stops.
Parameter
inputImage (ImagePlus): A greyscale input image.
lines (ArrayList<Line2D>): A list of lines.
Results
result (ImagePlus): An image representing the line segments found.
resultLines (ArrayList): A list of line segments.