public abstract class AbstractReader<M extends TypedMetadata,P extends DataPlane<?>> extends AbstractGroupable implements TypedReader<M,P>
Reader implementations.| Constructor and Description |
|---|
AbstractReader(Class<P> planeClass)
Constructs a reader and stores a reference to its plane type
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Plane> |
castToTypedPlane(Plane plane)
Convenience method for casting
Plane implementations to the type
associated with this Reader. |
void |
close(boolean fileOnly)
Closes the image source(s) associated with this component, with a toggle to
determine if the component itself is reset.
|
protected abstract String[] |
createDomainArray()
Helper method to lazily create the domain array for this reader instance,
to avoid constantly re-creating the array.
|
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.
|
M |
getMetadata()
Gets the type-specific Metadata for this Reader
|
long |
getOptimalTileHeight(int imageIndex)
Returns the optimal sub-image height for use with
Reader.openPlane(int, long). |
long |
getOptimalTileWidth(int imageIndex)
Returns the optimal sub-image width for use with
Reader.openPlane(int, long). |
Class<P> |
getPlaneClass()
Returns the class of
Planes associated with this Reader. |
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.
|
P |
openPlane(int imageIndex,
long planeIndex)
Creates a
Plane representation of the pixels at the
specified indices. |
P |
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. |
P |
openPlane(int imageIndex,
long planeIndex,
net.imglib2.Interval bounds,
SCIFIOConfig config)
As
Reader.openPlane(int, long, Interval) with configuration options. |
P |
openPlane(int imageIndex,
long planeIndex,
P plane)
Generic-parameterized
openPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.openPlane(int, long, Plane). |
P |
openPlane(int imageIndex,
long planeIndex,
P plane,
net.imglib2.Interval bounds)
Generic-parameterized
openPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.openPlane(int, long, Plane, Interval). |
P |
openPlane(int imageIndex,
long planeIndex,
Plane plane)
Allows a single
Plane object to be reused by reference when opening
complete planes. |
P |
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. |
P |
openPlane(int imageIndex,
long planeIndex,
P plane,
SCIFIOConfig config) |
P |
openPlane(int imageIndex,
long planeIndex,
SCIFIOConfig config)
As
Reader.openPlane(int, long) with configuration options. |
P |
readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s,
int imageIndex,
net.imglib2.Interval bounds,
int scanlinePad,
P plane)
Generic-parameterized
readPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.readPlane(DataHandle, int, Interval, int, Plane)
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
|
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.
|
P |
readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s,
int imageIndex,
net.imglib2.Interval bounds,
P plane)
Generic-parameterized
readPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.readPlane(DataHandle, int, Interval, Plane)
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
|
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(M meta)
Generic-parameterized
setMetadata method, using
TypedMetadata to avoid type erasure conflicts with
Reader.setMetadata(Metadata). |
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
Reader.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
Reader.setSource(Location) with configuration options. |
fileGroupOption, isSingleFilecloseasBrowsableLocation, asBrowsableLocation, getFormat, getFormatNamegetVersion, loggetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreatePlane, openPlanecreatePlanegetFormat, getFormatNamegetVersion, loggetIdentifiercontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationfileGroupOption, isSingleFileprotected abstract String[] createDomainArray()
public P openPlane(int imageIndex, long planeIndex) throws FormatException, IOException
ReaderPlane representation of the pixels at the
specified indices.openPlane in interface ReaderopenPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>imageIndex - the image index within the dataset.planeIndex - the plane index within the image.Plane at the specified indices.FormatExceptionIOExceptionpublic P openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds) throws FormatException, IOException
ReaderPlane representation of a desired sub-region from
the pixels at the specified indices.openPlane in interface ReaderopenPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>imageIndex - the image index within the dataset.planeIndex - the plane index within the image.bounds - bounds of the planar axes.FormatExceptionIOExceptionpublic P openPlane(int imageIndex, long planeIndex, Plane plane) throws FormatException, IOException
ReaderPlane object to be reused by reference when opening
complete planes.openPlane in interface ReaderFormatExceptionIOExceptionReader.openPlane(int, long)public P openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds) throws FormatException, IOException
ReaderPlane object to be reused by reference when opening
sub-regions of planes.openPlane in interface ReaderFormatExceptionIOExceptionReader.openPlane(int, long, Interval)public P openPlane(int imageIndex, long planeIndex, SCIFIOConfig config) throws FormatException, IOException
ReaderReader.openPlane(int, long) with configuration options.openPlane in interface ReaderopenPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>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.FormatExceptionIOExceptionpublic P openPlane(int imageIndex, long planeIndex, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
ReaderReader.openPlane(int, long, Interval) with configuration options.openPlane in interface ReaderopenPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>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.FormatExceptionIOExceptionpublic Plane openPlane(int imageIndex, long planeIndex, Plane plane, SCIFIOConfig config) throws FormatException, IOException
ReaderPlane object to be reused by reference when opening
complete planes.openPlane in interface ReaderFormatExceptionIOExceptionReader.openPlane(int, long, SCIFIOConfig)public Plane openPlane(int imageIndex, long planeIndex, Plane plane, net.imglib2.Interval bounds, SCIFIOConfig config) throws FormatException, IOException
ReaderPlane object to be reused by reference when opening
sub-regions of planes.openPlane in interface ReaderFormatExceptionIOExceptionReader.openPlane(int, long, Interval, SCIFIOConfig)public org.scijava.io.location.Location getCurrentLocation()
ReadergetCurrentLocation in interface Readerpublic String[] getDomains()
ReadergetDomains in interface Readerpublic org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> getHandle()
Readerpublic long getOptimalTileWidth(int imageIndex)
ReaderReader.openPlane(int, long).getOptimalTileWidth in interface Readerpublic long getOptimalTileHeight(int imageIndex)
ReaderReader.openPlane(int, long).getOptimalTileHeight in interface Readerpublic void setMetadata(Metadata meta) throws IOException
Reader
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.
setMetadata in interface ReaderIOExceptionpublic M getMetadata()
ReadergetMetadata in interface ReadergetMetadata in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>public void setNormalized(boolean normalize)
ReadersetNormalized in interface Readerpublic boolean isNormalized()
ReaderisNormalized in interface Readerpublic boolean hasCompanionFiles()
GroupablehasCompanionFiles in interface GroupablehasCompanionFiles in interface ReaderhasCompanionFiles in class AbstractGroupablepublic void setSource(org.scijava.io.location.Location loc) throws IOException
ReadersetSource in interface Readerloc - the locationIOExceptionpublic void setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> stream) throws IOException
ReadersetSource in interface Readerstream - - The stream to read fromIOExceptionpublic void setSource(org.scijava.io.location.Location loc, SCIFIOConfig config) throws IOException
ReaderReader.setSource(Location) with configuration options.setSource in interface Readerloc - the Locationconfig - Configuration information to use for this read.IOExceptionpublic void setSource(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> handle, SCIFIOConfig config) throws IOException
ReaderReader.setSource(DataHandle) with configuration options.setSource in interface Readerhandle - - The handle to read fromconfig - Configuration information to use for this read.IOExceptionpublic Plane readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, Plane plane) throws IOException
Reader
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
readPlane in interface ReaderIOExceptionpublic Plane readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, int scanlinePad, Plane plane) throws IOException
Reader
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
readPlane in interface ReaderIOExceptionpublic long getPlaneCount(int imageIndex)
ReadergetPlaneCount in interface Readerpublic int getImageCount()
ReadergetImageCount in interface Readerpublic <T extends Plane> T castToTypedPlane(Plane plane)
ReaderPlane implementations to the type
associated with this Reader.
NB: this method will fail if the provided Plane is not compatible
with this Reader.
castToTypedPlane in interface Readerplane - - The base Plane to cast.Plane argument cast to P.public P openPlane(int imageIndex, long planeIndex, P plane) throws FormatException, IOException
TypedReaderopenPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.openPlane(int, long, Plane).openPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>FormatExceptionIOExceptionReader.openPlane(int, long, Plane)public P openPlane(int imageIndex, long planeIndex, P plane, SCIFIOConfig config) throws FormatException, IOException
openPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>FormatExceptionIOExceptionTypedReader.openPlane(int, long, DataPlane)public P openPlane(int imageIndex, long planeIndex, P plane, net.imglib2.Interval bounds) throws FormatException, IOException
TypedReaderopenPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.openPlane(int, long, Plane, Interval).openPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>FormatExceptionIOExceptionReader.openPlane(int, long, Plane, Interval)public void setMetadata(M meta) throws IOException
TypedReadersetMetadata method, using
TypedMetadata to avoid type erasure conflicts with
Reader.setMetadata(Metadata).setMetadata in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>IOExceptionReader.setMetadata(Metadata)public P readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, P plane) throws IOException
TypedReaderreadPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.readPlane(DataHandle, int, Interval, Plane)
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
readPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>IOExceptionReader.readPlane(DataHandle, int, Interval, Plane)public P readPlane(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> s, int imageIndex, net.imglib2.Interval bounds, int scanlinePad, P plane) throws IOException
TypedReaderreadPlane method, using
TypedMetadata to avoid type erasure conflicts with
Reader.readPlane(DataHandle, int, Interval, int, Plane)
NB Presumes that the source stream s is set to the correct offset,
i.e. start of the plane
readPlane in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>IOExceptionReader.readPlane(DataHandle, int, Interval, int, Plane)public Class<P> getPlaneClass()
TypedReaderPlanes associated with this Reader.getPlaneClass in interface TypedReader<M extends TypedMetadata,P extends DataPlane<?>>public void close(boolean fileOnly)
throws IOException
HasSourceclose in interface HasSourcefileOnly - - If true, only the associated source(s) are closed.IOExceptionCopyright © 2011–2026 SCIFIO. All rights reserved.