public class Real1dBinMapper<T extends RealType<T>> extends Object implements BinMapper1d<T>
Integer1dBinMapper
.Constructor and Description |
---|
Real1dBinMapper(double minVal,
double maxVal,
long numBins,
boolean tailBins)
Specify a mapping of real data from a user defined range into a specified
number of bins.
|
Modifier and Type | Method and Description |
---|---|
Real1dBinMapper<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 RealType<K>> |
histogramNd(double[] minVals,
double[] maxVals,
long[] numBins,
boolean[] tailBins)
This is a convenience method for creating a
HistogramNd from
inputs that describe a set of real 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 Real1dBinMapper(double minVal, double maxVal, long numBins, boolean tailBins)
minVal
- The first data value of interest.maxVal
- The last 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 RealType<T>>
public long map(T value)
BinMapper1d
map
in interface BinMapper1d<T extends RealType<T>>
public void getCenterValue(long binPos, T value)
BinMapper1d
getCenterValue
in interface BinMapper1d<T extends RealType<T>>
value
- Output to contain center data valuepublic void getLowerBound(long binPos, T value)
BinMapper1d
getLowerBound
in interface BinMapper1d<T extends RealType<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 RealType<T>>
binPos
- Bin number of interestvalue
- Output to contain right edge data valuepublic boolean includesLowerBound(long binPos)
BinMapper1d
includesLowerBound
in interface BinMapper1d<T extends RealType<T>>
binPos
- Bin number of interestpublic boolean includesUpperBound(long binPos)
BinMapper1d
includesUpperBound
in interface BinMapper1d<T extends RealType<T>>
binPos
- Bin number of interestpublic boolean hasTails()
BinMapper1d
hasTails
in interface BinMapper1d<T extends RealType<T>>
public Real1dBinMapper<T> copy()
BinMapper1d
BinMapper1d<T>
.copy
in interface BinMapper1d<T extends RealType<T>>
public static <K extends RealType<K>> HistogramNd<K> histogramNd(double[] minVals, double[] maxVals, long[] numBins, boolean[] tailBins)
HistogramNd
from
inputs that describe a set of real 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 dimensionmaxVals
- The maximum 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.