Package loci.formats.in
Class ZeissCZIReader
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.ZeissCZIReader
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileReader,IFormatHandler,IFormatReader,IMetadataConfigurable,IPyramidHandler
ZeissCZIReader is the file format reader for Zeiss .czi files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classSegment with ID "ZISRAWATTACH".(package private) classSegment with ID "ZISRAWATTDIR".(package private) static class(package private) static class(package private) static class(package private) static class(package private) classSegment with ID "ZISRAWDIRECTORY".(package private) class(package private) classSegment with ID "ZISRAWFILE".(package private) classSegment with ID "ZISRAWMETADATA".(package private) classTop-level class that implements logic common to all types of Segment.(package private) classSegment with ID "ZISRAWSUBBLOCK". -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate intprivate Stringprivate static final intstatic final booleanstatic final Stringprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate ArrayList<ZeissCZIReader.Channel> private Stringprivate static final intprivate static final intprivate Stringprivate static final Stringprivate Stringprivate ArrayList<ZeissCZIReader.Attachment> private Stringprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intPixel type constants.private booleanprivate static final intprivate Stringprivate String[]private intprivate Stringstatic final booleanstatic final Stringprivate HashMap<ZeissCZIReader.Coordinate, ArrayList<Integer>> private static final intprivate static final intprivate static final intprivate intprivate Stringprivate intprivate Stringprivate DocumentBuilderprivate String[]private intprivate ArrayList<ZeissCZIReader.SubBlock> private intprivate intprivate intprivate ome.units.quantity.Length[]private ome.units.quantity.Length[]private ome.units.quantity.Length[]private Booleanprivate intprivate Stringstatic final booleanstatic final Stringprivate String[]private intprivate intprivate intprivate ArrayList<ZeissCZIReader.Segment> private MetadataStoreprivate Stringprivate int[]private int[]private ome.units.quantity.Timestatic final booleanstatic final Stringprivate static final intCompression constants.private Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate static final intprivate static final intprivate ome.units.quantity.LengthFields 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 TypeMethodDescriptionbooleanprivate voidprivate voidprivate voidcalculateDimensions(int coreIndex, boolean xyOnly) booleanprivate booleanvoidclose(boolean fileOnly) Closes the currently open file.private voidconvertPixelType(int pixelType) private voidconvertPixelType(CoreMetadata ms0, int pixelType) private byte[]decode12BitCamera(byte[] data, int maxBytes) short[][]Gets the 16-bit color lookup table associated with the most recently opened image.byte[][]Gets the 8-bit color lookup table associated with the most recently opened image.Returns the list of available metadata options.Return the fill value for undefined pixels.private ElementgetFirstNode(Element root, String name) private StringgetFirstNodeValue(Element root, String name) private NodeListgetGrandchildren(Element root, String name) private NodeListgetGrandchildren(Element root, String child, String name) 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.protected voidInitializes the given file (parsing header information, etc.).booleanisThisType(loci.common.RandomAccessInputStream stream) Checks if the given stream is a valid stream for this file format.private StringnormalizeColor(String color) 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 voidparseObjectives(NodeList objectives) private intpopulateCircles(NodeList circles, int roi, int shape) private intpopulateLines(NodeList lines, int roi, int shape) private voidpopulateOriginalMetadata(Element root, Deque<String> nameStack) private intpopulatePolylines(NodeList polylines, int roi, int shape, boolean closed) private intpopulateRectangles(NodeList rectangles, int roi, int shape) private voidprivate ZeissCZIReader.SegmentreadSegment(String filename) private voidreadSegments(String id) private intreadVarint(loci.common.RandomAccessInputStream stream) booleanprivate voidprivate voidtranslateExperiment(Element root) private voidprivate voidtranslateInformation(Element root) private voidtranslateLayers(Element root) private voidtranslateMetadata(String xml) private voidtranslateScaling(Element root) booleanMethods 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, fileGroupOption, flattenHashtables, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, 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, isSingleFile, 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
-
ALLOW_AUTOSTITCHING_KEY
- See Also:
-
ALLOW_AUTOSTITCHING_DEFAULT
public static final boolean ALLOW_AUTOSTITCHING_DEFAULT- See Also:
-
INCLUDE_ATTACHMENTS_KEY
- See Also:
-
INCLUDE_ATTACHMENTS_DEFAULT
public static final boolean INCLUDE_ATTACHMENTS_DEFAULT- See Also:
-
TRIM_DIMENSIONS_KEY
- See Also:
-
TRIM_DIMENSIONS_DEFAULT
public static final boolean TRIM_DIMENSIONS_DEFAULT- See Also:
-
RELATIVE_POSITIONS_KEY
- See Also:
-
RELATIVE_POSITIONS_DEFAULT
public static final boolean RELATIVE_POSITIONS_DEFAULT- See Also:
-
ALIGNMENT
private static final int ALIGNMENT- See Also:
-
HEADER_SIZE
private static final int HEADER_SIZE- See Also:
-
CZI_MAGIC_STRING
- See Also:
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
UNCOMPRESSED
private static final int UNCOMPRESSEDCompression constants.- See Also:
-
JPEG
private static final int JPEG- See Also:
-
LZW
private static final int LZW- See Also:
-
JPEGXR
private static final int JPEGXR- See Also:
-
ZSTD_0
private static final int ZSTD_0- See Also:
-
ZSTD_1
private static final int ZSTD_1- See Also:
-
GRAY8
private static final int GRAY8Pixel type constants.- See Also:
-
GRAY16
private static final int GRAY16- See Also:
-
GRAY_FLOAT
private static final int GRAY_FLOAT- See Also:
-
BGR_24
private static final int BGR_24- See Also:
-
BGR_48
private static final int BGR_48- See Also:
-
BGR_FLOAT
private static final int BGR_FLOAT- See Also:
-
BGRA_8
private static final int BGRA_8- See Also:
-
COMPLEX
private static final int COMPLEX- See Also:
-
COMPLEX_FLOAT
private static final int COMPLEX_FLOAT- See Also:
-
GRAY32
private static final int GRAY32- See Also:
-
GRAY_DOUBLE
private static final int GRAY_DOUBLE- See Also:
-
store
-
pixels
-
segments
-
planes
-
indexIntoPlanes
-
rotations
private int rotations -
positions
private int positions -
illuminations
private int illuminations -
acquisitions
private int acquisitions -
mosaics
private int mosaics -
phases
private int phases -
angles
private int angles -
maxResolution
private int maxResolution -
imageName
-
acquiredDate
-
description
-
userDisplayName
-
userName
-
userFirstName
-
userLastName
-
userMiddleName
-
userEmail
-
userInstitution
-
temperature
-
airPressure
-
humidity
-
co2Percent
-
correctionCollar
-
medium
-
refractiveIndex
-
timeIncrement
private transient ome.units.quantity.Time timeIncrement -
zoom
-
gain
-
channels
-
binnings
-
detectorRefs
-
timestamps
-
gains
-
lightSourceIDs
-
detectorIDs
-
positionsX
private ome.units.quantity.Length[] positionsX -
positionsY
private ome.units.quantity.Length[] positionsY -
positionsZ
private ome.units.quantity.Length[] positionsZ -
previousChannel
private int previousChannel -
prestitched
-
objectiveSettingsID
-
hasDetectorSettings
private boolean hasDetectorSettings -
scanDim
private int scanDim -
rotationLabels
-
phaseLabels
-
illuminationLabels
-
parser
-
extraImages
-
tileWidth
private int[] tileWidth -
tileHeight
private int[] tileHeight -
scaleFactor
private int scaleFactor -
zStep
private transient ome.units.quantity.Length zStep -
plateRows
private transient int plateRows -
plateColumns
private transient int plateColumns -
platePositions
-
fieldNames
-
imageNames
-
-
Constructor Details
-
ZeissCZIReader
public ZeissCZIReader()Constructs a new Zeiss .czi reader.
-
-
Method Details
-
isThisType
Description copied from interface:IFormatReaderChecks if the given stream is a valid stream for this file format. The number of bytes read is format-dependent.- Specified by:
isThisTypein interfaceIFormatReader- Overrides:
isThisTypein classFormatReader- Parameters:
stream- A RandomAccessInputStream representing the file to check. The first byte in the stream is assumed to be the first byte in the file.- Returns:
- true if the file represented by the stream can be read by this reader; false otherwise.
- Throws:
IOException- See Also:
-
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- See Also:
-
get8BitLookupTable
Description copied from interface:IFormatReaderGets the 8-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT8orFormatTools.UINT8, this method will return null.- Specified by:
get8BitLookupTablein interfaceIFormatReader- Overrides:
get8BitLookupTablein classFormatReader- Throws:
FormatExceptionIOException
-
get16BitLookupTable
Description copied from interface:IFormatReaderGets the 16-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or ifIFormatReader.isIndexed()returns false, then this may return null. Also, ifIFormatReader.getPixelType()returns anything other thanFormatTools.INT16orFormatTools.UINT16, this method will return null.- Specified by:
get16BitLookupTablein interfaceIFormatReader- Overrides:
get16BitLookupTablein classFormatReader- Throws:
FormatExceptionIOException
-
getFillColor
Description copied from interface:IFormatReaderReturn the fill value for undefined pixels. The default implementation in IFormatReader always returns 0.- Specified by:
getFillColorin interfaceIFormatReader- Overrides:
getFillColorin classFormatReader- See Also:
-
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
-
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
-
getAvailableOptions
Description copied from class:FormatReaderReturns the list of available metadata options.- Overrides:
getAvailableOptionsin classFormatReader
-
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
-
allowAutostitching
public boolean allowAutostitching() -
canReadAttachments
public boolean canReadAttachments() -
trimDimensions
public boolean trimDimensions() -
storeRelativePositions
public boolean storeRelativePositions() -
readSegments
- Throws:
IOException
-
readAttachments
- Throws:
FormatExceptionIOException
-
calculateDimensions
private void calculateDimensions() -
calculateDimensions
private void calculateDimensions(int coreIndex, boolean xyOnly) -
assignPlaneIndices
private void assignPlaneIndices() -
translateMetadata
- Throws:
FormatExceptionIOException
-
checkPALM
- Throws:
FormatExceptionIOException
-
translateInformation
- Throws:
FormatException
-
translateScaling
-
translateDisplaySettings
- Throws:
FormatException
-
translateLayers
-
translateHardwareSettings
- Throws:
FormatException
-
populateRectangles
-
populatePolylines
-
populateLines
-
populateCircles
-
translateExperiment
- Throws:
FormatException
-
getFirstNode
-
getGrandchildren
-
getGrandchildren
-
getFirstNodeValue
-
populateOriginalMetadata
-
readSegment
- Throws:
IOException
-
convertPixelType
- Throws:
FormatException
-
convertPixelType
- Throws:
FormatException
-
parseObjectives
- Throws:
FormatException
-
decode12BitCamera
- Throws:
IOException
-
readVarint
- Throws:
IOException
-
normalizeColor
-