Hi Miguel,
for me, the macro of Curtis works well
(ImageJ 1.51h; Java 1.6.0_65 [64-bit]; Mac OS X 10.6.8)
Note that the run("Macro...", ...) command, like almost all ImageJ
commands, is restricted to the current selection (= ROI, Region of
Interest).
So you get NaN inside the rectangle, but the values remain 0.0 outside
(there, the run("Macro...", ...) command has no effect)
Michael
________________________________________________________________
On 2016-11-15 02:23, Miguel Tapia R. wrote:
> Hi,
>
> I've tested the following macro wrote by ctrueden:
>
> newImage("Untitled", "8-bit black", 400, 400, 1);
> run("32-bit");
> makeRectangle(83, 88, 235, 228);
> setForegroundColor(50, 50, 50);
> run("Draw");
> run("Macro...", "code=[if (v==0) v=NaN]");
> print("(1, 1) = " + getPixel(1, 1));
>
> on ImageJ 64-bit 1.51h and it show "0" again instead of "NaN", any suggestions? I need to be able to assign NaN values
>
> Thanks in advance,
>
> Miguel
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html