Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/evo-biomech/scAnt
Browse files Browse the repository at this point in the history
  • Loading branch information
Brit0sh committed Feb 28, 2024
2 parents 44be8a5 + 9b6a966 commit 9feccaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions processStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def process_stack(data, output_folder, path_to_external, sharpen, use_experiment
if used_platform != "Linux" and use_experimental_stacking:
os.system(
str(path_to_external) + "\\focus-stack\\focus-stack " +
data + " --output=" + output_path
data + " --output=" + output_path
)
else:
if used_platform == "Linux":
Expand Down Expand Up @@ -650,9 +650,9 @@ def mask_images(input_paths, min_rgb, max_rgb, min_bl, min_wh, create_cutout=Fal

#Read important post processing parameters - if not defined from cmd
if args["threshold"] is not None:
focus_threshold = args["threshold"]
focus_threshold = float(args["threshold"])
else:
focus_threshold = config["stacking"]["threshold"]
focus_threshold = float(config["stacking"]["threshold"])

#parse boolean args
if str(args["stacking"]).lower() == "false" or not args["stacking"]:
Expand Down Expand Up @@ -929,8 +929,7 @@ def mask_images(input_paths, min_rgb, max_rgb, min_bl, min_wh, create_cutout=Fal
for t in threads:
t.join()
print("All images processed!\nExiting Main Thread")
exit()


if metadata_check:

for img in os.listdir(str(stacked_dir)):
Expand All @@ -940,6 +939,9 @@ def mask_images(input_paths, min_rgb, max_rgb, min_bl, min_wh, create_cutout=Fal

cv2.imwrite(str(stacked_dir.joinpath(img)), img_tif)
write_exif_to_img(img_path=str(stacked_dir.joinpath(img)), custom_exif_dict=exif)
exit()



else:
print("No config file found in folder!")
1 change: 1 addition & 0 deletions scAnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,7 @@ def processStack(self, progress_callback):
write_exif_to_img(img_path=stacked_output[0], custom_exif_dict=self.exif)

if self.maskImages:
time.sleep(0.2)
mask_images(input_paths=stacked_output, min_rgb=self.maskThreshMin, max_rgb=self.maskThreshMax,
min_bl=self.maskArtifactSizeBlack, min_wh=self.maskArtifactSizeWhite, create_cutout=True)

Expand Down

0 comments on commit 9feccaf

Please sign in to comment.