Login  Register

Re: subtraction of images

Posted by Michael Schmid on Jun 04, 2008; 11:53am
URL: http://imagej.273.s1.nabble.com/subtraction-of-images-tp3696059p3696065.html

Hi Oliver,

ok, what about a macro like this?

imageCalculator("Difference create", "ImgA","ImgB");
run("Max...", "value=1"); //now equal pixels are 0, different 1
imageCalculator("Multiply create", "ImgA","Result of ImgA");
rename("Result");
selectImage("Result of ImgA");
close();

This macro does not work for float images.

Note that it will work only if the pixels of ImgA and ImgB
that you want to eleiminate are mathematically equal.
If you want some tolerance, subtract the tolerance before
run("Max...


Michael
________________________________________________________________

On 4 Jun 2008, at 13:06, Oliver Bannach wrote:

> Hi Michael,
>
> thank you for your suggestion, but that's not exactly what I was  
> looking for.
> It should look like shown in this example (white=0, black=255):
>
> http://www.biophys.uni-duesseldorf.de/~bannach/ImageJ/example.jpg
>
> Any ideas how to do that?
>
> Thanks
> Oliver
>
> Michael Schmid schrieb:
>> Hi Oliver,
>>
>> The documentation of Image Calculator says:
>>
>>     Subtract     img1 =  img1-img2
>>     Difference   img1 = |img1-img2|
>>
>> So "Difference" will be zero for all pixels where two images
>> are the same. Is this what you are looking for?
>>
>> http://rsb.info.nih.gov/ij/docs/menus/process.html#calculator
>>
>> By the way, Process>Math>Subtract subtracts a constant, not an
>> image.
>>
>> Michael
>> ________________________________________________________________
>>
>> On 4 Jun 2008, at 11:22, Oliver Bannach wrote:
>>
>>> Dear imagej experts
>>>
>>> What I like to do is basically a subtraction of images (imageA  
>>> minus imageB). But each pixel yielding a signal in imageA must be  
>>> set to zero, if it also appears in imageB, regardless of signal  
>>> intensities. In other words: Any colocalized pixel must be black  
>>> in image A. The conventional subtract process (Process->Math-
>>> >Substract) does not work for me, since the pixel intensities in  
>>> ImageA are only reduced by values of ImageB pixels. Can I use  
>>> imageJ standard operations for this purpose or do I need a  
>>> plugin? Any help is greatly appreciated. Thanky you in advance.
>>>
>>> Cheers
>>> Oliver