Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
046daa3
Move the GEFF writer to its package,
tinevez Jul 20, 2026
0180109
Don't write useless features.
tinevez Jul 20, 2026
a9ddc96
Serialize DisplaySettings to a Json tree.
tinevez Jul 20, 2026
86d4855
Rework the GEFF writer.
tinevez Jul 20, 2026
c1e1b35
Also save TrackMate version.
tinevez Jul 20, 2026
ffc8753
WIP: Serialize Settings class to Json
tinevez Jul 20, 2026
9077d2f
In Settings, reorder fields and add nchannels.
tinevez Jul 20, 2026
84c0be7
Fully serialize a Settings object to GEFF.
tinevez Jul 20, 2026
d2be336
Mark a few fields of FeatureModel transient
tinevez Jul 21, 2026
5b90aa2
Serialize feature declarations to GEFF.
tinevez Jul 21, 2026
88a227d
Serialize display_hints.
tinevez Jul 21, 2026
e089621
Serialize relative path to image as a related object.
tinevez Jul 21, 2026
e297330
Write TRACKMATE ID and 'radius' for spots.
tinevez Jul 21, 2026
641236e
Save the trackID to GEFF.
tinevez Jul 21, 2026
c0c3351
Read a TrackMate model from a GEFF file.
tinevez Jul 21, 2026
83f0711
Read feature declarations.
tinevez Jul 21, 2026
b21a5e5
Simplify writing feature values.
tinevez Jul 21, 2026
6452170
Properly read edge features.
tinevez Jul 21, 2026
d6e5d5d
Deserializing Settings from Json updates an existing instance.
tinevez Jul 21, 2026
cb7ca44
Read Settings and ImagePlus from GEFF.
tinevez Jul 21, 2026
01e1f4e
Read display settings from GEFF.
tinevez Jul 21, 2026
31b3a6f
Read GUI state.
tinevez Jul 21, 2026
3c2f90e
Post-process the deserialized Settings
tinevez Jul 21, 2026
ec67b6c
Change the green color for readability.
tinevez Jul 21, 2026
52e272f
Update the paper list.
tinevez Jul 21, 2026
55d1489
Use common key to save log.
tinevez Jul 21, 2026
daaddcc
Give deserialized spots a default name
tinevez Jul 21, 2026
e63083a
Deserialize the log.
tinevez Jul 21, 2026
94d721d
Update the GEFF test drive.
tinevez Jul 21, 2026
72785d4
DisplayHints for time must match the time axis, which is FRAME now.
tinevez Jul 21, 2026
fb11e84
We want to save all spots, even the invisible ones.
tinevez Jul 21, 2026
c093279
Don't write metadata for props that won't have a value.
tinevez Jul 21, 2026
5d49795
Properly serialize int feature values.
tinevez Jul 21, 2026
6efa940
Only add metadata on edge features that are used at least once.
tinevez Jul 21, 2026
a7a4ac3
WIP: Serialize spot names.
tinevez Jul 21, 2026
c819609
De/serialize spot names.
tinevez Jul 22, 2026
ab41143
FeatureUtils.autoMinMax with or without invisible objects.
tinevez Jul 22, 2026
4a1f09a
Save and reload track features, names, and visibility via geffception.
tinevez Jul 22, 2026
a35192c
Use static imports for constants.
tinevez Jul 22, 2026
490f100
Don't transform units to Zarr units.
tinevez Jul 23, 2026
5858326
Don't deserialize the TRACK_ID val into a Spot feature.
tinevez Jul 23, 2026
c875d1e
Deserialize default edge Z position
tinevez Jul 23, 2026
a5e3b03
Don't store or use the 'score' and 'distance' edge props.
tinevez Jul 23, 2026
7f62cd9
Add Assertj dep to test scope.
tinevez Jul 23, 2026
2ed9638
Test for model equality after saving and reloading to/from GEFF.
tinevez Jul 23, 2026
000ddf5
Remove the nchannels field from Settings.
tinevez Jul 23, 2026
5c81b11
WIP: Test for Settings equality after GEFF de/serialization.
tinevez Jul 23, 2026
4a296cc
Remove the 'BLOCKING_VALUE' parameter from LAP trackers settings.
tinevez Jul 24, 2026
58e7496
Also test for log, GUI state and display settings equality.
tinevez Jul 24, 2026
dca6465
Move the GEFF demo to a geff package.
tinevez Jul 24, 2026
2c3f282
When reading from GEFF, put Z to 0 in 2D for all spot types.
tinevez Jul 24, 2026
de627df
Use the same GEFF test in a test deserializing SpotRois.
tinevez Jul 24, 2026
db0eae5
Use the SpotRoi test case in the demo.
tinevez Jul 24, 2026
2867f6a
Also deserialize the RADIUS prop for all spot types.
tinevez Jul 24, 2026
87a752a
Make a specific test comparison for SpotRoi
tinevez Jul 24, 2026
8b7374d
Rename the GEFF demo
tinevez Jul 24, 2026
108fabf
Test GEFF de/serialization with mixed spot types.
tinevez Jul 24, 2026
2d74a5b
Demo the mixed model.
tinevez Jul 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/fiji/plugin/trackmate/FeatureModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand Down Expand Up @@ -61,12 +61,12 @@ public class FeatureModel
* track to its feature map. The feature map maps each feature to the double
* value for the specified feature.
*/
Map< Integer, Map< String, Double > > trackFeatureValues = new ConcurrentHashMap<>();
transient Map< Integer, Map< String, Double > > trackFeatureValues = new ConcurrentHashMap<>();

