{ The following macro illustrates that you can do REAL arithmetic with NIH-Image imageMath. Unfortuneately, you cant (yet) save 'real' images but you can inspect numbers behind autoscaled pixels via the 'info' window and even in the 'histogram' window. Note there is a bug in info window display in that if the autoscaled pixel has a zero index then the value shows as zero also. However the real value lies behind as the imageMath scaling below also illustrates. In the illustration below, the maximum value generated is ~180*180*180 = 5,832,000 which scales back correctly to ~89 in 'Product/(256*256)' You need to scale histogram bin values for yourself if you want to use histogram[]. You can do this by using 'measure' to give rMax,rMin. You may find it convenient to force a scale by seeding your image artifically with a know maximum eg using putpixel. A knowledge of or control of maximum allows you to convert pixel value to underlying real value. Greg Joss gjoss@rna.bio.mq.edu.au School of Biological Sciences Macquarie University North Ryde, (Sydney,), Australia } macro 'Test Real Image Math'; var r,t,rs,i,p,o,q:integer; begin setNewSize(256,256); setForeGround(255);setBackground(0); setPalette('grayscale',6); makeNewWindow('Radius Map'); putPixel(128,128,255); invert; binary('edm'); r:=pidNumber; duplicate('TestNumbers'); t:=pidNumber; makeRoi(0,0,256,128); invert; imageMath('mul real',r,r,1,0,'RadiusSquared'); rs:=pidNumber; imageMath('mul real',rs,t,1,0,' RadiusSquared * TestNumbers'); p:=pidNumber; showHistogram; setOptions('X-Y Center max user1 user2'); SetUser1Label('Count'); SetUser2Label('Level'); resetCounter; measure; showResults; for i:=0 to 255 do begin rUser1[i+1]:=histogram[i]; rUser2[i+1]:=rMax[1]*i/256; end; UpdateResults; showResults; {scaling tests:} setCounter(256); imageMath('copy real',p,p,1/256,0,'Product/256'); q:=pidNumber; measure; imageMath('copy real',q,q,1/256,0,'Product/(256*256)'); measure; showHistogram; for i:=0 to 255 do begin rX[i+1]:=histogram[i]; rY[i+1]:=rMax[rCount]*i/256; end; showResults; end;