Interface OpenedImageFile
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
OpenedMultiFile
An image file that has been opened for reading containing one or more series of image-
Stack
s.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionint
The bit-depth of the image voxels e.g. 8 for 8-bit, 16 for 16-bit etc.channelNames
(Logger logger) The names of each channel, if they are known.void
close()
Closes the opened image-file, removing any intermediate data-structures.dimensionsForSeries
(int seriesIndex, Logger logger) TheDimensions
associated with a particular series.boolean
Whether the image-file has RGB encoded voxels.default ImageMetadata
Extracts metadata about the image.int
numberChannels
(Logger logger) The number of channels in the image-file e.g. 1 for grayscale, 3 for RGB.int
numberFrames
(Logger logger) The number of frames in the image-file i.e. distinct images for a particular time-point.int
The number of series (distinct sets of images) in the image-file.Open when we don't have a specific-type.default TimeSeries
Open the first series when we don't have a specific-type.default TimeSeries
openCheckType
(int seriesIndex, VoxelDataType channelDataType, Logger logger) Opens a time-series, and checks that it is a particular type.pyramid()
Metadata to describe an image-pyramid, if it exists for this opened-image.The timestamps and file-attributes associated with the image.
-
Method Details
-
openCheckType
default TimeSeries openCheckType(int seriesIndex, VoxelDataType channelDataType, Logger logger) throws ImageIOException Opens a time-series, and checks that it is a particular type.If it's not the correct type, an error is thrown.
- Parameters:
seriesIndex
- the index of the series to open.channelDataType
- the expected data-type of the channels.logger
- the logger.- Returns:
- a newly created
TimeSeries
of images for the series. - Throws:
ImageIOException
- if an error occurs reading the image during this operation.
-
open
Open the first series when we don't have a specific-type.- Parameters:
logger
- the logger.- Returns:
- a time-sequence of images.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
open
Open when we don't have a specific-type.- Parameters:
seriesIndex
- the index of the series of the open, zero-indexed.logger
- the logger.- Returns:
- a time-sequence of images.
- Throws:
ImageIOException
- if an error occurs reading the image during this operation.
-
numberSeries
int numberSeries()The number of series (distinct sets of images) in the image-file.- Returns:
- the number of series.
-
channelNames
The names of each channel, if they are known.- Parameters:
logger
- the logger.- Returns:
- a list of the names, which should correspond (and have the same number of items) as
numberChannels(Logger)
. - Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
numberChannels
The number of channels in the image-file e.g. 1 for grayscale, 3 for RGB.- Parameters:
logger
- the logger.- Returns:
- the number of channels.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
numberFrames
The number of frames in the image-file i.e. distinct images for a particular time-point.- Parameters:
logger
- the logger.- Returns:
- the number of frames.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
bitDepth
The bit-depth of the image voxels e.g. 8 for 8-bit, 16 for 16-bit etc.- Parameters:
logger
- the logger.- Returns:
- the bit-depth.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
timestamps
The timestamps and file-attributes associated with the image.- Returns:
- timestamps and file-attributes, either newly-created or reused.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
pyramid
Metadata to describe an image-pyramid, if it exists for this opened-image.- Returns:
- the metadata, or
Optional.empty()
if no pyramid exists. - Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
isRGB
Whether the image-file has RGB encoded voxels.- Parameters:
logger
- the logger.- Returns:
- true if the image has RGB or RGBA encoded voxels, false otherwise.
- Throws:
ImageIOException
- if an error occurs reading the image to determine this information.
-
close
Closes the opened image-file, removing any intermediate data-structures.- Specified by:
close
in interfaceAutoCloseable
- Throws:
ImageIOException
-
dimensionsForSeries
TheDimensions
associated with a particular series.- Parameters:
seriesIndex
- the index of the series.logger
- a logger for any non-fatal errors. Fatal errors throw an exception.- Returns:
- the corresponding dimensions.
- Throws:
ImageIOException
- if any filesystem-related input-output failure occurs.
-
metadata
Extracts metadata about the image.This may be called without later retrieving a channel from the image, so it is desirable that it is as computationally efficient as possible, for this use case.
- Parameters:
seriesIndex
- the index of the series.logger
- the logger.- Returns:
- the associated image metadata.
- Throws:
ImageIOException
- if any filesystem-related input-output failure occurs.
-