Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PR that tracks the work towards TrackMate v8 #309

Draft
wants to merge 68 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dc27c90
Add LbKit as a dependency.
tinevez Sep 1, 2023
4bbf665
A LabKit launcher made to edit spots in the current frame.
tinevez Sep 1, 2023
43f8687
Add a button to launch LabKit in the configure views panel of the wiz…
tinevez Sep 1, 2023
c1e6c09
Do not use a yet non-existing method in MaskUtils.
tinevez Jul 7, 2024
bb139c2
Wrap the button line of the configure views panel.
tinevez Sep 2, 2023
2815d63
Rework and improve the import method of the spot editor.
tinevez Sep 2, 2023
0fd4193
Utility to know whether a class is present at runtime.
tinevez Sep 2, 2023
a73f832
Make the editor button visible only if LabKit is available.
tinevez Sep 2, 2023
d7b25d6
After editing in LbKit, message the user
tinevez Sep 3, 2023
6c23066
Copy the channel color, min & max, etc to the editor BDV window.
tinevez Sep 3, 2023
cf486c4
Directly store the index image as previous labels.
tinevez Sep 3, 2023
73d096a
Modifed and new spots get a QUALITY value of -1.
tinevez Sep 4, 2023
9de374b
Fix editing spots in 3D.
tinevez Sep 12, 2023
3f7dc78
ImpBdvShowable wraps around the ImgPlusBdvShowable.
tinevez Sep 17, 2023
e263f83
The Labkit editor can be launched on all time-points at once.
tinevez Sep 17, 2023
3757a83
Add tooltip for the editor button.
tinevez Sep 17, 2023
f9c0b73
In Labkit editor, labels receive name and color from spots.
tinevez Sep 17, 2023
ee3b86a
Better editor frame title.
tinevez Sep 17, 2023
8aaf763
Properly handle 2D and 3D with or without time in the editor.
tinevez Sep 19, 2023
544b3df
Always start the editor in FUSED mode,
tinevez Sep 19, 2023
48594c2
Don't crash when editing on images with 1 channel.
tinevez Sep 22, 2023
a788cf1
If we crash when launching the editor, unfreeze TrackMate.
tinevez Sep 22, 2023
b503a63
Store labels on ints, not on shorts.
tinevez Sep 22, 2023
4d3a326
Fix reimporting labels with large IDs in 2D.
tinevez Jul 7, 2024
39e16fc
Fix javadoc errors.
tinevez Oct 8, 2023
2d9edce
Make the spot editor work with 1-timepoint images.
tinevez Feb 8, 2024
e4eb1bc
Fix import of spots in LabKit for 2D single time-point images.
tinevez Mar 11, 2024
8c9961b
Protect against weird error caused by empty labels.
tinevez Mar 11, 2024
e65687c
setFont() utility.
tinevez Nov 28, 2023
1d95bea
The detection preview is cancelable.
tinevez Mar 28, 2024
0bd86ec
Fix preview panel size in free-size layouts.
tinevez May 21, 2024
d6fdfb5
Detection preview panel tweak.
tinevez Jul 9, 2024
3b93eed
Merge remote-tracking branch 'origin/master' into labkit-main
tinevez Jul 10, 2024
de5de59
Fixed a difficult bug with the LabKit editor reimporter.
tinevez Jul 10, 2024
2c56943
Another fix for the LabKit reimporter bug.
tinevez Jul 10, 2024
fc19713
Label image to spots: also returns the label corresponding to created…
tinevez Jul 10, 2024
f886b65
Do not execute the LabKit reimporter in the AWT thread.
tinevez Jul 10, 2024
d1ca968
Simplify the LabKit importer.
tinevez Jul 11, 2024
aa9dc52
In LabKit editor, offer to simplify the contour of modified spots.
tinevez Jul 11, 2024
73c85db
Let the user edit a ROI in the image with the LabKit editor.
tinevez Jul 12, 2024
186520e
Fix panning not working when the TrackMate tool is selected.
tinevez Jul 17, 2024
28666c3
In LabKit editor, import spots at the border of the image.
tinevez Jul 18, 2024
faa87b9
Fix bug in LabKit editor: avoid spot ID and label conflicts.
tinevez Jul 18, 2024
8ccd3ee
Custom LabKit frame and segmentation component.
tinevez Jul 19, 2024
2f9583e
Fix another bug with the LabKit importer.
tinevez Jul 19, 2024
9d3c58e
Fixed one more bug with the labkit importer.
tinevez Jul 22, 2024
5e9643d
Don't crash when displaying an empty model.
tinevez Sep 30, 2024
cff5746
Compatibility with command lines args that ends in '='
tinevez Oct 1, 2024
a030b71
A new CLI configurator for executables that live in a conda env.
tinevez Oct 1, 2024
6cd0cc3
Smooth icon when resizing.
tinevez Oct 2, 2024
a33a1c3
In the CLI configurator, when a key is null, let it be null.
tinevez Oct 2, 2024
a23c307
Don't set quality value for preview to - infinity.
tinevez Oct 4, 2024
b3f4d87
In the CLI GUI builder, avoid long paths deforming new panels.
tinevez Oct 4, 2024
4802efa
Update parent to pom-scijava 39.0.0
tinevez Nov 6, 2024
6eb47f6
Fix compile error with new version of imglib2.
tinevez Nov 6, 2024
349460f
Fix compile errors linked to new LabelRegion code.
tinevez Nov 6, 2024
319ef44
Fix some deprecation warnings with new imglib2.
tinevez Nov 6, 2024
37cc27c
Utility method to copy a directed graph to an undirected one.
tinevez Nov 6, 2024
a0e1398
Refactor the nearest neighbor tracker.
tinevez Nov 6, 2024
42acf1c
Rework the NN tracker UI and description.
tinevez Nov 6, 2024
58f8696
Fix labkit launcher with ROIs that touch the border.
tinevez Nov 6, 2024
905ef55
Merge remote-tracking branch 'origin/master' into v8-new
tinevez Nov 7, 2024
be5c222
Fix javadoc errors.
tinevez Nov 7, 2024
9507e6d
Add javadoc.
tinevez Nov 7, 2024
89d3b7a
Make sure we don't save a log with invalid XML chars.
tinevez Nov 8, 2024
11147cd
Sets the units of a model from the settings when creating an empty Tr…
tinevez Dec 12, 2024
fdf59bc
Implement equals() for FeatureFilter.
tinevez Dec 12, 2024
10b6cd1
Make setting and determining the conda env list more robust.
tinevez Jan 22, 2025
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
18 changes: 7 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>sc.fiji</groupId>
<artifactId>TrackMate</artifactId>
<version>7.14.1-SNAPSHOT</version>
<version>8.0.0-SNAPSHOT</version>

