Author:
Uses the command NaN Background from the menu
Process>Math in ImageJ.
Example

Description
Sets all intensities below min and all intensities above max to the
special floating point value NaN (not a number). If the image is not a
32-bit image it is automatically converted to 32-bit.