public interface Reader extends HasFormat, HasSource, Groupable
Reader components generate Plane representations of
images via the openPlane(int, long) methods. These planes can then be used by
calling software (e.g. for display) or passed to another method for writing
to an output source (e.g. via the Writer.savePlane(int, long, io.scif.Plane) methods).
Before a Reader can be used, it must be initialized via
setSource(org.scijava.io.location.Location) and setMetadata(io.scif.Metadata) calls.
Plane,
Metadata,
Writer.savePlane(int, long, io.scif.Plane)| Modifier and Type | Method and Description |
|---|---|
<P extends Plane> |
castToTypedPlane(Plane plane)
Convenience method for casting
Plane implementations to the type
associated with this Reader. |
Plane |
createPlane(ImageMetadata meta,
net.imglib2.Interval bounds)
Creates a blank plane compatible with this reader.
|
Plane |
createPlane(net.imglib2.Interval bounds)
Creates a blank plane compatible with this reader.
|
org.scijava.io.location.Location |
getCurrentLocation()
Returns the current file.
|
String[] |
getDomains()
Returns the list of domains represented by the current file.
|
org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> |
getHandle()
Retrieves the current input stream for this reader.
|
int |
getImageCount()
Determines the number of images in the current file.
|
Metadata |
getMetadata()
Gets the type-specific Metadata for this Reader
|
long |
getOptimalTileHeight(int imageIndex)
Returns the optimal sub-image height for use with
openPlane(int, long). |
long |
getOptimalTileWidth(int imageIndex)
Returns the optimal sub-image width for use with
openPlane(int, long). |
long |
getPlaneCount(int imageIndex)
Determines the number of planes in the current file.
|
boolean |
hasCompanionFiles()
Returns true if this format supports multi-file datasets.
|
boolean |
isNormalized()
Returns true if we should normalize float data.
|
Plane |
openPlane(int imageIndex,
long planeIndex)
Creates a
Plane representation of the pixels at the
specified indices. |
Plane |
openPlane(int imageIndex,
long planeIndex,
net.imglib2.Interval bounds)
Creates a
Plane representation of a desired sub-region from
the pixels at the specified indices. |
Plane |
openPlane(int imageIndex,
long planeIndex,
net.imglib2.Interval bounds,
SCIFIOConfig config)
As
openPlane(int, long, Interval) with configuration options. |
Plane |
openPlane(int imageIndex,
long planeIndex,
Plane plane)
Allows a single
Plane object to be reused by reference when opening
complete planes. |
Plane |
openPlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds)
Allows a single
Plane object to be reused by reference when opening
sub-regions of planes. |
Plane |
openPlane(int imageIndex,
long planeIndex,
Plane plane,
net.imglib2.Interval bounds,
SCIFIOConfig config)
Allows a single
Plane object to be reused by reference when opening
sub-regions of planes. |
Plane |
openPlane(int imageIndex,
long planeIndex,
Plane plane,
SCIFIOConfig config)
Allows a single
Plane object to be reused by reference when opening
complete planes. |
Plane |
openPlane(int imageIndex,
long planeIndex,
SCIFIOConfig config)
As
openPlane(int, long) with configuration options. |
Plane |
readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s,
int imageIndex,
net.imglib2.Interval bounds,
int scanlinePad,
Plane plane)
Reads a raw plane from disk.
|
Plane |
readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s,
int imageIndex,
net.imglib2.Interval bounds,
Plane plane)
Reads a raw plane from disk.
|
void |
setMetadata(Metadata meta)
Sets the Metadata for this Reader.
|
void |
setNormalized(boolean normalize)
Specifies whether or not to normalize float data.
|
void |
setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> stream)
Sets the source for this reader to read from.
|
void |
setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> handle,
SCIFIOConfig config)
As
setSource(DataHandle) with configuration options. |
void |
setSource(org.scijava.io.location.Location loc)
Sets the source for this reader to read from.
|
void |
setSource(org.scijava.io.location.Location loc,
SCIFIOConfig config)
As
setSource(Location) with configuration options. |
getFormat, getFormatNamegetVersion, loggetIdentifiercontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationfileGroupOption, isSingleFilePlane openPlane(int imageIndex, long planeIndex) throws FormatException, IOException
Plane representation of the pixels at the
specified indices.imageIndex - the image index within the dataset.planeIndex - the plane index within the image.Plane at the specified indices.FormatExceptionIOExceptionPlane openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds) throws FormatException, IOException
Plane representation of a desired sub-region from
the pixels at the specified indices.imageIndex - the image index within the dataset.planeIndex - the plane index within the image.bounds - bounds of the planar axes.FormatExceptionIOExceptionPlane openPlane(int imageIndex, long planeIndex, Plane plane) throws FormatException, IOException
Plane object to be reused by reference when opening
complete planes.IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.FormatExceptionIOExceptionopenPlane(int, long)Plane openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds) throws FormatException, IOException
Plane object to be reused by reference when opening
sub-regions of planes.IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.FormatExceptionIOExceptionopenPlane(int, long, Interval)Plane openPlane(int imageIndex, long planeIndex, SCIFIOConfig config) throws FormatException, IOException
openPlane(int, long) with configuration options.imageIndex - the image index within the dataset.planeIndex - the plane index within the image.config - Configuration information to use for this read.Plane at the specified indices.FormatExceptionIOExceptionPlane openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
openPlane(int, long, Interval) with configuration options.imageIndex - the image index within the dataset.planeIndex - the plane index within the image.bounds - bounds of the planar axes.config - Configuration information to use for this read.FormatExceptionIOExceptionPlane openPlane(int imageIndex, long planeIndex, Plane plane, SCIFIOConfig config) throws FormatException, IOException
Plane object to be reused by reference when opening
complete planes.IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.FormatExceptionIOExceptionopenPlane(int, long, SCIFIOConfig)Plane openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
Plane object to be reused by reference when opening
sub-regions of planes.IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.FormatExceptionIOExceptionopenPlane(int, long, Interval, SCIFIOConfig)org.scijava.io.location.Location getCurrentLocation()
String[] getDomains()
org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> getHandle()
long getOptimalTileWidth(int imageIndex)
openPlane(int, long).long getOptimalTileHeight(int imageIndex)
openPlane(int, long).void setMetadata(Metadata meta) throws IOException
NB: This method has accepts a general Metadata so that this
signature can appear in the base interface for all Readers, but
behavior if provided with a Metadata instance not associated with
this Reader is undefined and should throw an exception.
IllegalArgumentException - If the provided Metadata type is
not compatible with this Reader.IOExceptionMetadata getMetadata()
void setNormalized(boolean normalize)
boolean isNormalized()
boolean hasCompanionFiles()
hasCompanionFiles in interface Groupablevoid setSource(org.scijava.io.location.Location loc) throws IOException
loc - the locationIOExceptionvoid setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> stream) throws IOException
stream - - The stream to read fromIOExceptionvoid setSource(org.scijava.io.location.Location loc, SCIFIOConfig config) throws IOException
setSource(Location) with configuration options.loc - the Locationconfig - Configuration information to use for this read.IOExceptionvoid setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> handle, SCIFIOConfig config) throws IOException
setSource(DataHandle) with configuration options.handle - - The handle to read fromconfig - Configuration information to use for this read.IOExceptionPlane readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, Plane plane) throws IOException
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.IOExceptionPlane readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, int scanlinePad, Plane plane) throws IOException
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.IOExceptionlong getPlaneCount(int imageIndex)
int getImageCount()
Plane createPlane(net.imglib2.Interval bounds)
bounds - bounds of the planar axes.Plane createPlane(ImageMetadata meta, net.imglib2.Interval bounds)
meta - - ImageMetadata to use to populate the new plane.bounds - bounds of the planar axes.<P extends Plane> P castToTypedPlane(Plane plane)
Plane implementations to the type
associated with this Reader.
NB: this method will fail if the provided Plane is not compatible
with this Reader.
plane - - The base Plane to cast.Plane argument cast to P.IllegalArgumentException - If the provided Plane type is not
compatible with this Reader.Copyright © 2011–2026 SCIFIO. All rights reserved.