|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.ReaderWrapper
loci.formats.MinMaxCalculator
public class MinMaxCalculator
Logic to compute minimum and maximum values for each channel.
Field Summary | |
---|---|
protected double[][] |
chanMax
Max values for each channel. |
protected double[][] |
chanMin
Min values for each channel. |
protected int[] |
minMaxDone
Number of planes for which min/max computations have been completed. |
protected double[][] |
planeMax
Max values for each plane. |
protected double[][] |
planeMin
Min values for each plane. |
Fields inherited from class loci.formats.ReaderWrapper |
---|
reader |
Fields inherited from interface loci.formats.IFormatReader |
---|
CAN_GROUP, CANNOT_GROUP, MUST_GROUP |
Constructor Summary | |
---|---|
MinMaxCalculator()
Constructs a MinMaxCalculator around a new image reader. |
|
MinMaxCalculator(IFormatReader r)
Constructs a MinMaxCalculator with the given reader. |
Method Summary | |
---|---|
void |
close()
Closes currently open file(s) and frees allocated memory. |
Double |
getChannelGlobalMaximum(int theC)
Retrieves a specified channel's global maximum. |
Double |
getChannelGlobalMinimum(int theC)
Retrieves a specified channel's global minimum. |
Double |
getChannelKnownMaximum(int theC)
Retrieves the specified channel's maximum based on the images that have been read. |
Double |
getChannelKnownMinimum(int theC)
Retrieves the specified channel's minimum based on the images that have been read. |
Double[] |
getPlaneMaximum(int no)
Retrieves the maximum pixel value for the specified plane. |
Double[] |
getPlaneMinimum(int no)
Retrieves the minimum pixel value for the specified plane. |
protected void |
initMinMax()
Ensures internal min/max variables are initialized properly. |
boolean |
isMinMaxPopulated()
Returns true if the values returned by getChannelGlobalMinimum/Maximum can be trusted. |
byte[] |
openBytes(int no)
Obtains the specified image from the current file as a byte array. |
byte[] |
openBytes(int no,
byte[] buf)
Obtains the specified image from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel). |
byte[] |
openBytes(String id,
int no)
Deprecated. Replaced by openBytes(int) |
byte[] |
openBytes(String id,
int no,
byte[] buf)
Deprecated. Replaced by openBytes(int, byte[]) |
BufferedImage |
openImage(int no)
Obtains the specified image from the current file. |
BufferedImage |
openImage(String id,
int no)
Deprecated. Replaced by openImage(int) |
protected void |
updateMinMax(BufferedImage b,
int ndx)
Updates min/max values based on the given BufferedImage. |
protected void |
updateMinMax(byte[] b,
int ndx)
Updates min/max values based on the given byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][] chanMin
protected double[][] chanMax
protected double[][] planeMin
protected double[][] planeMax
protected int[] minMaxDone
Constructor Detail |
---|
public MinMaxCalculator()
public MinMaxCalculator(IFormatReader r)
Method Detail |
---|
public Double getChannelGlobalMinimum(int theC) throws FormatException, IOException
FormatException
IOException
public Double getChannelGlobalMaximum(int theC) throws FormatException, IOException
FormatException
IOException
public Double getChannelKnownMinimum(int theC) throws FormatException, IOException
FormatException
IOException
public Double getChannelKnownMaximum(int theC) throws FormatException, IOException
FormatException
IOException
public Double[] getPlaneMinimum(int no) throws FormatException, IOException
ReaderWrapper.getRGBChannelCount(String)
), returns the maximum value for each
embedded channel. Returns null if the plane has not already been read.
FormatException
IOException
public Double[] getPlaneMaximum(int no) throws FormatException, IOException
ReaderWrapper.getRGBChannelCount(String)
), returns the maximum value for each
embedded channel. Returns null if the plane has not already been read.
FormatException
IOException
public boolean isMinMaxPopulated() throws FormatException, IOException
FormatException
IOException
public BufferedImage openImage(int no) throws FormatException, IOException
IFormatReader
openImage
in interface IFormatReader
openImage
in class ReaderWrapper
FormatException
IOException
public byte[] openBytes(int no) throws FormatException, IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
FormatException
IOException
public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
no
- the image index within the file.buf
- a pre-allocated buffer.
buf
for convenience.
FormatException
- if there was a problem parsing the metadata of the
file.
IOException
- if there was a problem reading the file.public void close() throws IOException
IFormatHandler
close
in interface IFormatHandler
close
in class ReaderWrapper
IOException
protected void updateMinMax(BufferedImage b, int ndx) throws FormatException, IOException
FormatException
IOException
protected void updateMinMax(byte[] b, int ndx) throws FormatException, IOException
FormatException
IOException
protected void initMinMax() throws FormatException, IOException
FormatException
IOException
public BufferedImage openImage(String id, int no) throws FormatException, IOException
openImage(int)
openImage
in interface IFormatReader
openImage
in class ReaderWrapper
FormatException
IOException
public byte[] openBytes(String id, int no) throws FormatException, IOException
openBytes(int)
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
FormatException
IOException
public byte[] openBytes(String id, int no, byte[] buf) throws FormatException, IOException
openBytes(int, byte[])
openBytes
in interface IFormatReader
openBytes
in class ReaderWrapper
FormatException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |