From 7891a3a9c434e5186473a701ffaf5b4ecbb4c654 Mon Sep 17 00:00:00 2001 From: Stefan Hahmann Date: Mon, 9 Oct 2023 15:45:24 +0200 Subject: [PATCH] Rename bg to background --- .../ImportSpotsFromLabelImageController.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/mastodon/mamut/segmentation/ImportSpotsFromLabelImageController.java b/src/main/java/org/mastodon/mamut/segmentation/ImportSpotsFromLabelImageController.java index 08e3e5d30..ba5a58315 100644 --- a/src/main/java/org/mastodon/mamut/segmentation/ImportSpotsFromLabelImageController.java +++ b/src/main/java/org/mastodon/mamut/segmentation/ImportSpotsFromLabelImageController.java @@ -103,7 +103,6 @@ private void createSpotsFromLabelImage( RandomAccessibleInterval< IntegerType< ? new BigInteger[ numLabels ][ 3 ][ 3 ]; // sums up the estimates of mixed coordinates (like xy). Used for covariances. readImageSumPositions( img, count, sum, mixedSum, minAndMax.getA() ); - createSpotsFromSums( frameId, numLabels, count, sum, mixedSum ); } @@ -121,7 +120,7 @@ private static Pair< Integer, Integer > getPixelValueInterval( RandomAccessibleI Cursor< IntegerType< ? > > cursor = Views.iterable( img ).cursor(); while ( cursor.hasNext() ) { - int val = cursor.next().getInteger(); // we ignore 0 as it is BG + int val = cursor.next().getInteger(); // we ignore 0 as it is background if ( min > val ) min = val; if ( max < val ) @@ -176,12 +175,11 @@ private void createSpotsFromSums( int frame, int numLabels, int[] count, long[][ * @param count an empty array to store the 0D sums (counts). Dimensions: [labelIdx]. * @param sum an empty array to store the 1D sums, i.e S[X]. Dimensions: [labelIdx, coord] * @param mixedSum an empty array to store the 2D sums, i.e S[XY]. Dimensions: [labelIdx, coord, coord] - * @param bg the pixel value of the background. Since unsigned is annoying in Fiji, this subtracts the bg value from the label. + * @param background the pixel value of the background. Since unsigned is annoying in Fiji, this subtracts the bg value from the label. * @author Noam Dori */ private static void readImageSumPositions( - RandomAccessibleInterval< IntegerType< ? > > img, int[] count, - long[][] sum, BigInteger[][][] mixedSum, int bg + RandomAccessibleInterval< IntegerType< ? > > img, int[] count, long[][] sum, BigInteger[][][] mixedSum, int background ) { // read all pixels of the picture to sum everything up @@ -189,7 +187,7 @@ private static void readImageSumPositions( Cursor< IntegerType< ? > > cursor = Views.iterable( img ).cursor(); while ( cursor.hasNext() ) { - int labelIdx = cursor.next().getInteger() - bg - 1; // we ignore 0 as it is BG + int labelIdx = cursor.next().getInteger() - background - 1; // we ignore 0 as it is BG if ( labelIdx < 0 ) continue; cursor.localize( pixel );