From b92a704b145aa7263f55e97e46d992d90e14cbc6 Mon Sep 17 00:00:00 2001 From: Kai Schleicher Date: Wed, 14 Jan 2026 15:37:11 +0100 Subject: [PATCH 1/2] Fix Ruff errors --- src/imcflibs/imagej/trackmate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/imcflibs/imagej/trackmate.py b/src/imcflibs/imagej/trackmate.py index b8a634fc..1776f2a8 100644 --- a/src/imcflibs/imagej/trackmate.py +++ b/src/imcflibs/imagej/trackmate.py @@ -236,16 +236,16 @@ def spot_filtering( def set_spotfilter(settings, filter_key, filter_value): - """Sets a TrackMate spot filter with specified filter key and values. + """Set a TrackMate spot filter with specified filter key and values. Parameters ---------- settings : fiji.plugin.trackmate.Settings Dictionary containing all the settings to use for TrackMate. - filter_name : str + filter_key : str The name of the filter to be applied. You must use the keys of the features, not their name. - Here is the table of the feature keys and names for the spot features: - https://imagej.net/plugins/trackmate/scripting/trackmate-detectors-trackers-keys + Here is the table of the feature keys and names for the spot features: + https://imagej.net/plugins/trackmate/scripting/trackmate-detectors-trackers-keys filter_value : list A list containing two values for the filter. The first value is applied as an above-threshold filter, and the second as a below-threshold filter. From 3414d4018732e481305f15d0721353ac4e37842f Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter Date: Wed, 14 Jan 2026 17:57:49 +0100 Subject: [PATCH 2/2] Fix set_spotfilter docstring --- src/imcflibs/imagej/trackmate.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/imcflibs/imagej/trackmate.py b/src/imcflibs/imagej/trackmate.py index 1776f2a8..7f16b325 100644 --- a/src/imcflibs/imagej/trackmate.py +++ b/src/imcflibs/imagej/trackmate.py @@ -241,15 +241,17 @@ def set_spotfilter(settings, filter_key, filter_value): Parameters ---------- settings : fiji.plugin.trackmate.Settings - Dictionary containing all the settings to use for TrackMate. + Settings object to use for TrackMate. filter_key : str - The name of the filter to be applied. You must use the keys of the features, not their name. - Here is the table of the feature keys and names for the spot features: - https://imagej.net/plugins/trackmate/scripting/trackmate-detectors-trackers-keys + The key-name of the filter to be applied (as opposed to the filter + "name" shown in ImageJ. Refer to the spot features table on the related + ImageJ wiki page: + https://imagej.net/plugins/trackmate/scripting/trackmate-detectors-trackers-keys#the-feature-penalty-map filter_value : list - A list containing two values for the filter. The first value is - applied as an above-threshold filter, and the second as a below-threshold filter. - + A list containing two values for the filter. The first value is applied + as an above-threshold filter, and the second as a below-threshold + filter. + Returns ------- Settings @@ -257,10 +259,12 @@ def set_spotfilter(settings, filter_key, filter_value): Example ------- - >>> # Set an above-threshold filter value for spot "QUALITY" without a below-threshold value - >>> tm_settings = set_trackmate_spotfilter(tm_settings, 'QUALITY', [120, None]) + + To set an above-threshold filter value for spot `QUALITY` without a + below-threshold value use: + + >>> settings = set_trackmate_spotfilter(tm_settings, 'QUALITY', [120, None]) """ - settings.addAllAnalyzers() if filter_value[0] != None: filter_low = FeatureFilter(filter_key, filter_value[0], True) @@ -272,7 +276,6 @@ def set_spotfilter(settings, filter_key, filter_value): return settings - def sparse_lap_tracker(settings): """Create a sparse LAP tracker with default settings.