public class Integer1dBinMapper<T extends IntegerType<T>> extends Object implements BinMapper1d<T>
Constructor and Description |
---|
Integer1dBinMapper(long minVal,
long numBins,
boolean tailBins)
Specify a mapping of integral data from a user defined range into a
specified number of bins.
|
Modifier and Type | Method and Description |
---|---|
Integer1dBinMapper<T> |
copy()
Returns a copy of this
BinMapper1d<T> . |
long |
getBinCount()
Returns the number of bins within this bin mapping distribution.
|
void |
getCenterValue(long binPos,
T value)
Gets the data value associated with the center of a bin.
|
void |
getLowerBound(long binPos,
T value)
Gets the data value associated with the left edge of a bin.
|
void |
getUpperBound(long binPos,
T value)
Gets the data value associated with the right edge of a bin.
|
boolean |
hasTails()
Returns true if this bin mapping has bins on the ends of the distribution
that count out of bounds values.
|
static <K extends IntegerType<K>> |
histogramNd(long[] minVals,
long[] numBins,
boolean[] tailBins)
This is a convenience method for creating a
HistogramNd from
inputs that describe a set of integer 1-d based bin mappers. |
boolean |
includesLowerBound(long binPos)
Returns true if values matching the left edge data value for a given bin
are counted in the distribution.
|
boolean |
includesUpperBound(long binPos)
Returns true if values matching the right edge data value for a given bin
are counted in the distribution.
|
long |
map(T value)
Converts a data value to a long index within the bin distribution.
|
public Integer1dBinMapper(long minVal, long numBins, boolean tailBins)
minVal
- The first data value of interest.numBins
- The total number of bins to create.tailBins
- A boolean specifying whether to have a bin in each tail to
count values outside the user defined range.public long getBinCount()
BinMapper1d
getBinCount
in interface BinMapper1d<T extends IntegerType<T>>
public long map(T value)
BinMapper1d
map
in interface BinMapper1d<T extends IntegerType<T>>
public void getCenterValue(long binPos, T value)
BinMapper1d
getCenterValue
in interface BinMapper1d<T extends IntegerType<T>>
value
- Output to contain center data valuepublic void getLowerBound(long binPos, T value)
BinMapper1d
getLowerBound
in interface BinMapper1d<T extends IntegerType<T>>
binPos
- Bin number of interestvalue
- Output to contain left edge data valuepublic void getUpperBound(long binPos, T value)
BinMapper1d
getUpperBound
in interface BinMapper1d<T extends IntegerType<T>>
binPos
- Bin number of interestvalue
- Output to contain right edge data valuepublic boolean includesLowerBound(long binPos)
BinMapper1d
includesLowerBound
in interface BinMapper1d<T extends IntegerType<T>>
binPos
- Bin number of interestpublic boolean includesUpperBound(long binPos)
BinMapper1d
includesUpperBound
in interface BinMapper1d<T extends IntegerType<T>>
binPos
- Bin number of interestpublic boolean hasTails()
BinMapper1d
hasTails
in interface BinMapper1d<T extends IntegerType<T>>
public Integer1dBinMapper<T> copy()
BinMapper1d
BinMapper1d<T>
.copy
in interface BinMapper1d<T extends IntegerType<T>>
public static <K extends IntegerType<K>> HistogramNd<K> histogramNd(long[] minVals, long[] numBins, boolean[] tailBins)
HistogramNd
from
inputs that describe a set of integer 1-d based bin mappers. The inputs
should all have n entries for an n-d set of mappers.minVals
- The minimum bin values for each dimensionnumBins
- The total bin count for each dimensiontailBins
- Flags per dimension for whether to include tail binsCopyright © 2015–2022 ImgLib2. All rights reserved.