Skip to content

Commit

Permalink
updated print
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakpati committed Jul 11, 2023
1 parent bd956f2 commit 65a6a5f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions FigureGenerator/screenshot_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def __init__(self, args):
self.calculate_bounds_mask = True
self.calculate_bounds = False
if not (self.mask_present):
raise ValueError(
print(
"If mask is not provided, then boundtype must be 'image'"
)
self.calculate_bounds = True
self.calculate_bounds_mask = False
else:
self.calculate_bounds = False
self.calculate_bounds_mask = False
Expand Down Expand Up @@ -262,7 +264,7 @@ def read_images_and_store_arrays(self):
# if mask is not defined, pick the middle of the array
max_id = (
np.around(
np.true_divide(np.array(self.input_images_bounded)[0].shape, 2)
np.true_divide(sitk.GetArrayFromImage(self.input_images_bounded[0]).shape, 2)
)
.astype(int)
.tolist()
Expand Down Expand Up @@ -398,7 +400,7 @@ def figure_generator(
borderpc: float = 0.05,
axisrow: bool = False,
fontsize: int = 15,
boundtype: str = "image",
boundtype: str = "None",
) -> None:
"""
This is a functional interface to the class :class:`FigureGenerator`. It takes in the same arguments as the class and generates the figure.
Expand All @@ -422,6 +424,7 @@ def figure_generator(
# save the screenshot
args_for_fig_gen = argparse.ArgumentParser()
args_for_fig_gen.images = input_images
args_for_fig_gen.masks = input_mask
args_for_fig_gen.ylabels = ylabels
args_for_fig_gen.opacity = opacity
args_for_fig_gen.borderpc = borderpc
Expand Down

0 comments on commit 65a6a5f

Please sign in to comment.