Skip to content

Commit

Permalink
Add the smoothing scale param to the 2D labeling methods as well.
Browse files Browse the repository at this point in the history
Not implemented yet, but at least symmetric with the 2D case.
  • Loading branch information
tinevez committed Jul 23, 2024
1 parent cb3fc83 commit 12dcb90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/fiji/plugin/trackmate/detection/SpotRoiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ public static < R extends IntegerType< R >, S extends RealType< S > > List< Spot
final double smoothingScale,
final RandomAccessibleInterval< S > qualityImage )
{
final Map< Integer, List< Spot > > map = from2DLabelingWithROIMap( labeling, origin, calibration, simplify, qualityImage );
final Map< Integer, List< Spot > > map = from2DLabelingWithROIMap(
labeling,
origin,
calibration,
simplify,
smoothingScale,
qualityImage );
final List< Spot > spots = new ArrayList<>();
for ( final List< Spot > s : map.values() )
spots.addAll( s );
Expand All @@ -144,7 +150,7 @@ public static < R extends IntegerType< R >, S extends RealType< S > > List< Spot
* @param <S>
* the type of the quality image. Must be real, scalar.
* @param labeling
* the labeling, must be zero-min and 2D..
* the labeling, must be zero-min and 2D.
* @param origin
* the origin (min pos) of the interval the labeling was
* generated from, used to reposition the spots from the zero-min
Expand All @@ -154,6 +160,11 @@ public static < R extends IntegerType< R >, S extends RealType< S > > List< Spot
* @param simplify
* if <code>true</code> the polygon will be post-processed to be
* smoother and contain less points.
* @param smoothingScale
* if strictly larger than 0, the mask will be smoothed before
* creating the mesh, resulting in smoother meshes. The scale
* value sets the (Gaussian) filter radius and is specified in
* physical units. If 0 or lower than 0, no smoothing is applied.
* @param qualityImage
* the image in which to read the quality value.
* @return a map linking the label integer value to the list of spots, with
Expand All @@ -164,6 +175,7 @@ public static < R extends IntegerType< R >, S extends RealType< S > > Map< Integ
final double[] origin,
final double[] calibration,
final boolean simplify,
final double smoothingScale,
final RandomAccessibleInterval< S > qualityImage )
{
if ( labeling.numDimensions() != 2 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private Map< Integer, List< Spot > > getSpots( final RandomAccessibleInterval< T
new double[] { 0., 0. },
calibration,
simplify,
smoothingScale,
rai );
}

Expand Down

0 comments on commit 12dcb90

Please sign in to comment.