public class PixelsService extends AbstractFileSystemService implements org.springframework.context.ApplicationEventPublisherAware
Modifier and Type | Field and Description |
---|---|
protected BackOff |
backOff
BackOff implementation for calculating MissingPyramidExceptions
|
static long |
MEMOIZER_WAIT
Default of 100 ms for
memoizerWait |
protected java.io.File |
memoizerDirectory
Location where cached data from the
Memoizer should be stored. |
protected java.io.File |
memoizerDirectoryLocalRW
For read-only servers, this directory is a local read-write directory for storing memo files.
|
protected long |
memoizerWait
Time in ms.
|
static byte[] |
NULL_PLANE
Null plane byte array.
|
static int |
NULL_PLANE_SIZE
Null plane size constant.
|
static byte[] |
nullPlane
Deprecated.
in favor of
NULL_PLANE |
static java.lang.String |
PYRAMID_SUFFIX
Suffix for an the image pyramid of a given pixels set.
|
protected FilePathResolver |
resolver
Resolver of archived original file paths for pixels sets.
|
protected TileSizes |
sizes
TileSizes implementation for default values
|
FILES_PATH, PIXELS_PATH, ROOT_DEFAULT, THUMBNAILS_PATH
Constructor and Description |
---|
PixelsService(java.lang.String path)
Constructor.
|
PixelsService(java.lang.String path,
boolean isReadOnlyRepo,
java.io.File memoizerDirectory,
long memoizerWait,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery) |
PixelsService(java.lang.String path,
boolean isReadOnlyRepo,
long memoizerWait,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery)
Deprecated.
|
PixelsService(java.lang.String path,
java.io.File memoizerDirectory,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery)
|
PixelsService(java.lang.String path,
java.io.File memoizerDirectory,
long memoizerWait,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery)
Deprecated.
|
PixelsService(java.lang.String path,
FilePathResolver resolver)
Deprecated.
|
PixelsService(java.lang.String path,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery)
Constructor.
|
PixelsService(java.lang.String path,
long memoizerWait,
FilePathResolver resolver,
BackOff backOff,
TileSizes sizes,
ome.api.IQuery iQuery)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
PixelBuffer |
_getPixelBuffer(ome.model.core.Pixels pixels,
boolean write) |
protected BfPixelBuffer |
createBfPixelBuffer(java.lang.String filePath,
int series)
Helper method to properly log any exceptions raised by Bio-Formats.
|
protected loci.formats.IFormatReader |
createBfReader()
Create an
IFormatReader with the appropriate ReaderWrapper
instances and IFormatReader.setFlattenedResolutions(boolean) set to false. |
protected BfPixelBuffer |
createMinMaxBfPixelBuffer(java.lang.String filePath,
int series,
loci.formats.meta.IMinMaxStore store)
Helper method to properly log any exceptions raised by Bio-Formats and
add a min/max calculator wrapper to the reader stack.
|
PixelBuffer |
createPixelBuffer(ome.model.core.Pixels pixels)
Creates a PixelBuffer for a given pixels set.
|
protected BfPyramidPixelBuffer |
createPyramidPixelBuffer(ome.model.core.Pixels pixels,
java.lang.String filePath,
boolean write)
Helper method to properly log any exceptions raised by Bio-Formats.
|
protected PixelBuffer |
createRomioPixelBuffer(java.lang.String pixelsFilePath,
ome.model.core.Pixels pixels,
boolean allowModification)
Helper method to properlty create a RomioPixelBuffer.
|
loci.formats.IFormatReader |
getBfReader(ome.model.core.Pixels pixels)
Short-cut in the FS case where we know that we are dealing with a FS-lite
file, and want to retrieve the actual file as opposed to a pyramid or anything
else.
|
java.io.File |
getMemoizerDirectory() |
long |
getMemoizerWait() |
protected java.lang.String |
getOriginalFilePath(ome.model.core.Pixels pixels)
Retrieves the original file path for a given set of pixels.
|
PixelBuffer |
getPixelBuffer(ome.model.core.Pixels pixels)
Deprecated.
In the future callers should use the more descriptive
getPixelBuffer(Pixels, boolean) . |
PixelBuffer |
getPixelBuffer(ome.model.core.Pixels pixels,
boolean write)
Returns a pixel buffer for a given set of pixels.
|
protected int |
getSeries(ome.model.core.Pixels pixels)
Retrieves the series for a given set of pixels.
|
protected void |
handleMissingPyramid(ome.model.core.Pixels pixels,
java.lang.String pixelsPyramidFilePath)
If the outer loop should continue, this method returns successfully;
otherwise it throws a MissingPyramidException.
|
protected void |
handleMissingStatsInfo(ome.model.core.Pixels pixels)
If the outer loop should continue, this method returns successfully;
otherwise it throws a MissingPyramidException.
|
ome.model.stats.StatsInfo[] |
makePyramid(ome.model.core.Pixels pixels)
Creates a pixels pyramid for a given set of pixels.
|
void |
removePixels(java.util.List<java.lang.Long> pixelIds)
Removes files from data repository based on a parameterized List of Long
pixels ids
|
boolean |
requiresPixelsPyramid(ome.model.core.Pixels pixels)
Returns whether a pyramid should be used for the given
Pixels . |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher pub) |
void |
setFilePathResolver(FilePathResolver resolver) |
void |
setMemoizerDirectoryLocal(java.lang.String path) |
void |
setMetrics(ome.system.metrics.Metrics metrics) |
void |
setReaderSecurityCheck(ReaderSecurityCheck check) |
createSubpath, getFilesPath, getPixelsDirectory, getPixelsPath, getThumbnailPath
public static final java.lang.String PYRAMID_SUFFIX
public static final int NULL_PLANE_SIZE
public static final byte[] NULL_PLANE
public static final long MEMOIZER_WAIT
memoizerWait
protected FilePathResolver resolver
protected final BackOff backOff
protected final TileSizes sizes
protected final java.io.File memoizerDirectory
Memoizer
should be stored.protected java.io.File memoizerDirectoryLocalRW
null
.protected final long memoizerWait
@Deprecated public static final byte[] nullPlane
NULL_PLANE
public PixelsService(java.lang.String path)
path
- The root of the ROMIO proprietary pixels store. (usually
/OMERO/Pixels
).@Deprecated public PixelsService(java.lang.String path, FilePathResolver resolver)
path
- The root of the ROMIO proprietary pixels store. (usually
/OMERO/Pixels
).public PixelsService(java.lang.String path, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
path
- The root of the ROMIO proprietary pixels store. (usually
/OMERO/Pixels
).resolver
- Original file path resolver for pixels sets.@Deprecated public PixelsService(java.lang.String path, long memoizerWait, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
@Deprecated public PixelsService(java.lang.String path, boolean isReadOnlyRepo, long memoizerWait, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
public PixelsService(java.lang.String path, java.io.File memoizerDirectory, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
@Deprecated public PixelsService(java.lang.String path, java.io.File memoizerDirectory, long memoizerWait, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
public PixelsService(java.lang.String path, boolean isReadOnlyRepo, java.io.File memoizerDirectory, long memoizerWait, FilePathResolver resolver, BackOff backOff, TileSizes sizes, ome.api.IQuery iQuery)
public void setMetrics(ome.system.metrics.Metrics metrics)
public void setReaderSecurityCheck(ReaderSecurityCheck check)
check
- the used files check to apply after subsequent IFormatHandler.setId(String)
public long getMemoizerWait()
public java.io.File getMemoizerDirectory()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher pub)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public void setFilePathResolver(FilePathResolver resolver)
public void setMemoizerDirectoryLocal(java.lang.String path)
public PixelBuffer createPixelBuffer(ome.model.core.Pixels pixels) throws java.io.IOException
pixels
- Pixels set to create a pixel buffer for.java.io.IOException
- If there is an I/O error creating the pixel buffer
backing file.public ome.model.stats.StatsInfo[] makePyramid(ome.model.core.Pixels pixels)
pixels
- Pixels set to retrieve a pixel buffer for.@Deprecated public PixelBuffer getPixelBuffer(ome.model.core.Pixels pixels)
getPixelBuffer(Pixels, boolean)
.pixels
- Pixels set to retrieve a pixel buffer for.getPixelBuffer(Pixels, boolean)
public PixelBuffer getPixelBuffer(ome.model.core.Pixels pixels, boolean write)
pixels
- Pixels set to retrieve a pixel buffer for.write
- Whether or not to open the pixel buffer as read-write.
true
opens as read-write, false
opens as
read-only.public PixelBuffer _getPixelBuffer(ome.model.core.Pixels pixels, boolean write)
public boolean requiresPixelsPyramid(ome.model.core.Pixels pixels)
Pixels
.
This usually implies that this is a "Big image" and therefore will
need tiling.pixels
- true
if a pyramid should be used, false
otherwiseprotected java.lang.String getOriginalFilePath(ome.model.core.Pixels pixels)
pixels
- Set of pixels to return an orignal file path for.null
if the original file
path could not be located or the resolver
has not been set.protected int getSeries(ome.model.core.Pixels pixels)
pixels
- Set of pixels to return the series for.0
(the first series).protected void handleMissingStatsInfo(ome.model.core.Pixels pixels)
pixels
- protected void handleMissingPyramid(ome.model.core.Pixels pixels, java.lang.String pixelsPyramidFilePath)
pixels
- pixelsPyramidFilePath
- ome.conditions.MissingPyramidException
protected BfPixelBuffer createMinMaxBfPixelBuffer(java.lang.String filePath, int series, loci.formats.meta.IMinMaxStore store)
filePath
- Non-null.series
- series to usestore
- Min/max store to use with the min/max calculator.public loci.formats.IFormatReader getBfReader(ome.model.core.Pixels pixels) throws loci.formats.FormatException, java.io.IOException
loci.formats.FormatException
java.io.IOException
protected loci.formats.IFormatReader createBfReader()
IFormatReader
with the appropriate ReaderWrapper
instances and IFormatReader.setFlattenedResolutions(boolean)
set to false.protected BfPixelBuffer createBfPixelBuffer(java.lang.String filePath, int series)
filePath
- Non-null.series
- series to useBfPixelBuffer
protected BfPyramidPixelBuffer createPyramidPixelBuffer(ome.model.core.Pixels pixels, java.lang.String filePath, boolean write)
pixels
- passed to BfPixelBuffer
filePath
- Non-null.BfPyramidPixelBuffer
protected PixelBuffer createRomioPixelBuffer(java.lang.String pixelsFilePath, ome.model.core.Pixels pixels, boolean allowModification)
pixelsFilePath
- pixels
- allowModification
- public void removePixels(java.util.List<java.lang.Long> pixelIds)
pixelIds
- Long file keys to be deletedome.conditions.ResourceError
- If deletion fails.