AND function

10 messages
Open this post in threaded view
|
Report Content as Inappropriate

AND function

 Dear list members, to find colocalization, I am comparing two 8-bit channels with the AND function. I thought, it would calculate like first channel value 128 second channel value 180 AND operation gives 128 or first channel value 110 second channel value 55 AND operation gives 55 etc. However, imagej sometimes does that, but also sometimes yields different values for the AND function. How can that be? I am using imagej version 1.33u on 8-bit tif images gained from a Leica confocal microscope. Help appreciated! Best, Florian Ulrich
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 Hi, On Thu, 14 Jul 2005, Florian Ulrich wrote: > to find colocalization, I am comparing two 8-bit channels with the AND > function. I thought, it would calculate like > > first channel value 128 > second channel value 180 > AND operation gives 128 > > or > > first channel value 110 > second channel value 55 > AND operation gives 55 > > etc. > > However, imagej sometimes does that, but also sometimes yields different > values for the AND function. How can that be? I am using imagej version > 1.33u on 8-bit tif images gained from a Leica confocal microscope. You calculate the Boolean AND function, which means that each pixel's value is interpreted as a dual number, i.e. 128 = dual(10000000), and 55 = dual(110111). The AND function calculates the minimum *per digit*, i.e. 128 AND 55 = 0. What you probably want is the Minimum function. Hth, Dscho
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 Ups, thanks, just discovered that myself as well... now, I am curious: on which type of images and for which kind of analysis would you then use the AND function? What is the significance of the AND function to your images? All the best, Florian > Hi, > > On Thu, 14 Jul 2005, Florian Ulrich wrote: > >> to find colocalization, I am comparing two 8-bit channels with the AND >> function. I thought, it would calculate like >> >> first channel value 128 >> second channel value 180 >> AND operation gives 128 >> >> or >> >> first channel value 110 >> second channel value 55 >> AND operation gives 55 >> >> etc. >> >> However, imagej sometimes does that, but also sometimes yields different >> values for the AND function. How can that be? I am using imagej version >> 1.33u on 8-bit tif images gained from a Leica confocal microscope. > > You calculate the Boolean AND function, which means that each pixel's > value is interpreted as a dual number, i.e. 128 = dual(10000000), and 55 = > dual(110111). The AND function calculates the minimum *per digit*, i.e. > 128 AND 55 = 0. > > What you probably want is the Minimum function. > > Hth, > Dscho > >
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 Florian Ulrich wrote: > Ups, thanks, > > just discovered that myself as well... now, I am curious: on which type of > images and for which kind of analysis would you then use the AND function? > What is the significance of the AND function to your images? Masking off lower bits while leaving the upper bits unchanged. This could be used to blank background noise below a certain threshold w/o modifying brighter image structures. There are other clever uses for AND and OR as well. Ray
Open this post in threaded view
|
Report Content as Inappropriate

(no subject)

 <[hidden email]>               <[hidden email]>     <[hidden email]> Date: Thu, 14 Jul 2005 21:40:44 +0200 (MEST) Subject: Re: AND function From: [hidden email] To: "ImageJ Interest Group" <[hidden email]> User-Agent: SquirrelMail/1.4.5 [CVS] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at mpi-cbg.de Tnx for the answer. My wrong assumption in the beginning is another good demonstration that what one spontaneously regards as being logical has nothing to do with mathematical logics... Best, Florian > Florian Ulrich wrote: >> Ups, thanks, >> >> just discovered that myself as well... now, I am curious: on which type >> of >> images and for which kind of analysis would you then use the AND >> function? >> What is the significance of the AND function to your images? > > Masking off lower bits while leaving the upper bits unchanged. > This could be used to blank background noise below a certain > threshold w/o modifying brighter image structures. > > There are other clever uses for AND and OR as well. > > Ray > >
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 In reply to this post by Raymond Lillard Hi, On Thu, 14 Jul 2005, Raymond Lillard wrote: > Masking off lower bits while leaving the upper bits unchanged. > This could be used to blank background noise below a certain > threshold w/o modifying brighter image structures. Subtract is a much better method for this. I think the AND function is only interesting when overlaying several bilevel channels into one image. Ciao, Dscho
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 Johannes Schindelin wrote: > On Thu, 14 Jul 2005, Raymond Lillard wrote: >>Masking off lower bits while leaving the upper bits unchanged. >>This could be used to blank background noise below a certain >>threshold w/o modifying brighter image structures. > > Subtract is a much better method for this. I think the AND > function is only interesting when overlaying several bilevel channels into > one image. Subtracting will not produce the same result as I described. Subtracting will also dim the bright structures of the image. If you do subtraction, you probably will need to follow with multiplication, which will have the effect of enhancing the contrast. The optimal course of action depends on the nature of the image being studied, and the feature of that image you wish examine in greater detail. In the case of creating a single image by overlaying multiple images, a bit-wise AND will have an odd sort of effect based on powers of 2.  That might be what you want, but likely not. On this list, about a year ago I asked the question marked by ">"s that follow.  > I have images were I want to conditionally set a  > pixel to an arbitrary value of my choosing.  For  > example, given a pixel (p) then:  >  >   if ( p > constant1 ) then p = constant2  >  > Is this built into ImageJ or do I need to write something?         Wayne Rasband answered:         The changeValues() macro function will do this. Use       changeValues(constant1+1, max, constant2);         where 'max' is 255 for 8-bit images and 65535         for 16-bit images. Variations that change the conditional expression and constants to suit the image seem to be optimal. Regards all, Ray
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 In reply to this post by Florian Ulrich At 01:28 PM 7/14/05 +0200, Florian Ulrich wrote: >to find colocalization, I am comparing two 8-bit channels with the AND >function. I thought, it would calculate like >first channel value 110 >second channel value 55 >AND operation gives 55...         110 AND 55 is 38, not 55. Rex Couture
Open this post in threaded view
|
Report Content as Inappropriate

Re: AND function

 yep, but that's what I got. anyway, the min operation nicely works. thanks again, Florian > At 01:28 PM 7/14/05 +0200, Florian Ulrich wrote: >>to find colocalization, I am comparing two 8-bit channels with the AND >>function. I thought, it would calculate like > >>first channel value 110 >>second channel value 55 >>AND operation gives 55... > >         110 AND 55 is 38, not 55. > > Rex Couture > >