Skip to content

Commit

Permalink
fix a small bug, clean up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Mar 17, 2024
1 parent c7ae763 commit 35d4f35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public static ArrayList< InterestPoint > noLocalization( final ArrayList< Simple
if ( !DoGImgLib2.silent )
IOFunctions.println("(" + new Date(System.currentTimeMillis()) + "): NO subpixel localization" );

if ( peaks == null || peaks.size() == 0 )
return new ArrayList<>();

final int n = peaks.get( 0 ).location.length;
final ArrayList< InterestPoint > peaks2 = new ArrayList< InterestPoint >();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static < T extends RealType< T > > ArrayList< InterestPoint > computeDoG(
if ( cuda == null )
{
gauss1 = LazyGauss.init( inputFloat, interval, new FloatType(), sigma1, blockSize );
gauss2 = LazyGauss.init( inputFloat, interval , new FloatType(), sigma2, blockSize );
gauss2 = LazyGauss.init( inputFloat, interval, new FloatType(), sigma2, blockSize );
}
else
{
Expand All @@ -269,8 +269,8 @@ public void convert( final FloatType inputA, final FloatType inputB, final Float
}
}, new FloatType() );

//avoid double-caching for weighted gauss (i.e. mask != null)
//final RandomAccessibleInterval< FloatType > dogCached = (mask == null) ? FusionTools.cacheRandomAccessibleInterval( dog, new FloatType(), blockSize ) : dog;

// no caching since it is a simple subtraction operation, the underlying Gauss is expensive
final RandomAccessibleInterval< FloatType > dogCached = dog;

if ( !silent )
Expand All @@ -289,22 +289,14 @@ public void convert( final FloatType inputA, final FloatType inputB, final Float
}
else if ( localization == 1 )
{
// TODO: remove last Imglib1 crap
//final Img< FloatType > dogCopy = new ArrayImgFactory<>( new FloatType() ).create( dogCached );

//if ( !silent )
// IOFunctions.println("(" + new Date(System.currentTimeMillis()) + "): Mem-copying image." );

//FusionTools.copyImg( Views.zeroMin( dogCached ), dogCopy, service );
//final Image<mpicbg.imglib.type.numeric.real.FloatType> imglib1 = ImgLib2.wrapArrayFloatToImgLib1( dogCopy );

for ( final SimplePeak peak : peaks )
for ( int d = 0; d < peak.location.length; ++d )
peak.location[ d ] -= minInterval[ d ];

if ( !silent )
IOFunctions.println("(" + new Date(System.currentTimeMillis()) + "): Quadratic localization." );

// TODO: something requires a zeroMin dataset in here
finalPeaks = Localization.computeQuadraticLocalization( peaks, Views.extendMirrorDouble( Views.zeroMin( dogCached ) ), new FinalInterval( Views.zeroMin( dogCached ) ), findMin, findMax, minPeakValue, true, service );

// adjust detections for min coordinates of the RandomAccessibleInterval
Expand Down

0 comments on commit 35d4f35

Please sign in to comment.