Skip to content

Commit

Permalink
Merge pull request #322 from JoQCcoz/adding_tags
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
JoQCcoz authored Aug 23, 2024
2 parents a72ce71 + cd95f05 commit 947b1f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Smartscope/core/main_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_selectors(square_id):
protocol = get_or_set_protocol(square.grid_id).square.targets
montage = Montage(name=square.name, working_dir=square.grid_id.directory)
montage.load_or_process()
selector_wrapper(protocol.selectors, square, n_groups=5, montage=montage)
selector_wrapper(protocol.selectors, square, montage=montage)
cache_key = f'{square_id}_targets_methods'
cache.delete(cache_key)

Expand Down
8 changes: 7 additions & 1 deletion Smartscope/lib/image_manipulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def extract_from_image(image, center: np.array, apix: float, box_size: float = 2
def extract_box_from_radius(image:np.array, x,y , radius: float, apix: float=-1.0):
if apix != -1.0:
radius = int(radius//apix)
return image[y - radius:y + radius, x - radius:x + radius]
up = max([0, y - radius])
left = max([0, x - radius])
down = min([image.shape[0], y + radius])
right = min([image.shape[1], x + radius])


return image[up:down, left:right]


def to_8bits(image):
Expand Down

0 comments on commit 947b1f3

Please sign in to comment.