public class MultipleImagesReader extends LMSFileReader
LMSFileReader.ImageFormat
Modifier and Type | Field and Description |
---|---|
private boolean |
dimensionsSwapped |
private LMSFileReader.ImageFormat |
imageFormat |
private int |
imageIndex |
private java.util.List<FormatReader> |
readers |
private int |
series |
private int |
tileCount |
associatedXmlDoc, log, metaTemp, OLD_PHYSICAL_SIZE_DEFAULT, OLD_PHYSICAL_SIZE_KEY
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
MultipleImagesReader(XlifDocument xlif,
int imageIndex) |
Modifier and Type | Method and Description |
---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
int |
getBitsPerPixel()
Gets the number of valid bits per pixel.
|
LMSFileReader.ImageFormat |
getImageFormat()
Returns the file format in which actual image bytes are stored
|
int |
getPixelType()
Gets the pixel type.
|
int |
getRGBChannelCount()
Gets the number of channels returned with each call to openBytes.
|
int |
getSizeC()
Gets the size of the C dimension.
|
private void |
initReaders(java.util.List<java.lang.String> ids)
Creates an internal reader for each image file
|
boolean |
isRGB()
Checks if the image planes in the file have more than one channel per
IFormatReader.openBytes(int) call. |
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.
|
void |
reopenFile()
Reopen any files that were closed, and which are expected to be open
while the reader is open.
|
void |
setCoreMetadata(CoreMetadata cmd) |
void |
setMetadataTempBuffer(MetadataTempBuffer metaTemp) |
void |
setSeries(int no)
Sets the field MultipleImagesReader.series.
|
void |
swapDimensions()
Rearranges frame order from ZSTC order (used in XLIFs) to desired CoreMetadata.dimensionOrder
|
addSeriesMeta, addSeriesMetaList, fileExists, getCore, makeFilterMetadata, setCore, translateMetadata, translateMetadata, useOldPhysicalSizeCalculation
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, close, coreIndexToSeries, fileGroupOption, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, initFile, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, updateMetadataLists
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
private java.util.List<FormatReader> readers
private LMSFileReader.ImageFormat imageFormat
private int tileCount
private boolean dimensionsSwapped
private int series
private int imageIndex
public MultipleImagesReader(XlifDocument xlif, int imageIndex) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
no
- the plane index within the current series.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 setSeries(int no)
setSeries
in interface IFormatReader
setSeries
in class FormatReader
public int getRGBChannelCount()
IFormatReader
getRGBChannelCount
in interface IFormatReader
getRGBChannelCount
in class FormatReader
public int getBitsPerPixel()
IFormatReader
IFormatReader.getPixelType()
.getBitsPerPixel
in interface IFormatReader
getBitsPerPixel
in class FormatReader
public int getPixelType()
IFormatReader
getPixelType
in interface IFormatReader
getPixelType
in class FormatReader
FormatTools
static pixel types such as FormatTools.INT8
.public int getSizeC()
IFormatReader
getSizeC
in interface IFormatReader
getSizeC
in class FormatReader
public boolean isRGB()
IFormatReader
IFormatReader.openBytes(int)
call.
This method returns true if and only if IFormatReader.getRGBChannelCount()
returns a value greater than 1.isRGB
in interface IFormatReader
isRGB
in class FormatReader
public void close(boolean fileOnly) throws java.io.IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class LMSFileReader
java.io.IOException
private void initReaders(java.util.List<java.lang.String> ids) throws FormatException, java.io.IOException
ids
- list of file idsFormatException
java.io.IOException
public LMSFileReader.ImageFormat getImageFormat()
LMSFileReader
getImageFormat
in class LMSFileReader
public void setMetadataTempBuffer(MetadataTempBuffer metaTemp)
public void setCoreMetadata(CoreMetadata cmd)
public void swapDimensions() throws FormatException
cmd
- corresponding CoreMetadata (expecting that all tiles have the same dimension sizes)FormatException
public void reopenFile() throws java.io.IOException
IFormatReader
IFormatHandler.setId(java.lang.String)
has been
called, but close(false) has not been called.reopenFile
in interface IFormatReader
reopenFile
in class FormatReader
java.io.IOException
Copyright © 2023 Open Microscopy Environment