Streak Finder algorithm for CBD experiment #2
@@ -148,9 +148,9 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
streaks = det_obj.to_streaks(detected)
|
||||
|
||||
if x_center is not None and y_center is not None:
|
||||
streaks = streaks.concentric_only(x_center, y_center)
|
||||
streaks_mask = streaks.concentric_only(x_center, y_center)
|
||||
|
||||
streak_lines = streaks.lines
|
||||
streak_lines = streaks.lines[streaks_mask]
|
||||
streak_lengths = np.sqrt(
|
||||
np.pow((streak_lines[..., 2] - streak_lines[..., 0]), 2) +
|
||||
np.pow((streak_lines[..., 2] - streak_lines[..., 0]), 2)
|
||||
@@ -161,7 +161,8 @@ def _calc_streakfinder_analysis(results, cryst_data: CrystData):
|
||||
print(f"Found {number_of_streaks} streaks")
|
||||
|
||||
list_result = [line.tolist() for line in streak_lines] # arr(4, n_lines); 0coord x0, y0, x1, y1
|
||||
bragg_counts = [streak.total_mass() for streak in detected.streaks.values()]
|
||||
detected_streaks = np.asarray(detected.streaks.values())[streaks_mask]
|
||||
bragg_counts = [streak.total_mass() for streak in detected_streaks]
|
||||
|
||||
results.update({"number_of_streaks": number_of_streaks})
|
||||
results.update({"is_hit_frame": number_of_streaks > 0})
|
||||
|
||||
@@ -121,7 +121,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
|
||||
print(f"Applying whitefield correction")
|
||||
calc_apply_whitefield_correction(results, image) # changes image in place
|
||||
print(f"Searching streaks")
|
||||
calc_streakfinder_analysis(results, image, pixel_mask_pf)
|
||||
image = calc_streakfinder_analysis(results, image, pixel_mask_pf) # changes image in place is do_snr=True
|
||||
print(f"Done\n{results=}")
|
||||
|
||||
image, aggregation_is_ready = calc_apply_aggregation(results, image, pixel_mask_pf, aggregator)
|
||||
|
||||
Reference in New Issue
Block a user