Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>34.0.0</version>
<version>37.0.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -86,7 +86,7 @@

<javaGeom.version>0.11.1</javaGeom.version>

<TrackMate.version>7.10.2</TrackMate.version>
<TrackMate.version>8.0.0-SNAPSHOT</TrackMate.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
package fiji.plugin.trackmate.weka;

import static fiji.plugin.trackmate.detection.DetectorKeys.KEY_TARGET_CHANNEL;
import static fiji.plugin.trackmate.detection.ThresholdDetectorFactory.KEY_SMOOTHING_SCALE;
import static fiji.plugin.trackmate.weka.WekaDetectorFactory.KEY_CLASSIFIER_FILEPATH;
import static fiji.plugin.trackmate.weka.WekaDetectorFactory.KEY_CLASS_INDEX;
import static fiji.plugin.trackmate.weka.WekaDetectorFactory.KEY_PROBA_THRESHOLD;
Expand Down Expand Up @@ -108,13 +109,16 @@ protected Pair< Model, Double > runPreviewDetection(
*/

final Map< String, Object > dsettings = new HashMap<>( detectorSettings );
@SuppressWarnings( "unchecked" )
final ImgPlus< T > img = TMUtils.rawWraps( settings.imp );
final int channel = ( Integer ) dsettings.get( KEY_TARGET_CHANNEL ) - 1;
final ImgPlus< T > input = TMUtils.hyperSlice( img, channel, frame );
final int classIndex = ( Integer ) dsettings.get( KEY_CLASS_INDEX );
final double probaThreshold = ( Double ) dsettings.get( KEY_PROBA_THRESHOLD );
final boolean simplify = true;
final Object smoothingObj = dsettings.get( KEY_SMOOTHING_SCALE );
final double smoothingScale = smoothingObj == null
? -1.
: ( ( Number ) smoothingObj ).doubleValue();

final boolean is3D = input.dimensionIndex( Axes.Z ) >= 0;
// First test to make sure we can read the classifier file.
Expand Down Expand Up @@ -180,7 +184,7 @@ protected Pair< Model, Double > runPreviewDetection(
}

logger.log( "Creating spots from probabilities." );
final List< Spot > spots = wekaRunner.getSpotsFromLastProbabilities( probaThreshold, simplify );
final List< Spot > spots = wekaRunner.getSpotsFromLastProbabilities( probaThreshold, simplify, smoothingScale );
if ( spots == null )
{
logger.error( "Problem creating spots: " + wekaRunner.getErrorMessage() );
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/fiji/plugin/trackmate/weka/WekaDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,24 @@ public class WekaDetector< T extends RealType< T > & NativeType< T > > implement

private final boolean simplify;

private final double smoothingScale;

public WekaDetector(
final WekaRunner< T > runner,
final ImgPlus< T > img,
final Interval interval,
final int classIndex,
final double probaThreshold,
final boolean simplify )
final boolean simplify,
final double smoothingScale )
{
this.runner = runner;
this.img = img;
this.interval = DetectionUtils.squeeze( interval );
this.classIndex = classIndex;
this.probaThreshold = probaThreshold;
this.simplify = simplify;
this.smoothingScale = smoothingScale;
this.baseErrorMessage = BASE_ERROR_MESSAGE;
}

Expand All @@ -99,7 +103,7 @@ public boolean process()
return false;
}

spots = runner.getSpots( probabilities, TMUtils.getSpatialCalibration( img ), probaThreshold, simplify );
spots = runner.getSpots( probabilities, TMUtils.getSpatialCalibration( img ), probaThreshold, simplify, smoothingScale );
if ( spots == null )
{
System.err.println( "Problem creating spots: " + runner.getErrorMessage() );
Expand Down
Loading
Loading