bed3f1ebd41020f9bbd31ba30b78902775eddbc8,plantcv/plantcv/morphology/segment_euclidean_length.py,,segment_euclidean_length,#Any#Any#Any#,18
Before Change
// Calculate euclidean distance between tips of each contour
segment_lengths.append(euclidean(points[0], points[1]))
eu_length_header = ["HEADER_EU_LENGTH"]
eu_length_data = ["EU_LENGTH_DATA"]
// Put labels of length
for c, value in enumerate(segment_lengths):
text = "{:.2f}".format(value)
w = x_list[c]
h = y_list[c]
cv2.putText(img=labeled_img, text=text, org=(w, h), fontFace=cv2.FONT_HERSHEY_SIMPLEX, fontScale=.4,
color=(150, 150, 150), thickness=1)
segment_label = "ID" + str(c)
eu_length_header.append(segment_label)
eu_length_data.append(segment_lengths[c])
if "morphology_data" not in outputs.measurements:
outputs.measurements["morphology_data"] = {}
outputs.measurements["morphology_data"]["segment_eu_lengths"] = segment_lengths
// Reset debug mode
params.debug = debug
// Auto-increment device
params.device += 1
if params.debug == "print":
print_image(labeled_img, os.path.join(params.debug_outdir, str(params.device) + "_segment_eu_lengths.png"))
elif params.debug == "plot":
plot_image(labeled_img)
return eu_length_header, eu_length_data, labeled_img
After Change
// Calculate euclidean distance between tips of each contour
segment_lengths.append(euclidean(points[0], points[1]))
segment_ids = []
// Put labels of length
for c, value in enumerate(segment_lengths):
text = "{:.2f}".format(value)
w = x_list[c]
h = y_list[c]
cv2.putText(img=labeled_img, text=text, org=(w, h), fontFace=cv2.FONT_HERSHEY_SIMPLEX, fontScale=.4,
color=(150, 150, 150), thickness=1)
segment_label = "ID" + str(c)
segment_ids.append(c)
outputs.add_measurement(variable="segment_eu_length", trait="segment_eu_length",
method="plantcv.plantcv.morphology.segment_euclidean_length", scale="pixels", datatype=list,
value=segment_lengths, label=segment_ids)
// Reset debug mode
params.debug = debug
// Auto-increment device
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: danforthcenter/plantcv
Commit Name: bed3f1ebd41020f9bbd31ba30b78902775eddbc8
Time: 2019-05-01
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/morphology/segment_euclidean_length.py
Class Name:
Method Name: segment_euclidean_length
Project Name: danforthcenter/plantcv
Commit Name: bed3f1ebd41020f9bbd31ba30b78902775eddbc8
Time: 2019-05-01
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/morphology/segment_path_length.py
Class Name:
Method Name: segment_path_length
Project Name: danforthcenter/plantcv
Commit Name: bed3f1ebd41020f9bbd31ba30b78902775eddbc8
Time: 2019-05-01
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/morphology/segment_curvature.py
Class Name:
Method Name: segment_curvature