/**
* Feature storage for edges.
*/
private final ConcurrentHashMap< DefaultWeightedEdge, ConcurrentHashMap< String, Double > > edgeFeatureValues = new ConcurrentHashMap<>();
private final transient ConcurrentHashMap< DefaultWeightedEdge, ConcurrentHashMap< String, Double > > edgeFeatureValues = new ConcurrentHashMap<>();

private final Collection< String > edgeFeatures = new LinkedHashSet<>();

Expand All @@ -88,7 +88,7 @@ public class FeatureModel

private final Map< String, Boolean > spotFeatureIsInt = new HashMap<>();

private final Model model;
private transient final Model model;

/*
* CONSTRUCTOR
Expand Down Expand Up @@ -165,7 +165,7 @@ public Double getEdgeFeature( final DefaultWeightedEdge edge, final String featu

/**
* Remove the value of the designated feature for the specified edge.
*
*
* @param edge
* the edge
* @param feature
Expand Down Expand Up @@ -284,7 +284,7 @@ public Map< String, Boolean > getEdgeFeatureIsInt()

/**
* Returns the track features that are dealt with in this model.
*
*
* @return the collection of track features managed in this model.
*/
public Collection< String > getTrackFeatures()
Expand Down Expand Up @@ -341,7 +341,7 @@ public void declareTrackFeatures( final Collection< String > features, final Map
/**
* Returns the name mapping of the track features that are dealt with in
* this model.
*
*
* @return the feature name.
*/
public Map< String, String > getTrackFeatureNames()
Expand All @@ -363,7 +363,7 @@ public Map< String, String > getTrackFeatureShortNames()
/**
* Returns the dimension mapping of the track features that are dealt with
* in this model.
*
*
* @return the feature dimension.
*/
public Map< String, Dimension > getTrackFeatureDimensions()
Expand Down Expand Up @@ -410,7 +410,7 @@ public synchronized void putTrackFeature( final Integer trackID, final String fe
/**
* Remove the value of the designated feature for the track with the
* specified ID.
*
*
* @param trackID
* the track ID
* @param feature
Expand Down Expand Up @@ -604,7 +604,7 @@ public String toString()

/**
* Echoes the full content of this {@link FeatureModel}.
*
*
* @return a String representation of the full content of this model.
*/
public String echo()
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fiji/plugin/trackmate/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand Down Expand Up @@ -93,7 +93,7 @@ public void write( final char[] cbuf, final int off, final int len ) throws IOEx
? new Color( 0.4f, 0.4f, 0.9f )
: new Color( 0, 0, 0.7f );
GREEN_COLOR = bgIsDark
? new Color( 0.4f, 0.9f, 0.4f )
? new Color( 0.2f, 0.6f, 0.2f )
: new Color( 0, 0.6f, 0 );
ERROR_COLOR = bgIsDark
? new Color( 0.8f, 0, 0 ).brighter()
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/fiji/plugin/trackmate/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand Down Expand Up @@ -56,7 +56,7 @@ public class Settings
* {@link fiji.plugin.trackmate.visualization.TrackMateModelView} as a GUI
* target.
*/
public final ImagePlus imp;
public final transient ImagePlus imp;

public double dt;

Expand Down Expand Up @@ -113,16 +113,16 @@ public class Settings
*/
public SpotDetectorFactoryBase< ? > detectorFactory;

/** The the tracker to use. */
public SpotTrackerFactory trackerFactory;

/**
* Settings map for {@link fiji.plugin.trackmate.detection.SpotDetector}.
*
* @see fiji.plugin.trackmate.detection.DetectorKeys
*/
public Map< String, Object > detectorSettings = new HashMap<>();

/** The the tracker to use. */
public SpotTrackerFactory trackerFactory;

/**
* Settings map for {@link fiji.plugin.trackmate.tracking.SpotTracker}.
*
Expand All @@ -132,21 +132,21 @@ public class Settings

// Filters

/**
* The feature filter list.
*/
protected List< FeatureFilter > spotFilters = new ArrayList<>();

/**
* The initial quality filter value that is used to clip spots of low
* quality from spots.
*/
public Double initialSpotFilterValue = Double.valueOf( 0 );

/**
* The feature filter list.
*/
protected List< FeatureFilter > spotFilters = new ArrayList<>();

/** The track filter list that is used to prune track and spots. */
protected List< FeatureFilter > trackFilters = new ArrayList<>();

protected String errorMessage;
protected transient String errorMessage;

// Spot features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ public static final FeatureColorGenerator< Integer > createWholeTrackColorGenera
}

public static final double[] autoMinMax( final Model model, final TrackMateObject type, final String feature )
{
return autoMinMax( model, type, feature, true );
}

public static final double[] autoMinMax( final Model model, final TrackMateObject type, final String feature, final boolean visibileOnly )
{
switch ( type )
{
Expand All @@ -429,7 +434,7 @@ public static final double[] autoMinMax( final Model model, final TrackMateObjec
case SPOTS:
case TRACKS:
{
final double[] values = collectFeatureValues( feature, type, model, true );
final double[] values = collectFeatureValues( feature, type, model, visibileOnly );
double min = Double.POSITIVE_INFINITY;
double max = Double.NEGATIVE_INFINITY;
for ( final double val : values )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static fiji.plugin.trackmate.gui.Fonts.FONT;
import static fiji.plugin.trackmate.gui.Fonts.TEXTFIELD_DIMENSION;
import static fiji.plugin.trackmate.tracking.TrackerKeys.DEFAULT_ALTERNATIVE_LINKING_COST_FACTOR;
import static fiji.plugin.trackmate.tracking.TrackerKeys.DEFAULT_BLOCKING_VALUE;
import static fiji.plugin.trackmate.tracking.TrackerKeys.DEFAULT_CUTOFF_PERCENTILE;
import static fiji.plugin.trackmate.tracking.TrackerKeys.DEFAULT_GAP_CLOSING_FEATURE_PENALTIES;
import static fiji.plugin.trackmate.tracking.TrackerKeys.DEFAULT_LINKING_FEATURE_PENALTIES;
Expand All @@ -37,7 +36,6 @@
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_ALLOW_TRACK_MERGING;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_ALLOW_TRACK_SPLITTING;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_ALTERNATIVE_LINKING_COST_FACTOR;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_BLOCKING_VALUE;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_CUTOFF_PERCENTILE;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_GAP_CLOSING_FEATURE_PENALTIES;
import static fiji.plugin.trackmate.tracking.TrackerKeys.KEY_GAP_CLOSING_MAX_DISTANCE;
Expand Down Expand Up @@ -190,7 +188,6 @@ public Map< String, Object > getSettings()
settings.put( KEY_MERGING_MAX_DISTANCE, DEFAULT_MERGING_MAX_DISTANCE );
settings.put( KEY_MERGING_FEATURE_PENALTIES, DEFAULT_MERGING_FEATURE_PENALTIES );
// Others
settings.put( KEY_BLOCKING_VALUE, DEFAULT_BLOCKING_VALUE );
settings.put( KEY_ALTERNATIVE_LINKING_COST_FACTOR, DEFAULT_ALTERNATIVE_LINKING_COST_FACTOR );
settings.put( KEY_CUTOFF_PERCENTILE, DEFAULT_CUTOFF_PERCENTILE );
// Panel ones
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand All @@ -31,6 +31,7 @@
import java.lang.reflect.Type;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import java.util.stream.Collectors;

import org.jdom2.Element;
Expand Down Expand Up @@ -63,18 +64,34 @@ public static String toJson( final DisplaySettings ds )
return getGson().toJson( ds );
}

public static DisplaySettings fromJson( final String str )
public static JsonElement toJsonTree( final DisplaySettings ds )
{
final DisplaySettings ds = ( str == null || str.isEmpty() ) ? readUserDefault() : getGson().fromJson( str, DisplaySettings.class );
return getGson().toJsonTree( ds );
}

private static void sanitize( final DisplaySettings ds )
{
// Sanitize min and max.
final double spotMin = ds.getSpotMin();
final double spotMax = ds.getSpotMax();
ds.setSpotMinMax( Math.min( spotMin, spotMax ), Math.max( spotMin, spotMax ) );
final double trackMin = ds.getTrackMin();
final double trackMax = ds.getTrackMax();
ds.setTrackMinMax( Math.min( trackMin, trackMax ), Math.max( trackMin, trackMax ) );
}

public static DisplaySettings fromJson( final String str )
{
final DisplaySettings ds = ( str == null || str.isEmpty() ) ? readUserDefault() : getGson().fromJson( str, DisplaySettings.class );
sanitize( ds );
return ds;
}

public static DisplaySettings fromJsonTree( final Map< String, Object > displaySettingsJson )
{
final Gson gson = getGson();
final DisplaySettings ds = gson.fromJson( gson.toJsonTree( displaySettingsJson ), DisplaySettings.class );
sanitize( ds );
return ds;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand Down Expand Up @@ -63,12 +63,25 @@ public class StartDialogDescriptor extends WizardPanelDescriptor

private static final String KEY = "Start";


public static final String PUB0_URL = "https://doi.org/10.1016/j.ymeth.2016.09.016";

public static final String PUB0_TXT = "Tinevez JY, Perry N. Schindelin J, et al. "
+ "'TrackMate: An open and extensible platform for single-particle tracking', "
+ "Methods (2017).";

public static final String PUB1_URL = "https://doi.org/10.1038/s41592-022-01507-1";

public static final String PUB1_TXT = "Ershov, D., Phan, MS., Pylvänäinen, J.W., Rigaud S.U., et al. "
+ "TrackMate 7: integrating state-of-the-art segmentation algorithms into tracking pipelines. "
+ "Nat Methods (2022). https://doi.org/10.1038/s41592-022-01507-1";

public static final String PUB1_TXT = "Ershov D, Phan MS, Pylvänäinen JW, Rigaud SU, et al. "
+ "'TrackMate 7: integrating state-of-the-art segmentation algorithms into tracking pipelines' "
+ "Nature Methods (2022).";

public static final String PUB2_URL = "https://doi.org/10.1002/cpz1.70369";

public static final String PUB2_TXT = "Anselmet M, et al. "
+ "'Automated optimization of bacterial tracking pipelines with trackmate 8' "
+ "Current Protocols (2026).";

private final Settings settings;

private final Logger logger;
Expand All @@ -89,12 +102,14 @@ public void aboutToDisplayPanel()
logger.log( welcomeMessage, Logger.BLUE_COLOR );
logger.log( "Please note that TrackMate is available through Fiji, and is based on a publication. "
+ "If you use it successfully for your research please be so kind to cite our work:\n" );
logger.log( PUB2_TXT + "\n", Logger.GREEN_COLOR );
logger.log( PUB2_URL + "\n", Logger.BLUE_COLOR );
logger.log( "and / or:\n" );
logger.log( PUB1_TXT + "\n", Logger.GREEN_COLOR );
logger.log( PUB1_URL + "\n", Logger.BLUE_COLOR );
logger.log( "and / or:\n" );
logger.log( "Tinevez, JY.; Perry, N. & Schindelin, J. et al. (2017), 'TrackMate: An open and extensible platform for single-particle tracking.', "
+ "Methods 115: 80-90, PMID 27713081.\n", Logger.GREEN_COLOR );
logger.log( "https://www.sciencedirect.com/science/article/pii/S1046202316303346\n", Logger.BLUE_COLOR );
logger.log( PUB0_TXT + "\n", Logger.GREEN_COLOR );
logger.log( PUB0_URL + "\n", Logger.BLUE_COLOR );

logger.log( "\nNumerical feature analyzers:\n", Logger.BLUE_COLOR );
logger.log( settings.toStringFeatureAnalyzersInfo() );
Expand Down
Loading