I am scripting TrackMate in a Python file. I want to use a quality spot filter on my data that is set based on the ‘Auto’ filter level that is an option presented in the TrackMate GUI. Following the example from Setting TrackFilter values dynamically , where a similar thing was accomplished for track filters, I have tried initially running a stunted version of TrackMate to obtain the quality values, then feed it back into a full run of TrackMate later to set the spot filter dynamically. This is what I’ve come up with:
model = Model() settings = Settings() settings.setFrom(imp) settings.addSpotAnalyzerFactory(SpotIntensityAnalyzerFactory()) trackmate = TrackMate(model, settings) trackmate.execDetection() trackmate.execInitialSpotFiltering() trackmate.computeSpotFeatures(1); trackmate.execSpotFiltering(1); spotFeatureValues = model.getFeatureModel().getSpotFeatureValues() featureValues = spotFeatureValues.get('QUALITY') optimalMeanIntensity = fiji.plugin.trackmate.util.TMUtils.otsuThreshold(featureValues)
However, it returns the error:
'fiji.plugin.trackmate.FeatureModel' object has no attribute 'getSpotFeatureValues'
I have found the attribute ‘getSpotFeatures’ to work, however it just appears to be a list of names of the different features. I got the initial idea to use ‘getSpotFeatureValues’ from https://github.com/fiji/TrackMate/blob/5532cd4544e73cf6345b1a41eab12f4ae48c8ccf/src/main/java/fiji/plugin/trackmate/action/ExportStatsToIJAction.java on the TrackMate repository, however I have not seen it documented on any other page.
I was wondering if anyone had any idea what the appropriate attribute is to use in order to obtain the quality values of my spots. Any help would be appreciated!