public class MinMaxCalculator extends ReaderWrapper
| Modifier and Type | Field and Description | 
|---|---|
| protected double[][] | chanMaxMax values for each channel. | 
| protected double[][] | chanMinMin values for each channel. | 
| protected int[] | minMaxDoneNumber of planes for which min/max computations have been completed. | 
| protected IMinMaxStore | minMaxStoreConsumer of channel global minima and maxima | 
| protected double[][] | planeMaxMax values for each plane. | 
| protected double[][] | planeMinMin values for each plane. | 
readerCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description | 
|---|
| MinMaxCalculator()Constructs a MinMaxCalculator around a new image reader. | 
| MinMaxCalculator(IFormatReader r)Constructs a MinMaxCalculator with the given reader. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close(boolean fileOnly)Closes the currently open file. | 
| java.lang.Double | getChannelGlobalMaximum(int theC)Retrieves a specified channel's global maximum. | 
| java.lang.Double | getChannelGlobalMinimum(int theC)Retrieves a specified channel's global minimum. | 
| java.lang.Double | getChannelKnownMaximum(int theC)Retrieves the specified channel's maximum based on the images that
 have been read. | 
| java.lang.Double | getChannelKnownMinimum(int theC)Retrieves the specified channel's minimum based on the images that have
 been read. | 
| IMinMaxStore | getMinMaxStore()Retrieves the current active min-max store for the calculator. | 
| java.lang.Class<?> | getNativeDataType()Returns the native data type of image planes for this reader, as returned
 by  IFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object). | 
| java.lang.Double[] | getPlaneMaximum(int no)Retrieves the maximum pixel value for the specified plane. | 
| java.lang.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. | 
| static MinMaxCalculator | makeMinMaxCalculator(IFormatReader r)Converts the given reader into a MinMaxCalculator, wrapping if needed. | 
| byte[] | openBytes(int no)Obtains the specified image plane from the current file as a byte array. | 
| byte[] | openBytes(int no,
         byte[] buf)Obtains the specified image plane from the current file into a
 pre-allocated byte array of
 (sizeX * sizeY * bytesPerPixel * RGB channel count). | 
| byte[] | openBytes(int no,
         byte[] buf,
         int x,
         int y,
         int w,
         int h)Obtains a sub-image of the specified image plane
 into a pre-allocated byte array. | 
| byte[] | openBytes(int no,
         int x,
         int y,
         int w,
         int h)Obtains a sub-image of the specified image plane,
 whose upper-left corner is given by (x, y). | 
| void | setMinMaxStore(IMinMaxStore store)Sets the active min-max store for the calculator. | 
| protected void | updateMinMax(int no,
            byte[] buf,
            int len)Updates min/max values based on the given byte array. | 
close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCoreMetadataList, getCurrentFile, getDatasetStructureDescription, getDimensionOrder, getDomains, getEffectiveSizeC, getFormat, getGlobalMetadata, getImageCount, getIndex, getIndex, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openPlane, openThumbBytes, reopenFile, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrapprotected double[][] chanMin
protected double[][] chanMax
protected double[][] planeMin
protected double[][] planeMax
protected int[] minMaxDone
protected IMinMaxStore minMaxStore
public MinMaxCalculator()
public MinMaxCalculator(IFormatReader r)
public static MinMaxCalculator makeMinMaxCalculator(IFormatReader r)
public void setMinMaxStore(IMinMaxStore store)
store - See above.public IMinMaxStore getMinMaxStore()
public java.lang.Double getChannelGlobalMinimum(int theC)
                                         throws FormatException,
                                                java.io.IOException
java.io.IOException - Not actually thrown.FormatExceptionpublic java.lang.Double getChannelGlobalMaximum(int theC)
                                         throws FormatException,
                                                java.io.IOException
java.io.IOException - Not actually thrown.FormatExceptionpublic java.lang.Double getChannelKnownMinimum(int theC)
                                        throws FormatException,
                                               java.io.IOException
FormatException - Not actually thrown.java.io.IOException - Not actually thrown.public java.lang.Double getChannelKnownMaximum(int theC)
                                        throws FormatException,
                                               java.io.IOException
FormatException - Not actually thrown.java.io.IOException - Not actually thrown.public java.lang.Double[] getPlaneMinimum(int no)
                                   throws FormatException,
                                          java.io.IOException
ReaderWrapper.getRGBChannelCount() > 1), returns the maximum value for each
 embedded channel. Returns null if the plane has not already been read.FormatException - Not actually thrown.java.io.IOException - Not actually thrown.public java.lang.Double[] getPlaneMaximum(int no)
                                   throws FormatException,
                                          java.io.IOException
ReaderWrapper.getRGBChannelCount() > 1), returns the maximum value for each
 embedded channel. Returns null if the plane has not already been read.FormatException - Not actually thrown.java.io.IOException - Not actually thrown.public boolean isMinMaxPopulated()
                          throws FormatException,
                                 java.io.IOException
FormatException - Not actually thrown.java.io.IOException - Not actually thrown.public byte[] openBytes(int no)
                 throws FormatException,
                        java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperFormatExceptionjava.io.IOExceptionIFormatReader.openBytes(int, byte[])public byte[] openBytes(int no,
                        byte[] buf)
                 throws FormatException,
                        java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperno - 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.java.io.IOException - if there was a problem reading the file.public byte[] openBytes(int no,
                        int x,
                        int y,
                        int w,
                        int h)
                 throws FormatException,
                        java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic byte[] openBytes(int no,
                        byte[] buf,
                        int x,
                        int y,
                        int w,
                        int h)
                 throws FormatException,
                        java.io.IOException
IFormatReaderopenBytes in interface IFormatReaderopenBytes in class ReaderWrapperno - the image index within the file.buf - a pre-allocated buffer.x - X coordinate of the upper-left corner of the sub-imagey - Y coordinate of the upper-left corner of the sub-imagew - width of the sub-imageh - height of the sub-imagebuf for convenience.FormatException - if there was a problem parsing the metadata of the
   file.java.io.IOException - if there was a problem reading the file.public void close(boolean fileOnly)
           throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class ReaderWrapperjava.io.IOExceptionpublic java.lang.Class<?> getNativeDataType()
IFormatHandlerIFormatReader.openPlane(int, int, int, int, int) or IFormatWriter.savePlane(int, java.lang.Object).
 For most readers this type will be a byte array; however, some readers
 call external APIs that work with other types such as
 BufferedImage.getNativeDataType in interface IFormatHandlergetNativeDataType in class ReaderWrapperprotected void updateMinMax(int no,
                            byte[] buf,
                            int len)
                     throws FormatException,
                            java.io.IOException
no - the image index within the file.buf - a pre-allocated buffer.len - as buf may be larger than the actual pixel count
 having been written to it, the length (in bytes) of the those pixels.FormatExceptionjava.io.IOExceptionprotected void initMinMax()
                   throws FormatException,
                          java.io.IOException
FormatException - Not actually thrown.java.io.IOException - Not actually thrown.Copyright © 2018 Open Microscopy Environment