Skip to content

Commit

Permalink
update to recent API
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Apr 23, 2022
1 parent 5db77e1 commit 90bb852
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public boolean executeCL() {

public static double meanOfMaskedPixels(CLIJ2 clij2, ClearCLBuffer clImage, ClearCLBuffer mask) {
ClearCLBuffer tempBinary = clij2.create(clImage);
// todo: if we can be sure that the mask has really only 0 and 1 pixel values, we can skip this first step:
ClearCLBuffer tempMultiplied = clij2.create(clImage);
NotEqualConstant.notEqualConstant(clij2, mask, tempBinary, 0f);
clij2.notEqualConstant(mask, tempBinary, 0f);
clij2.mask(clImage, tempBinary, tempMultiplied);
double sum = clij2.sumPixels(tempMultiplied);
double count = clij2.sumPixels(tempBinary);
Expand Down

0 comments on commit 90bb852

Please # to comment.