Skip to content

Commit

Permalink
Add: image grain crops to topostats object and fix process scan both …
Browse files Browse the repository at this point in the history
…regtest
  • Loading branch information
SylviaWhittle committed Dec 20, 2024
1 parent ba08b36 commit 8da84e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image_size_x_m image_size_y_m image_area_m2 image_size_x_px image_size_y_px image_area_px2 grains_number_above grains_per_m2_above grains_number_below grains_per_m2_below rms_roughness
image
minicircle_small 1.2646e-07 1.2646e-07 1.5993e-14 64 64 4096 3 1.8758e+14 1 6.2526e+13 6.8208e-10
centre_x centre_y grain_number radius_min radius_max radius_mean radius_median height_min height_max height_median height_mean volume area area_cartesian_bbox smallest_bounding_width smallest_bounding_length smallest_bounding_area aspect_ratio threshold max_feret min_feret image grain_endpoints grain_junctions total_branch_lengths grain_width_mean total_contour_length average_end_to_end_distance
0 7.5100e-08 4.7559e-08 0 3.9431e-09 2.5631e-08 1.6016e-08 1.6680e-08 9.1991e-10 2.6422e-09 1.5338e-09 1.5341e-09 1.0543e-24 6.8721e-16 1.3198e-15 2.0539e-08 5.0379e-08 1.0347e-15 4.0769e-01 above 5.0379e-08 2.0539e-08 minicircle_small 1.0000e+00 1.0000e+00 8.4571e-08 8.2685e-09 6.5881e-08 8.8370e-09
1 8.0241e-08 7.8677e-08 1 6.8951e-09 2.7188e-08 1.6272e-08 1.6263e-08 9.0630e-10 2.4586e-09 1.6144e-09 1.6264e-09 1.0352e-24 6.3645e-16 1.5931e-15 2.0174e-08 5.1212e-08 1.0332e-15 3.9394e-01 above 5.1262e-08 2.0174e-08 minicircle_small 0.0000e+00 0.0000e+00 7.3054e-08 7.6154e-09 5.8272e-08 0.0000e+00
2 4.0012e-08 7.5644e-08 2 9.9461e-09 2.3654e-08 1.7561e-08 1.8364e-08 9.0641e-10 2.1066e-09 1.5939e-09 1.5493e-09 1.1192e-24 7.2236e-16 1.5462e-15 3.3592e-08 4.1496e-08 1.3940e-15 8.0952e-01 above 4.4405e-08 3.2528e-08 minicircle_small 0.0000e+00 0.0000e+00 1.0447e-07 7.8033e-09 8.7183e-08 0.0000e+00
3 3.2366e-08 1.4036e-08 0 7.7690e-10 1.2272e-08 6.4301e-09 6.4170e-09 -3.7937e-10 -2.1207e-10 -2.4477e-10 -2.6816e-10 -3.0364e-26 1.1323e-16 3.0066e-16 7.0841e-09 2.1505e-08 1.5234e-16 3.2941e-01 below 2.2092e-08 7.0841e-09 minicircle_small NaN NaN NaN NaN NaN NaN
class_number subgrain_number grain_number centre_x centre_y radius_min radius_max radius_mean radius_median height_min height_max height_median height_mean volume area area_cartesian_bbox smallest_bounding_width smallest_bounding_length smallest_bounding_area aspect_ratio threshold max_feret min_feret image grain_endpoints grain_junctions total_branch_lengths grain_width_mean total_contour_length average_end_to_end_distance
0 1 0 0 3.7555e-08 8.9055e-08 3.9431e-09 2.5631e-08 1.6016e-08 1.6680e-08 9.1991e-10 2.6422e-09 1.5338e-09 1.5341e-09 1.0543e-24 6.8721e-16 1.3198e-15 2.0539e-08 5.0379e-08 1.0347e-15 4.0769e-01 above 5.0379e-08 2.0539e-08 minicircle_small 1.0000e+00 1.0000e+00 8.5729e-08 9.5493e-09 6.7087e-08 9.4020e-09
1 1 0 1 7.4313e-08 8.8557e-08 6.8951e-09 2.7188e-08 1.6272e-08 1.6263e-08 9.0630e-10 2.4586e-09 1.6144e-09 1.6264e-09 1.0352e-24 6.3645e-16 1.5931e-15 2.0174e-08 5.1212e-08 1.0332e-15 3.9394e-01 above 5.1262e-08 2.0174e-08 minicircle_small 0.0000e+00 0.0000e+00 7.3054e-08 7.6878e-09 5.7989e-08 0.0000e+00
2 1 0 2 7.9532e-08 4.0076e-08 9.9461e-09 2.3654e-08 1.7561e-08 1.8364e-08 9.0641e-10 2.1066e-09 1.5939e-09 1.5493e-09 1.1192e-24 7.2236e-16 1.5462e-15 3.3592e-08 4.1496e-08 1.3940e-15 8.0952e-01 above 4.4405e-08 3.2528e-08 minicircle_small 0.0000e+00 0.0000e+00 1.0331e-07 7.8754e-09 8.5725e-08 0.0000e+00
3 1 0 0 2.0510e-08 2.9845e-08 7.7690e-10 1.2272e-08 6.4301e-09 6.4170e-09 -3.7937e-10 -2.1207e-10 -2.4477e-10 -2.6816e-10 -3.0364e-26 1.1323e-16 3.0066e-16 7.0841e-09 2.1505e-08 1.5234e-16 3.2941e-01 below 2.2092e-08 7.0841e-09 minicircle_small NaN NaN NaN NaN NaN NaN
Binary file modified tests/resources/process_scan_topostats_file_regtest.topostats
Binary file not shown.
2 changes: 2 additions & 0 deletions topostats/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,8 @@ def process_scan(
grains_config=grains_config,
)

topostats_object["grain_crops"] = image_grain_crops

if image_grain_crops.above is not None or image_grain_crops.below is not None:
# Grainstats :
grainstats_df, height_profiles = run_grainstats(
Expand Down

0 comments on commit 8da84e2

Please sign in to comment.