<name>TrackMate</name>
<description>TrackMate plugin for Fiji.</description>
Expand Down Expand Up @@ -147,14 +147,6 @@

<fontchooser.version>2.5.2</fontchooser.version>
<javaGeom.version>0.11.1</javaGeom.version>

<imglib2.version>7.1.0</imglib2.version>
<imglib2-realtransform.version>4.0.3</imglib2-realtransform.version>
<imglib2-roi.version>0.15.0</imglib2-roi.version>
<imglib2-cache.version>1.0.0-beta-18</imglib2-cache.version>
<imglib2-algorithm.version>0.15.3</imglib2-algorithm.version>
<imglib2-ij.version>2.0.2</imglib2-ij.version>
<bigdataviewer-core.version>10.6.0</bigdataviewer-core.version>
</properties>

<dependencies>
Expand All @@ -163,6 +155,10 @@
<groupId>sc.fiji</groupId>
<artifactId>fiji-lib</artifactId>
</dependency>
<dependency>
<groupId>sc.fiji</groupId>
<artifactId>labkit-ui</artifactId>
</dependency>

<!-- ImageJ dependencies -->
<dependency>
Expand Down Expand Up @@ -215,10 +211,10 @@
<groupId>com.github.vlsi.mxgraph</groupId>
<artifactId>jgraphx</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependency> -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/fiji/plugin/trackmate/LoadTrackMatePlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static fiji.plugin.trackmate.gui.Icons.TRACKMATE_ICON;

