Skip to content

Commit 797989f

Browse files
fixes for maxSpots
1 parent 5bbad3a commit 797989f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/net/preibisch/bigstitcher/spark/SparkInterestPointDetection.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public enum Localization { NONE, QUADRATIC };
141141
protected boolean prefetch = false;
142142

143143

144-
@Option(names = {"--maxSpots" }, required = true, description = "limit the number of spots per view (choose the brightest ones), e.g. --maxSpots 10000 (default: NO LIMIT)")
144+
@Option(names = {"--maxSpots" }, description = "limit the number of spots per view (choose the brightest ones), e.g. --maxSpots 10000 (default: NO LIMIT)")
145145
protected int maxSpots = -1;
146146

147147
@Option(names = "--blockSize", description = "blockSize for running the interest point detection - at the scale of detection (default: 512,512,128)")
@@ -592,7 +592,7 @@ public Void call() throws Exception
592592

593593
System.out.println( Group.pvid( viewId ) + ": " + myIpsNewId.size() );
594594

595-
if ( maxSpots > 0 )
595+
if ( maxSpots > 0 && maxSpots < myIpsNewId.size() )
596596
{
597597
// filter for the brightnest N spots
598598
final ArrayList< Pair< Double, InterestPoint > > combinedList = new ArrayList<>();
@@ -609,11 +609,11 @@ public Void call() throws Exception
609609
for ( int i = 0; i < maxSpots; ++i )
610610
{
611611
myIntensities.add( combinedList.get( i ).getA() );
612-
myIpsNewId.add( combinedList.get( i ).getB() );
612+
myIpsNewId.add( new InterestPoint( i, combinedList.get( i ).getB().getL() ) ); // new id's again ...
613613
}
614-
}
615614

616-
System.out.println( Group.pvid( viewId ) + " (after applying maxSpots): " + myIpsNewId.size() );
615+
System.out.println( Group.pvid( viewId ) + " (after applying maxSpots): " + myIpsNewId.size() );
616+
}
617617

618618
interestPoints.put(viewId, myIpsNewId);
619619

0 commit comments

Comments
 (0)