Skip to content

Commit

Permalink
refactor: use only a valid_mask for simplifying (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
JinIgarashi authored Apr 9, 2024
1 parent f8223c7 commit 6931206
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cogserver/algorithms/rca.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ def __call__(self, img: ImageData) -> ImageData:
v = 0.1
#v = data.ptp()*.1
datam = (data > -v) & (data < v)
valid_mask |= datam
if self.threshold:
datam = datam | np.abs(data)< self.threshold
arr = numpy.ma.masked_array(data*100, dtype=self.output_dtype, mask=valid_mask | datam )
threshold_mask = np.abs(data)< self.threshold
valid_mask |= threshold_mask

arr = numpy.ma.masked_array(data*100, dtype=self.output_dtype, mask=valid_mask)
return ImageData(
arr,
assets=img.assets,
Expand Down

0 comments on commit 6931206

Please sign in to comment.