getResult() ouput from TrackMate error

Tags: #<Tag:0x00007fb883757798> #<Tag:0x00007fb883757450> #<Tag:0x00007fb883757108>


I run TrackMate, export the tracks, reload them as Results table which returns a TRACK_ID column that contains either a number limited to [0…nResults-1] or “None”. According to the manual getResult returns a string. Expecting I can compare two strings with the == operator, I have these macro steps:

	if(trackID == "None"){trackID=-1;}

With a certain i, when trackID contains 13 according to the debug window, I get an error

Number or numeric function expected  in line 104
if(trackID == <"None">){trackID=-1;}

which I don’t understand if getResult returns a string type. I’d expect a type cast to if(string == string) which shouldn’t pose a problem. Example code also shows the use of string comparison.
Do I overlook the obvious?



So… I’m not sure the definitive answer in this case… but I suppose you can always add toString(trackID) within the if statement to be sure this error does not pop up.

But of course - this is just a hacky-workaround and doesn’t get to why this is happening…



Thanks, I’m off testing.

[a little later] Closer inspection shows that TRACK_ID contains ‘None’ in the column, but the VALUE of TRACK_ID is NaN. Wonder how I missed that. Testing for isNaN is the obvious solution then.

If I do not follow up on this post, consider it solved. Ehr, worked around.