trackmate-sc / TrackMate

TrackMate is your buddy for your everyday tracking.
https://imagej.net/plugins/trackmate
GNU General Public License v3.0
169 stars 76 forks source link

Function for average spot intensity #258

Closed jbogomolovas2 closed 8 months ago

jbogomolovas2 commented 1 year ago

First of all: great tool! I am using it to track and extract ratiometric intensity data from motile cells. I have two channels: 32bit masks from Cellpose and 32bit ratiometric intensities to measure. The issue is that i set my ratiometric channel background to NaN and when Trackmate calculates average intensity it ignores spots with NaN values, yet for median (as NaNs are rare) it is not problem. Would it be possible to change the average intensity calculation function similar to fiji one, that it would ignore Nans in ROIs, when calculating, not otherwise: ignore ROIs(aka spots) with Nan values

tinevez commented 1 year ago

Hello @jbogomolovas2 and thank you for your kind words. I am sorry I am not sure I properly get what should be changed. Could you re-explain it to me?

jbogomolovas2 commented 1 year ago

Thank you for your response @tinevez! So basically when doing statistics on spots from 32bit images, is it possible to ignore NAN pixels and work only with integers. I included the sketch explaining the issue. IMG_3621

tinevez commented 1 year ago

It's ready to be ported in the next TrackMate release. Just so that you know it's one of the best issue message I got :)

jbogomolovas2 commented 10 months ago

Dear @tinevez,

sorry to pester you again. After measuring cells manually I circled back to Trackmate. I am using the Trackmate v 7.11 and it seems it is still picking NaNs with 32bit images in spot intensity statistics. Is there any way around that. I included screenshot to illustrate ongoing problem. Black pixels is NAN, colored are >=0.

Screenshot 2024-01-24 at 9 24 38 AM