consistency: removed special case that sends the raw data image instead of the processed image data [special case triggered if apply_aggregation and apply_threshold are off, but both can still be not applied if the respective parameters (aggregation_max, threshold_min, threshold_max) are not given, which would send data]

This commit is contained in:
2024-08-28 10:08:18 +02:00
parent b1f104a71d
commit d0c1621109
2 changed files with 4 additions and 5 deletions

View File

@ -4,15 +4,15 @@ from .mask import calc_mask_pixels
from .thresh import threshold
def calc_apply_aggregation(results, data, pixel_mask_pf, image, aggregator):
data = calc_data(results, data, image, aggregator)
def calc_apply_aggregation(results, data, pixel_mask_pf, aggregator):
data = calc_data(results, data, aggregator)
calc_mask_pixels(data, pixel_mask_pf) # changes data in place
aggregation_ready = calc_aggregation_ready(results, data, aggregator)
return data, aggregation_ready
def calc_data(results, data, image, aggregator):
def calc_data(results, data, aggregator):
if data.dtype == np.uint16:
return data
@ -23,7 +23,6 @@ def calc_data(results, data, image, aggregator):
aggregator.reset()
if not apply_aggregation and not apply_threshold:
data = image
return data
calc_apply_threshold(results, data) # changes data in place

View File

@ -115,7 +115,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
calc_peakfinder_analysis(results, pfdata, pixel_mask_pf)
# ???
data, aggregation_is_ready = calc_apply_aggregation(results, data, pixel_mask_pf, image, aggregator)
data, aggregation_is_ready = calc_apply_aggregation(results, data, pixel_mask_pf, aggregator)
results["type"] = str(data.dtype)
results["shape"] = data.shape