diff --git a/PyNutil/coordinate_extraction.py b/PyNutil/coordinate_extraction.py index a2a4d8d901f184ba7bc8c312faa0a15c74326c97..5df3143f50ea3c8bf9a377e265fe9820b8879ba6 100644 --- a/PyNutil/coordinate_extraction.py +++ b/PyNutil/coordinate_extraction.py @@ -138,14 +138,7 @@ def folder_to_atlas_space( points_len = [len(points) for points in points_list] centroids_len = [len(centroids) for centroids in centroids_list] points = np.concatenate(points_list) - print("points shape: ",points.shape) 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 ( np.array(points), @@ -195,7 +188,6 @@ def segmentation_to_atlas_space( ) if method in ["per_pixel", "all"]: 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 "markers" in slice: @@ -229,7 +221,9 @@ def segmentation_to_atlas_space( centroids = transform_to_atlas_space( 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) centroids_list[index] = np.array(centroids) diff --git a/PyNutil/counting_and_load.py b/PyNutil/counting_and_load.py index 1d2dfdd4a14ecf09f4d49e9b1d4c354b96217f38..2c7b46eebe62b1716a674b0d7ea4022a906d56b7 100644 --- a/PyNutil/counting_and_load.py +++ b/PyNutil/counting_and_load.py @@ -17,23 +17,23 @@ def label_points(points, label_volume, scale_factor=1): x = points[:, 0] y = points[:, 1] 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 y[y < 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 y[mask] = 0 z[mask] = 0 - print('total mask: ') - print(np.sum(mask)) + # Get the label value for each point - print(x[0], y[0], z[0]) labels = label_volume[x, y, z] - print('label sum: ') - print(np.sum(labels)) + return labels diff --git a/PyNutil/generate_target_slice.py b/PyNutil/generate_target_slice.py index 2968338a1d9b53d066c69b788e3a29cee226a0ac..074fccab093da4cf6e21af3dadee733dffae4b48 100644 --- a/PyNutil/generate_target_slice.py +++ b/PyNutil/generate_target_slice.py @@ -7,7 +7,6 @@ def generate_target_slice(alignment, volume): bounds = [455, 527, 319] X_size = np.sqrt(np.sum(np.square((Ux, Uy, Uz)))) Z_size = np.sqrt(np.sum(np.square((Vx, Vy, Vz)))) - print(X_size, Z_size) X_size = np.round(X_size).astype(int) Z_size = np.round(Z_size).astype(int) # make this into a grid (0,0) to (320,456) diff --git a/PyNutil/main.py b/PyNutil/main.py index c65c8a8f6b6dbb6b89ae29348a47f9b0bf7281e9..b4944882c1ecfe729f0b6680395aa5e3f3a0825e 100644 --- a/PyNutil/main.py +++ b/PyNutil/main.py @@ -272,7 +272,6 @@ class PyNutil: self.segmentation_filenames, self.per_section_df, ): - split_fn = fn.split("/")[-1].split(".")[0] df.to_csv( f"{output_folder}/per_section_reports/{split_fn}.csv",