|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDData
de.unihalle.informatik.MiToBo.core.datatypes.MTBImageHistogram
public class MTBImageHistogram
Class for generating intensity histograms of MTBImages
Field Summary | |
---|---|
private double[] |
data
Array holding the histogram data |
private double |
highBound
upper boundary of the last bin |
private int |
largestNonEmptyBin
largest intensity value contained in the input image |
private double |
lowBound
lower boundary of the first bin. |
private double |
numEntries
number of histogram entries |
private int |
size
number of bins |
private int |
smallestNonEmptyBin
smallest intensity value contained in the input image |
private double |
sum
sum of all histogram entries |
Constructor Summary | |
---|---|
MTBImageHistogram(double[] vals,
int bins,
double lowBoundary,
double highBoundary)
Construct new histogram from array of values. |
|
MTBImageHistogram(MTBImage img)
construct a new MTBHistogram object from the given MTBImage number of bins is 256 and the histogram ranges from the smallest image value to the largest image value |
|
MTBImageHistogram(MTBImage img,
int bins)
construct a new MTBHistogram object from the given MTBImage the histogram ranges from the smallest image value to the largest image value |
|
MTBImageHistogram(MTBImage img,
int bins,
double lowBoundary,
double highBoundary)
construct a histogram for the given input image with specification of binning and value range all MTBImage types except RGB type are supported |
|
MTBImageHistogram(MTBImage img,
MTBImage mask,
int bins,
double lowBoundary,
double highBoundary)
construct a histogram for the given input image only for the pixels specified by a binary mask all MTBImage types except RGB type are supported with specification of binning and value range |
Method Summary | |
---|---|
void |
add(MTBImageHistogram h)
add histogram data to this MTBHistogram object. |
void |
binning(int bins)
change the binning of the histogram |
void |
cumulate()
calculate the cumulative histogram |
void |
cumulateOnly()
calculate the cumulative histogram without changing the sum of absolute frequencies (normalizing factor), because cumulate() calls initialize() and thus destroys this normalizing factor |
int |
getBinIndex(double value)
determines the index of the histogram bin, to which a value is assigned, if histogram value range and binning were specified at creation |
double |
getBinMidpoint(int binIndex)
determines the value midpoint of a histogram bin for given bin index, if histogram value range and binning were specified at creation |
double |
getBinValue(int i)
|
double[] |
getData()
|
int |
getLargestNonEmptyBin()
|
double |
getMaxValue()
|
double |
getMaxValueBin()
|
double |
getMean()
|
double |
getNumEntries()
|
int |
getSize()
|
int |
getSmallestNonEmptyBin()
|
double |
getStdDev()
|
double |
getSum()
|
double |
getVariance()
|
private void |
initialize()
initialize histogram, i.e. determine smallest non empty bin, largest non empty bin, number of histogram entries and sum of the histogram |
void |
logarithmize()
calculate the logarithmic (base e) histogram; entries smaller than one become zero! |
double |
mapIndexToValue(int index)
|
void |
normalize()
normalize the histogram |
void |
normalizeOnly()
normalize the histogram without changing the sum of absolute frequencies (normalizing factor), because normalize() calls initialize() and thus destroys this normalizing factor. |
void |
save(java.lang.String fileName)
write the histogram data into a text file |
void |
setBinValue(int i,
double val)
set the bin value at i-th position |
java.lang.String |
toString()
|
void |
truncate(int l,
int r)
truncate the histogram to the specified interval |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData |
---|
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double[] data
private double highBound
private int largestNonEmptyBin
private double lowBound
private double numEntries
private int size
private int smallestNonEmptyBin
private double sum
Constructor Detail |
---|
public MTBImageHistogram(double[] vals, int bins, double lowBoundary, double highBoundary)
vals
- Valuesbins
- Number of bins.lowBoundary
- Lower boundary of first bin.highBoundary
- Upper boundary of last bin.public MTBImageHistogram(MTBImage img)
img
- MTBImagepublic MTBImageHistogram(MTBImage img, int bins)
img
- MTBImagebins
- number of binspublic MTBImageHistogram(MTBImage img, int bins, double lowBoundary, double highBoundary) throws java.lang.IllegalArgumentException
img
- input image for which the histogram is calculatedbins
- number of histogram binslowBoundary
- determines the lower boundary of the first binhighBoundary
- determines the upper boundary of the last bin
java.lang.IllegalArgumentException
- if an RGB image is given as inputpublic MTBImageHistogram(MTBImage img, MTBImage mask, int bins, double lowBoundary, double highBoundary) throws java.lang.IllegalArgumentException
img
- input image for which the histogram is calculatedmask
- binary mask specifying which pixels are considered for the creation of the histogrambins
- number of histogram binslowBoundary
- determines the lower boundary of the first binhighBoundary
- determines the upper boundary of the last bin
java.lang.IllegalArgumentException
- if an RGB image is given as inputMethod Detail |
---|
public void add(MTBImageHistogram h) throws java.lang.IllegalArgumentException
h
- MTBHistogram to add
java.lang.IllegalArgumentException
public void binning(int bins)
bins
- number of binspublic void cumulate()
public void cumulateOnly()
public int getBinIndex(double value)
value
- image value
public double getBinMidpoint(int binIndex)
binIndex
- bin index
public double getBinValue(int i)
i
- position
public double[] getData()
public int getLargestNonEmptyBin()
public double getMaxValue()
public double getMaxValueBin()
public double getMean()
public double getNumEntries()
public int getSize()
public int getSmallestNonEmptyBin()
public double getStdDev()
public double getSum()
public double getVariance()
private void initialize()
h
- initializing values in a double arraypublic void logarithmize()
public double mapIndexToValue(int index)
index
-
public void normalize()
public void normalizeOnly()
public void save(java.lang.String fileName)
fileName
- file name for histogram datapublic void setBinValue(int i, double val)
i
- positionval
- bin valuepublic java.lang.String toString()
toString
in class java.lang.Object
public void truncate(int l, int r)
l
- left borderr
- right border
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |