Login  Register

Re: setting 0 value pixel to NaN or ignoring pixels=0

Posted by Fred Damen on Jun 09, 2020; 3:55pm
URL: http://imagej.273.s1.nabble.com/setting-0-value-pixel-to-NaN-or-ignoring-pixels-0-tp5023459p5023461.html

Greetings,

Process>Math>Macro...
if(x==255&&v=0)v=NaN

In most, but not all, Process ignores NaN.  Above will set zeros in column
255 (last column in 256x256 image) to NaN. I do not know how to address
two columns at once, although other macro functionality can be used in the
statement.
If this is not enough then
Plugin>New>Macro

Enjoy,

Fred

On Tue, June 9, 2020 9:04 am, O_W_H wrote:

> Hi I currently have an image which have a condition whereby pixels on the
> outer rows or columns are set to 0, following which the adjacent pixel are
> also set to 0.
>
> I now need to remove these zero pixel from my analysis e.g. so that when i
> run my min function it does not include the zero and also when i apply a 9
> point filter the 0 values in these rows/columns should not be taken into
> consideration.
>
> I am very new to imageJ and can't seem to find the best way to do this. I
> changed the threshold which sorted the minimum value reported but it is
> still affecting my filter.
>
>
>
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html