The Math - NaN background function is useful in many cases.
For obvious reasons it only works for 32-bit images.
The problem is that if you by accident try to run it on 8-bit or 16-bit stacks, you are still asked if you want to process all slices; and then an expection is thrown and the ImageJ status bar seems to be stuck. (In one case the contents of my image was set to all zeros but I am unable to reproduce that).
This problem can be fixed by having the check for 32-bit image done at an earlier stage, telling you that it is not supported and then aborting with no changes done to the image. It seems to abort safely with single images.
Here are two demo macro snippets illustrating the problem:
run("CT (420K, 16-bit DICOM)");
setAutoThreshold("Default dark no-reset");
run("NaN Background");
//exits safely with an error message
run("T1 Head (2.4M, 16-bits)");
setSlice(nSlices/2);
setAutoThreshold("Default dark no-reset");
run("NaN Background", "stack");
//an exception is thrown
Stein
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html