small bug in sum_images fixed

This commit is contained in:
2022-07-13 17:39:41 +02:00
parent 6515b7bf33
commit 195cabed2b
2 changed files with 11 additions and 3 deletions

View File

@@ -70,8 +70,8 @@ def sum_images(fileset, channel="JF16T03V01", alignment_channels=None, batch_siz
else:
im_ROI = im[:, roi.rows, roi.cols]
res[f"{channel}_intensity"].append(np.sum(im_ROI, axis=(1, 2)))
res["pids"].append(Images.pids[index_slice])
res[f"{channel}_intensity"].extend(np.sum(im_ROI, axis=(1, 2)))
res["pids"].extend(Images.pids[index_slice])
# only return first batch
if preview:

View File

@@ -107,6 +107,14 @@ class ROI:
def __repr__(self):
return f"ROI(bottom={self.bottom}, top={self.top}, left={self.left}, right={self.right})"
def __eq__(self, other):
# we disregard the name
return (self.left, self.right, self.bottom, self.top) == (other.left, other.right, other.bottom, other.top)
def __ne__(self, other):
return not self == other
######################## Setting up paths ########################
@@ -236,4 +244,4 @@ def sigma_to_FWHM(sigma):
def FWHM_to_sigma(FWHM):
"""FWHM to gaussian sigma"""
sigma = FWHM / 2.355
return sigma
return sigma