Skip to content

Commit

Permalink
removed excessive print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean committed Aug 21, 2024
1 parent b3285a1 commit a8adf6e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion PyNutil/coordinate_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def load_segmentation(segmentation_path: str):
def detect_pixel_id(segmentation: np.array):
"""Remove the background from the segmentation and return the pixel id."""
segmentation_no_background = segmentation[~np.all(segmentation == 0, axis=2)]
print("length of non background pixels: ", len(segmentation_no_background))
pixel_id = segmentation_no_background[0]
print("detected pixel_id: ", pixel_id)
return pixel_id
Expand Down
4 changes: 0 additions & 4 deletions PyNutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ def quantify_coordinates(self):
per_section_df = []
current_centroids = None
current_points = None
print("region areas list")
print(self.region_areas_list)
for pl, cl, ra in zip(
self.points_len, self.centroids_len, self.region_areas_list
):
Expand All @@ -257,8 +255,6 @@ def quantify_coordinates(self):
current_df = pixel_count_per_region(
current_points, current_centroids, self.atlas_labels
)
print("current df", current_df)

# create the df for section report and all report
# pixel_count_per_region returns a df with idx, pixel count, name and RGB.
# ra is region area list from
Expand Down
5 changes: 0 additions & 5 deletions PyNutil/read_and_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def load_visualign_json(filename):
slices = vafile["sections"]
vafile["slices"] = slices
for slice in slices:
print(slice)
slice["nr"] = int(re.search(r"_s(\d+)", slice["filename"]).group(1))
if "ouv" in slice:
slice["anchoring"] = slice["ouv"]
Expand Down Expand Up @@ -108,7 +107,6 @@ def code():
if "SegRLEv1" != f.read(8).decode():
raise "Header mismatch"
atlas = f.read(code()).decode()
print(f"Target atlas: {atlas}")
codes = [code() for x in range(code())]
w = code()
h = code()
Expand Down Expand Up @@ -158,9 +156,6 @@ def files_in_directory(directory):
list_of_files = []
for file in os.scandir(directory):
if file.path.endswith(".flat") and file.is_file:
# print(filename.path)
# newfilename, file_ext = os.path.splitext(filename)
# print(newfilename)
filename = os.path.basename(file)
newfilename, file_ext = os.path.splitext(filename)
list_of_files.append(newfilename)
Expand Down
4 changes: 0 additions & 4 deletions PyNutil/visualign_deformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ def __init__(self, a, b, c, vlist, elist):
self.decomp = inv3x3(
[[bx - ax, by - ay, 0], [cx - ax, cy - ay, 0], [ax, ay, 1]]
)
if self.decomp == None:
print("e")
a2 = distsquare(bx, by, cx, cy)
b2 = distsquare(ax, ay, cx, cy)
c2 = distsquare(ax, ay, bx, by)
Expand Down Expand Up @@ -211,8 +209,6 @@ def inforward_vec(self, x, y, xPrime, yPrime):
)

def intriangle_vec(self, x, y, xPrime, yPrime):
if self.decomp is None:
print("e")
uv1 = rowmul3_vec(x, y, self.decomp)
# also compute the next step, since it uses the parameters of this triangle
ok = (
Expand Down
15 changes: 0 additions & 15 deletions scripts/waln_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,13 @@ def waln_to_json(filename):
vafile["slices"] = slices

for slice in slices:
print(slice) # this prints info from waln to screen.
if "filename" in slice:
base_name = os.path.basename(slice["filename"]).split('.')[0]
new_filename = base_name + '.png'
slice["filename"] = new_filename
slice["nr"] = int(re.search(r"_s(\d+)", slice["filename"]).group(1))
if "ouv" in slice:
slice["anchoring"] = slice["ouv"]

'''
for slice in slices:
print(slice) # this prints info from waln to screen.
if "filename" in slice:
name, old_extension = slice["filename"].rsplit('.',1)
new_filename = name + '.png'
slice["filename"] = new_filename
slice["nr"] = int(re.search(r"_s(\d+)", slice["filename"]).group(1))
if "ouv" in slice:
slice["anchoring"] = slice["ouv"]
'''

name = os.path.basename(filename)
va_compat_file = {
Expand All @@ -51,8 +38,6 @@ def waln_to_json(filename):
#json.dump(va_compat_file, f, indent=4)
json.dump(va_compat_file, f, indent=4)

print("Waln or Wwrp converted successfully to JSON")

else:
pass

Expand Down

0 comments on commit a8adf6e

Please sign in to comment.