import java.awt.Color;
import java.awt.Dimension;
import java.io.File;

import javax.swing.JFrame;
Expand Down Expand Up @@ -65,8 +66,6 @@ public class LoadTrackMatePlugIn extends TrackMatePlugIn
@Override
public void run( final String filePath )
{
// GuiUtils.setSystemLookAndFeel();

final Logger logger = Logger.IJ_LOGGER;
File file;
if ( null == filePath || filePath.length() == 0 )
Expand Down Expand Up @@ -215,6 +214,8 @@ public void run( final String filePath )
frame.setIconImage( TRACKMATE_ICON.getImage() );
GuiUtils.positionWindow( frame, settings.imp.getWindow() );
frame.setVisible( true );
final Dimension size = frame.getSize();
frame.setSize( size.width, size.height + 1 );

// Text
final LogPanelDescriptor2 logDescriptor = ( LogPanelDescriptor2 ) sequence.logDescriptor();
Expand All @@ -230,7 +231,7 @@ public void run( final String filePath )
final String warning = reader.getErrorMessage();
if ( !warning.isEmpty() )
{
logger2.log( "Warnings occured during reading the file:\n"
logger2.log( "Warnings occurred during reading the file:\n"
+ "--------------------\n"
+ warning
+ "--------------------\n",
Expand Down Expand Up @@ -292,11 +293,12 @@ protected TmXmlReader createReader( final File lFile )

public static void main( final String[] args )
{
GuiUtils.setSystemLookAndFeel();
ImageJ.main( args );
final LoadTrackMatePlugIn plugIn = new LoadTrackMatePlugIn();
plugIn.run( null );
// plugIn.run( null );
// plugIn.run( "samples/FakeTracks.xml" );
// plugIn.run( "samples/MAX_Merged.xml" );
plugIn.run( "samples/MAX_Merged.xml" );
// plugIn.run( "c:/Users/tinevez/Development/TrackMateWS/TrackMate-Cellpose/samples/R2_multiC.xml" );
// plugIn.run( "/Users/tinevez/Desktop/230901_DeltaRcsB-ZipA-mCh_timestep5min_Stage9_reg/230901_DeltaRcsB-ZipA-mCh_timestep5min_Stage9_reg_merge65.xml" );
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/fiji/plugin/trackmate/TrackMate.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ public class TrackMate implements Benchmark, MultiThreaded, Algorithm, Named, Ca
public TrackMate( final Settings settings )
{
this( new Model(), settings );
if ( settings.imp != null && settings.imp.getCalibration() != null )
{
final String spaceUnits = settings.imp.getCalibration().getXUnit();
final String timeUnits = settings.imp.getCalibration().getTimeUnit();
model.setPhysicalUnits( spaceUnits, timeUnits );
}
}

public TrackMate( final Model model, final Settings settings )
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/fiji/plugin/trackmate/detection/DetectionUtils.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 All @@ -39,8 +39,8 @@
import fiji.plugin.trackmate.SpotCollection;
import fiji.plugin.trackmate.TrackMate;
import fiji.plugin.trackmate.detection.util.MedianFilter2D;
import fiji.plugin.trackmate.util.Threads;
import fiji.plugin.trackmate.util.TMUtils;
import fiji.plugin.trackmate.util.Threads;
import ij.ImagePlus;
import net.imagej.ImgPlus;
import net.imagej.axis.Axes;
Expand Down Expand Up @@ -69,7 +69,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.type.numeric.real.FloatType;
import net.imglib2.util.Intervals;
import net.imglib2.util.Util;
import net.imglib2.view.IntervalView;
import net.imglib2.view.Views;

Expand All @@ -82,7 +81,7 @@ public class DetectionUtils
* This method returns immediately and execute the detection in a separate
* thread. It executes the detection in one frame only and writes the
* results in the specified model object.
*
*
* @param model
* the model to write detection results in.
* @param settings
Expand Down Expand Up @@ -167,7 +166,7 @@ public static final void preview(
* Returns <code>true</code> if the specified image is 2D. It can have
* multiple channels and multiple time-points; this method only looks at
* whether several Z-slices can be found.
*
*
* @param img
* the image.
* @return <code>true</code> if the image is 2D, regardless of time and
Expand All @@ -189,7 +188,7 @@ public static final boolean is2D( final ImagePlus imp )
* radius specified <b>using calibrated units</b>. The specified calibration
* is used to determine the dimensionality of the kernel and to map it on a
* pixel grid.
*
*
* @param radius
* the blob radius (in image unit).
* @param nDims
Expand Down Expand Up @@ -277,7 +276,7 @@ public static final < T extends RealType< T > > Img< FloatType > copyToFloatImg(
final RandomAccess< T > in = Views.zeroMin( Views.interval( img, interval ) ).randomAccess();
final Cursor< FloatType > out = output.cursor();
final RealFloatConverter< T > c = new RealFloatConverter<>();

while ( out.hasNext() )
{
out.fwd();
Expand Down Expand Up @@ -344,7 +343,7 @@ public static final < T extends RealType< T > > List< Spot > findLocalMaxima(
* Find maxima.
*/

final T val = Util.getTypeFromInterval( source ).createVariable();
final T val = source.getType().createVariable();
val.setReal( threshold );
final LocalNeighborhoodCheck< Point, T > localNeighborhoodCheck = new LocalExtrema.MaximumCheck<>( val );
final IntervalView< T > dogWithBorder = Views.interval( Views.extendMirrorSingle( source ), Intervals.expand( source, 1 ) );
Expand Down Expand Up @@ -492,7 +491,7 @@ else if ( source.numDimensions() > 1 )
/**
* Return a view of the specified input image, at the specified channel
* (0-based) and the specified frame (0-based too).
*
*
* @param <T>
* the type of the input image.
* @param img
Expand Down Expand Up @@ -524,7 +523,7 @@ public static final < T extends Type< T > > RandomAccessibleInterval< T > prepar

/**
* Normalize the pixel value of an image between 0 and 1.
*
*
* @param <T>
* the type of pixels in the image. Must extend {@link RealType}.
* @param input
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/fiji/plugin/trackmate/detection/DogDetector.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 All @@ -23,7 +23,6 @@

import net.imglib2.Cursor;
import net.imglib2.Interval;
import net.imglib2.IterableInterval;
import net.imglib2.RandomAccessible;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.algorithm.dog.DifferenceOfGaussian;
Expand Down Expand Up @@ -117,10 +116,8 @@ public boolean process()
e.printStackTrace();
}

final IterableInterval< FloatType > dogIterable = Views.iterable( dog );
final IterableInterval< FloatType > tmpIterable = Views.iterable( dog2 );
final Cursor< FloatType > dogCursor = dogIterable.cursor();
final Cursor< FloatType > tmpCursor = tmpIterable.cursor();
final Cursor< FloatType > dogCursor = dog.cursor();
final Cursor< FloatType > tmpCursor = dog2.cursor();
while ( dogCursor.hasNext() )
dogCursor.next().sub( tmpCursor.next() );

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 @@ -101,9 +101,7 @@ public boolean process()
{
final long start = System.currentTimeMillis();
final RandomAccessibleInterval< T > rai = Views.interval( input, interval );
final T type = Util.getTypeFromInterval( rai );

if ( type instanceof IntegerType )
if ( rai.getType() instanceof IntegerType )
{
processIntegerImg( ( RandomAccessibleInterval ) Views.zeroMin( rai ) );
}
Expand All @@ -126,7 +124,7 @@ private < R extends IntegerType< R > > void processIntegerImg( final RandomAcces
{
// Get all labels.
final AtomicInteger max = new AtomicInteger( 0 );
Views.iterable( rai ).forEach( p -> {
rai.forEach( p -> {
final int val = p.getInteger();
if ( val != 0 && val > max.get() )
max.set( val );
Expand Down
Loading
Loading