Skip to content

Commit

Permalink
debugged net grad spot images
Browse files Browse the repository at this point in the history
  • Loading branch information
Heerpa committed Apr 10, 2024
1 parent 30aa936 commit d06216a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
13 changes: 2 additions & 11 deletions picasso_workflow/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ def _auto_min_netgrad(
box_size,
self.analysis_config["camera_info"],
)
logger.debug("sample spots: " + str(len(sample_spots)))
logger.debug("sample spot shape: " + str(sample_spots[0].shape))

border_width = 2
canvas_size = (
Expand All @@ -414,17 +412,10 @@ def normalize_spot(spot, maxval=255, dtype=np.uint8):
ix, iy = i // sample_spots_cols, i % sample_spots_cols
pix = ix * (box_size + border_width)
piy = iy * (box_size + border_width)
logger.debug(
"normspot shape: " + str(normalize_spot(spot).shape)
)
logger.debug("normspot: " + str(normalize_spot(spot)))
# logger.debug('target: ' + str(canvas[
# pix:pix + box_size,
# piy:piy + box_size]))
canvas[pix:pix + box_size, piy:piy + box_size] = (
spot # normalize_spot(spot)
normalize_spot(spot)
)
break
# break
ax[1].imshow(canvas, cmap="gray", interpolation="nearest")
ax[1].grid(visible=False)
ax[1].tick_params(bottom=False, left=False)
Expand Down
7 changes: 3 additions & 4 deletions picasso_workflow/tests/test_analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,15 @@ def test_03_AutoPicasso_load_dataset_movie(self, mock_load_movie):

@patch("picasso_workflow.analyse.localize.get_spots")
def test_04_AutoPicasso_auto_min_netgrad(self, mock_get_spots):
mock_get_spots.return_value = np.random.randint(
0, 1000, size=(7, 7), dtype=np.uint16
)
mock_get_spots.return_value = [
np.random.randint(0, 1000, size=(7, 7), dtype=np.uint16)
] * 48
fn = os.path.join(self.results_folder, "autominnet.png")
results = self.ap._auto_min_netgrad(
box_size=7, frame_numbers=[9], filename=fn
)
logger.debug(results)
assert results["filename"] == fn
assert False

os.remove(fn)

Expand Down

0 comments on commit d06216a

Please sign in to comment.