I have a stack showing a piece of heart tissue displaying fluorescence. My aim is to calculate the mean intensity along the length of the tissue, but the tissue has varying thickness. Therefore, I thresholded the picture, replacing the background with NaNs, see picture.
Original tiff image: download
Now, if you set a ROI, and calculate the mean intensity, it works well, if the ROI includes NaN pixels, they are ignored and the mean intensity is correct. Great!
However, my aim is to reduce each frame from 279 x 15 to 279 x 1 pixel frame, and subsequently make a montage of all frames in the stack. This would allow me to nicely follow temporal changes in fluorescence, as in this example.
My problem is that if I use the function Transform > Binning (in Fiji), places in the frame that contain NaN values are not correctly averaged, but are set to NaN instead, see picture.
Having looked at the source code of the binning plugin (here), it appears to me that the problem is that the binning plugin converts the pixel value to an integer.
int[ ] pixel = new int; int[ ] sum = new int;
Does anyone know a solution to this problem?
Teun de Boer