Skip to content

Commit

Permalink
Rename bg to background
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhahmann committed Oct 10, 2023
1 parent e094b17 commit 3925e57
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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 )
Expand Down Expand Up @@ -176,20 +176,19 @@ 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
int[] pixel = new int[ 3 ];
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 );
Expand Down

0 comments on commit 3925e57

Please sign in to comment.