ImageMath subtraction of images ADDS them instead!

Can someone tell me how to subtract binary images from each other? Is ImageMath known to be defective like this?

Hmm, that’s certainly not the expected behavior! Can you upload images and a pipeline to help us reproduce?

I’m having a similar issue. I’m trying to subtract one binary image from another, as in the 3D monolayer tutorial on Github. It looks like, everywhere I try to subtract 1 from 0, the output is 1. Here are some screenshots and my pipeline if you can see anything I’m doing wrong.

2020_06_04_3DSegmentation_CellsPractice_MoreMembrane.cpproj (783.5 KB)

Hi @davidmb,

Thanks for the information, this looks like a problem with the module itself.

I’ve launched a bug report here. Hopefully we’ll get that fixed for the next release.

As a temporary workaround, you could try adding a second ImageMath module which runs the ‘And’ operation on the first image and the result from the subtract operation.

Hope that helps

1 Like