Skip to content
Snippets Groups Projects
Commit f6343ca9 authored by polarbean's avatar polarbean
Browse files

removed superflous print statements

parent d59df514
No related branches found
No related tags found
No related merge requests found
...@@ -138,14 +138,7 @@ def folder_to_atlas_space( ...@@ -138,14 +138,7 @@ def folder_to_atlas_space(
points_len = [len(points) for points in points_list] points_len = [len(points) for points in points_list]
centroids_len = [len(centroids) for centroids in centroids_list] centroids_len = [len(centroids) for centroids in centroids_list]
points = np.concatenate(points_list) points = np.concatenate(points_list)
print("points shape: ",points.shape)
centroids = np.concatenate(centroids_list) centroids = np.concatenate(centroids_list)
print("centroids shape: ",centroids.shape)
print("Number of points: ", len(points))
print("Number of centroids: ", len(centroids))
print("points_len: ", points_len)
print("points: ", points)
print("points first: ", points[0])
return ( return (
np.array(points), np.array(points),
...@@ -195,7 +188,6 @@ def segmentation_to_atlas_space( ...@@ -195,7 +188,6 @@ def segmentation_to_atlas_space(
) )
if method in ["per_pixel", "all"]: if method in ["per_pixel", "all"]:
scaled_y, scaled_x = get_scaled_pixels(segmentation, pixel_id, y_scale, x_scale) scaled_y, scaled_x = get_scaled_pixels(segmentation, pixel_id, y_scale, x_scale)
print(f"{segmentation_path} \nNumber of objects: {len(scaled_centroidsY)}\nNumber of pixels: {len(scaled_y)}")
if non_linear: if non_linear:
if "markers" in slice: if "markers" in slice:
...@@ -229,7 +221,9 @@ def segmentation_to_atlas_space( ...@@ -229,7 +221,9 @@ def segmentation_to_atlas_space(
centroids = transform_to_atlas_space( centroids = transform_to_atlas_space(
slice["anchoring"], centroids_new_y, centroids_new_x, reg_height, reg_width slice["anchoring"], centroids_new_y, centroids_new_x, reg_height, reg_width
) )
print(f"Finished and points len is: {len(points)} and centroids len is: {len(centroids)}") print(
f"Finished and points len is: {len(points)} and centroids len is: {len(centroids)}"
)
points_list[index] = np.array(points) points_list[index] = np.array(points)
centroids_list[index] = np.array(centroids) centroids_list[index] = np.array(centroids)
......
...@@ -17,23 +17,23 @@ def label_points(points, label_volume, scale_factor=1): ...@@ -17,23 +17,23 @@ def label_points(points, label_volume, scale_factor=1):
x = points[:, 0] x = points[:, 0]
y = points[:, 1] y = points[:, 1]
z = points[:, 2] z = points[:, 2]
print(x[0], y[0], z[0])
# make sure the points are within the volume # make sure the points are within the volume
x[x < 0] = 0 x[x < 0] = 0
y[y < 0] = 0 y[y < 0] = 0
z[z < 0] = 0 z[z < 0] = 0
mask = (x > label_volume.shape[0] - 1) | (y > label_volume.shape[1] - 1) | (z > label_volume.shape[2] - 1) mask = (
(x > label_volume.shape[0] - 1)
| (y > label_volume.shape[1] - 1)
| (z > label_volume.shape[2] - 1)
)
x[mask] = 0 x[mask] = 0
y[mask] = 0 y[mask] = 0
z[mask] = 0 z[mask] = 0
print('total mask: ')
print(np.sum(mask))
# Get the label value for each point # Get the label value for each point
print(x[0], y[0], z[0])
labels = label_volume[x, y, z] labels = label_volume[x, y, z]
print('label sum: ')
print(np.sum(labels))
return labels return labels
......
...@@ -7,7 +7,6 @@ def generate_target_slice(alignment, volume): ...@@ -7,7 +7,6 @@ def generate_target_slice(alignment, volume):
bounds = [455, 527, 319] bounds = [455, 527, 319]
X_size = np.sqrt(np.sum(np.square((Ux, Uy, Uz)))) X_size = np.sqrt(np.sum(np.square((Ux, Uy, Uz))))
Z_size = np.sqrt(np.sum(np.square((Vx, Vy, Vz)))) Z_size = np.sqrt(np.sum(np.square((Vx, Vy, Vz))))
print(X_size, Z_size)
X_size = np.round(X_size).astype(int) X_size = np.round(X_size).astype(int)
Z_size = np.round(Z_size).astype(int) Z_size = np.round(Z_size).astype(int)
# make this into a grid (0,0) to (320,456) # make this into a grid (0,0) to (320,456)
......
...@@ -272,7 +272,6 @@ class PyNutil: ...@@ -272,7 +272,6 @@ class PyNutil:
self.segmentation_filenames, self.segmentation_filenames,
self.per_section_df, self.per_section_df,
): ):
split_fn = fn.split("/")[-1].split(".")[0] split_fn = fn.split("/")[-1].split(".")[0]
df.to_csv( df.to_csv(
f"{output_folder}/per_section_reports/{split_fn}.csv", f"{output_folder}/per_section_reports/{split_fn}.csv",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment