Package loci.formats.in
Class FlexReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.FlexReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
FlexReader is a file format reader for Evotec Flex files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classStores a grouping of filters.(package private) classclassSAX handler for parsing XML.classSAX handler for parsing XML from .mea files.classSAX handler for parsing XML from .res files. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate intCamera binning values.private intCamera binning values.private String[]private intprivate intprivate HashMap<String, FlexReader.FilterGroup> static final intCustom IFD entry for Flex XML.static final Stringprivate ArrayList<FlexReader.FlexFile> static final Stringstatic final String[]private intprivate intprivate intprivate ArrayList<ome.units.quantity.Length> private ArrayList<ome.units.quantity.Length> private ArrayList<ome.units.quantity.Length> private Stringprivate Stringprivate intprivate Stringstatic final Stringstatic final StringMapping from server names stored in the .mea file to actual server names.static final String[]private intprivate intprivate int[][]Specifies the row and column index into 'flexFiles' for a given well.private intFields inherited from class loci.formats.FormatReader
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSIONFields inherited from class loci.formats.FormatHandler
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixesFields inherited from interface loci.formats.IFormatReader
CAN_GROUP, CANNOT_GROUP, MUST_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendServerMap(String alias, String realName) Add the path 'realName' to the mapping for the server named 'alias'.voidclose(boolean fileOnly) Closes the currently open file.intReturns an indication of whether the files in a multi-file dataset can be handled individually.private String[]findFiles(loci.common.Location baseFile) Search for files that correspond to the given file.private String[]private intReturns the number of planes in the first well that has data.private intprivate loci.common.IRandomAccessgetFileHandle(String flexFile) intReturns the optimal sub-image height for use with openBytes.intReturns the optimal sub-image width for use with openBytes.String[]getSeriesUsedFiles(boolean noPixels) Returns an array of filenames needed to open the current series.private int[]Returns a two-element array containing the well row and well column corresponding to the given file.private voidgroupFiles(String[] fileList, MetadataStore store) protected voidInitializes the given file (parsing header information, etc.).private voidinitFlexFile(String id) private voidinitMeaFile(String id) Initialize the dataset from a .mea file.private voidinitResFile(String id) Initialize the dataset from a .res file.booleanisSingleFile(String id) Returns true if the named file is expected to be the only file in the dataset.private FlexReader.FlexFilelookupFile(int fileSeries) private FlexReader.FlexFilelookupFile(int wellRow, int wellColumn, int field) static voidMap the server named 'alias' to the path 'realName'.static voidMap the server named 'alias' to the paths in 'realNames'.static voidmapServersFromConfigurationFile(String configFile) Read a configuration file with lines of the form: <server alias>=<real server name> and call mapServer(String, String) accordingly.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.private voidparseFlexFile(int currentWell, int wellRow, int wellCol, int field, boolean firstFile, MetadataStore store) Parses XML metadata from the Flex file corresponding to the given well.private voidparseResFile(String id) private voidpopulateCoreMetadata(int wellRow, int wellCol, int field, List<String> imageNames) Populate core metadata using the given list of image names.private voidMethods inherited from class loci.formats.FormatReader
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, coreIndexToSeries, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, 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, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, updateMetadataListsMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface loci.formats.ICompressedTileReader
getTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytesMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixesMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
FLEX
public static final int FLEXCustom IFD entry for Flex XML.- See Also:
-
FLEX_SUFFIX
- See Also:
-
MEA_SUFFIX
- See Also:
-
RES_SUFFIX
- See Also:
-
MEASUREMENT_SUFFIXES
-
SUFFIXES
-
SCREENING
- See Also:
-
ARCHIVE
- See Also:
-
serverMap
Mapping from server names stored in the .mea file to actual server names. -
binX
private int binXCamera binning values. -
binY
private int binYCamera binning values. -
plateCount
private int plateCount -
wellCount
private int wellCount -
fieldCount
private int fieldCount -
wellRows
private int wellRows -
wellColumns
private int wellColumns -
channelNames
-
xPositions
-
yPositions
-
xSizes
-
ySizes
-
cameraIDs
-
objectiveIDs
-
lightSourceIDs
-
lightSourceCombinationIDs
-
cameraRefs
-
binnings
-
objectiveRefs
-
lightSourceCombinationRefs
-
filterSets
-
filterSetMap
-
acquisitionDates
-
measurementFiles
-
plateName
-
plateBarcode
-
nRows
private int nRows -
nCols
private int nCols -
plateAcqStartTime
-
planePositionX
-
planePositionY
-
planePositionZ
-
planeExposureTime
-
planeDeltaT
-
flexFiles
-
nFiles
private int nFiles -
effectiveFieldCount
private int effectiveFieldCount -
reverseFileMapping
-
dichroicMap
-
filterMap
-
wellNumber
private int[][] wellNumberSpecifies the row and column index into 'flexFiles' for a given well.
-
-
Constructor Details
-
FlexReader
public FlexReader()Constructs a new Flex reader.
-
-
Method Details
-
fileGroupOption
Description copied from interface:IFormatReaderReturns an indication of whether the files in a multi-file dataset can be handled individually. This method is only useful for formats and datasets which contain multiple files.- Specified by:
fileGroupOptionin interfaceIFormatReader- Overrides:
fileGroupOptionin classFormatReader- Parameters:
id- a file in the multi-file dataset- Returns:
- an int indicating that we cannot, must, or might group the files.
A return value of
FormatTools.MUST_GROUPindicates that the files cannot be handled separately; the reader will always detect and read all files in the dataset.FormatTools.CAN_GROUPindicates that the files may be handled separately, but file grouping must then be disabled viaIFormatReader.setGroupFiles(boolean).FormatTools.CANNOT_GROUPindicates that the files must be handled separately; the reader will not attempt to read all files in the dataset (this is rare). - Throws:
FormatExceptionIOException- See Also:
-
isSingleFile
Description copied from interface:IFormatReaderReturns true if the named file is expected to be the only file in the dataset. For single-file formats, always returns true.- Specified by:
isSingleFilein interfaceIFormatReader- Overrides:
isSingleFilein classFormatReader- Throws:
FormatExceptionIOException
-
getSeriesUsedFiles
Description copied from interface:IFormatReaderReturns an array of filenames needed to open the current series. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned. The first element in the array is expected to be the path passed toIFormatHandler.setId(String), if appropriate based upon 'noPixels'. The remaining elements are expected to be in a consistent order; if a directory listing is necessary to build the list then it should be sorted first.- Specified by:
getSeriesUsedFilesin interfaceIFormatReader- Overrides:
getSeriesUsedFilesin classFormatReader
-
getOptimalTileWidth
public int getOptimalTileWidth()Description copied from interface:IFormatReaderReturns the optimal sub-image width for use with openBytes.- Specified by:
getOptimalTileWidthin interfaceIFormatReader- Overrides:
getOptimalTileWidthin classFormatReader
-
getOptimalTileHeight
public int getOptimalTileHeight()Description copied from interface:IFormatReaderReturns the optimal sub-image height for use with openBytes.- Specified by:
getOptimalTileHeightin interfaceIFormatReader- Overrides:
getOptimalTileHeightin classFormatReader
-
openBytes
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException Description copied from interface:IFormatReaderObtains a sub-image of the specified image plane into a pre-allocated byte array.- Specified by:
openBytesin interfaceIFormatReader- Specified by:
openBytesin classFormatReader- Parameters:
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-image- Returns:
- the pre-allocated buffer
buffor convenience. - Throws:
FormatException- if there was a problem parsing the metadata of the file.IOException- if there was a problem reading the file.- See Also:
-
close
Description copied from interface:IFormatReaderCloses the currently open file. If the flag is set, this is all that happens; if unset, it is equivalent to callingCloseable.close().- Specified by:
closein interfaceIFormatReader- Overrides:
closein classFormatReader- Throws:
IOException
-
initFile
Description copied from class:FormatReaderInitializes the given file (parsing header information, etc.). Most subclasses should override this method to perform initialization operations such as parsing metadata.- Overrides:
initFilein classFormatReader- Throws:
FormatException- if a parsing error occurs processing the file.IOException- if an I/O error occurs processing the file
-
initResFile
Initialize the dataset from a .res file.- Throws:
FormatExceptionIOException
-
initMeaFile
Initialize the dataset from a .mea file.- Throws:
FormatExceptionIOException
-
initFlexFile
- Throws:
FormatExceptionIOException
-
populateMetadataStore
- Throws:
FormatException
-
parseResFile
- Throws:
IOException
-
getWell
Returns a two-element array containing the well row and well column corresponding to the given file. -
getField
-
firstWellPlanes
private int firstWellPlanes()Returns the number of planes in the first well that has data. May not be[0][0]as the acquisition may have been column or row offset. -
parseFlexFile
private void parseFlexFile(int currentWell, int wellRow, int wellCol, int field, boolean firstFile, MetadataStore store) throws FormatException, IOException Parses XML metadata from the Flex file corresponding to the given well. If the 'firstFile' flag is set, then the core metadata is also populated.- Throws:
FormatExceptionIOException
-
populateCoreMetadata
private void populateCoreMetadata(int wellRow, int wellCol, int field, List<String> imageNames) throws FormatException Populate core metadata using the given list of image names.- Throws:
FormatException
-
findFiles
Search for files that correspond to the given file. If the given file is a .mea file, then the corresponding files will be .res and .flex files. If the given file is a .flex file, then the corresponding files will be .res and .mea files.- Throws:
IOException
-
findFiles
- Throws:
IOException
-
groupFiles
- Throws:
FormatExceptionIOException
-
getFileHandle
- Throws:
IOException
-
lookupFile
-
lookupFile
-
appendServerMap
Add the path 'realName' to the mapping for the server named 'alias'.- Throws:
FormatException- if 'realName' does not exist
-
mapServer
Map the server named 'alias' to the path 'realName'. If other paths were mapped to 'alias', they will be overwritten. -
mapServer
Map the server named 'alias' to the paths in 'realNames'. If other paths were mapped to 'alias', they will be overwritten. -
mapServersFromConfigurationFile
public static void mapServersFromConfigurationFile(String configFile) throws FormatException, IOException Read a configuration file with lines of the form: <server alias>=<real server name> and call mapServer(String, String) accordingly.- Throws:
FormatException- if configFile does not exist.IOException- See Also:
-