@Transactional(readOnly=true) public class RenderingBean extends Object implements RenderingEngine, Serializable
RenderingEngine
service. This class is an Adapter to
wrap the Renderer
so to make it thread-safe.
The multi-threaded design of this component is based on dynamic locking and
confinement techniques. All access to the component's internal parts happens
through a RenderingEngineImpl
object, which is fully
synchronized. Internal parts are either never leaked out or given away only
if read-only objects. (The only exception are the CodomainMapContext
objects which are not read-only but are copied upon every method invocation
so to maintain safety.)
Finally the RenderingEngine
component doesn't make use of constructs
that could compromise liveness.
RenderingEngine
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static String |
NULL_RENDERER
Message if the rendering engine is not ready.
|
Constructor and Description |
---|
RenderingBean(PixelsService dataService,
LocalCompress compress,
Executor ex,
SecuritySystem secSys)
Compression service Bean injector.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Completely restore this service for active use from whatever
passivation it has implemented.
|
void |
addCodomainMap(CodomainMapContext mapCtx)
Implemented as specified by the
RenderingEngine interface. |
void |
close()
signals the end of the service lifecycle.
|
protected void |
errorIfInvalidState() |
protected void |
errorIfNullPixels()
Throws an
ApiUsageException if the pixels are not set. |
protected void |
errorIfNullRenderer()
Reloads the rendering engine if
null and has been
made passive or throws an ApiUsageException if the rendering
engine is not set. |
protected void |
errorIfNullRenderingDef()
Throws an
ApiUsageException if the rendering settings are not
set. |
List |
getAvailableFamilies()
Implemented as specified by the
RenderingEngine interface. |
List |
getAvailableModels()
Implemented as specified by the
RenderingEngine interface. |
double |
getChannelCurveCoefficient(int w)
Implemented as specified by the
RenderingEngine interface. |
ome.model.enums.Family |
getChannelFamily(int w)
Implemented as specified by the
RenderingEngine interface. |
String |
getChannelLookupTable(int w) |
boolean |
getChannelNoiseReduction(int w)
Implemented as specified by the
RenderingEngine interface. |
double[] |
getChannelStats(int w)
Implemented as specified by the
RenderingEngine interface. |
double |
getChannelWindowEnd(int w)
Implemented as specified by the
RenderingEngine interface. |
double |
getChannelWindowStart(int w)
Implemented as specified by the
RenderingEngine interface. |
float |
getCompressionLevel()
Implemented as specified by the
RenderingEngine interface. |
EventContext |
getCurrentEventContext()
Implemented as specified by the
RenderingEngine interface. |
int |
getDefaultT()
Implemented as specified by the
RenderingEngine interface. |
int |
getDefaultZ()
Implemented as specified by the
RenderingEngine interface. |
ome.model.enums.RenderingModel |
getModel()
Implemented as specified by the
RenderingEngine interface. |
ome.model.core.Pixels |
getPixels()
Implemented as specified by the
RenderingEngine interface. |
double |
getPixelsTypeLowerBound(int w)
Implemented as specified by the
RenderingEngine interface. |
double |
getPixelsTypeUpperBound(int w)
Implemented as specified by the
RenderingEngine interface. |
ome.model.display.QuantumDef |
getQuantumDef()
Implemented as specified by the
RenderingEngine interface. |
long |
getRenderingDefId()
Returns the id of the
RederingDef loaded by either
RenderingEngine.lookupRenderingDef(long) or RenderingEngine.loadRenderingDef(long) . |
List<List<Integer>> |
getResolutionDescriptions() |
int |
getResolutionLevel() |
int |
getResolutionLevels() |
int[] |
getRGBA(int w)
Implemented as specified by the
RenderingEngine interface. |
Class<? extends ServiceInterface> |
getServiceInterface()
Returns the service corresponding to this class.
|
int[] |
getTileSize() |
boolean |
isActive(int w)
Implemented as specified by the
RenderingEngine interface. |
boolean |
isPixelsTypeSigned()
Implemented as specified by the
RenderingEngine interface. |
void |
load()
Implemented as specified by the
RenderingEngine interface. |
void |
loadRenderingDef(long renderingDefId)
Implemented as specified by the
RenderingEngine interface. |
void |
lookupPixels(long pixelsId)
Implemented as specified by the
RenderingEngine interface. |
boolean |
lookupRenderingDef(long pixelsId)
Implemented as specified by the
RenderingEngine interface. |
void |
passivate()
Perform whatever passivation is possible or throw an exception.
|
void |
removeCodomainMap(CodomainMapContext mapCtx)
Implemented as specified by the
RenderingEngine interface. |
RGBBuffer |
render(PlaneDef pd)
Implemented as specified by the
RenderingEngine interface. |
int[] |
renderAsPackedInt(PlaneDef pd)
Implemented as specified by the
RenderingEngine interface. |
byte[] |
renderCompressed(PlaneDef pd)
Implemented as specified by the
RenderingEngine interface. |
int[] |
renderProjectedAsPackedInt(int algorithm,
int timepoint,
int stepping,
int start,
int end)
Implemented as specified by the
RenderingEngine interface. |
byte[] |
renderProjectedCompressed(int algorithm,
int timepoint,
int stepping,
int start,
int end)
Implemented as specified by the
RenderingEngine interface. |
boolean |
requiresPixelsPyramid() |
long |
resetDefaultSettings(boolean save)
Implemented as specified by the
RenderingEngine interface. |
long |
saveAsNewSettings()
Implemented as specified by the
RenderingEngine interface. |
void |
saveCurrentSettings()
Implemented as specified by the
RenderingEngine interface. |
void |
setActive(int w,
boolean active)
Implemented as specified by the
RenderingEngine interface. |
void |
setChannelLookupTable(int w,
String lookup) |
void |
setChannelWindow(int w,
double start,
double end)
Implemented as specified by the
RenderingEngine interface. |
void |
setCodomainInterval(int start,
int end)
Implemented as specified by the
RenderingEngine interface. |
void |
setCompressionLevel(float percentage)
Implemented as specified by the
RenderingEngine interface. |
void |
setDefaultT(int t)
Implemented as specified by the
RenderingEngine interface. |
void |
setDefaultZ(int z)
Implemented as specified by the
RenderingEngine interface. |
void |
setModel(ome.model.enums.RenderingModel model)
Implemented as specified by the
RenderingEngine interface. |
void |
setOverlays(Map<byte[],Integer> overlays)
Deprecated.
As of release 5.1.0, replaced by
PlaneDef.setShapeIds(List) . |
void |
setQuantizationMap(int w,
ome.model.enums.Family family,
double coefficient,
boolean noiseReduction)
Implemented as specified by the
RenderingEngine interface. |
void |
setQuantumStrategy(int bitResolution)
Implemented as specified by the
RenderingEngine interface. |
void |
setResolutionLevel(int resolutionLevel) |
void |
setRGBA(int w,
int red,
int green,
int blue,
int alpha)
Implemented as specified by the
RenderingEngine interface. |
void |
updateCodomainMap(CodomainMapContext mapCtx)
Implemented as specified by the
RenderingEngine interface. |
protected static final String NULL_RENDERER
public RenderingBean(PixelsService dataService, LocalCompress compress, Executor ex, SecuritySystem secSys)
compressionService
- an ICompress
.public Class<? extends ServiceInterface> getServiceInterface()
public long getRenderingDefId()
RenderingEngine
RederingDef
loaded by either
RenderingEngine.lookupRenderingDef(long)
or RenderingEngine.loadRenderingDef(long)
.getRenderingDefId
in interface RenderingEngine
@Transactional(readOnly=true) public void passivate()
StatefulServiceInterface
passivate
in interface StatefulServiceInterface
@Transactional(readOnly=true) public void activate()
StatefulServiceInterface
activate
in interface StatefulServiceInterface
public void close()
StatefulServiceInterface
close
in interface StatefulServiceInterface
public void lookupPixels(long pixelsId)
RenderingEngine
interface.lookupPixels
in interface RenderingEngine
pixelsId
- The pixels set ID.RenderingEngine.lookupPixels(long)
public boolean lookupRenderingDef(long pixelsId)
RenderingEngine
interface.lookupRenderingDef
in interface RenderingEngine
pixelsId
- The pixels set ID.true
if a RenderingDef
exists for the
Pixels
set, otherwise false
.RenderingEngine.lookupRenderingDef(long)
public void loadRenderingDef(long renderingDefId)
RenderingEngine
interface.loadRenderingDef
in interface RenderingEngine
renderingDefId
- The rendering definition ID.RenderingEngine.loadRenderingDef(long)
public void load()
RenderingEngine
interface.load
in interface RenderingEngine
RenderingEngine.load()
public void setOverlays(Map<byte[],Integer> overlays)
PlaneDef.setShapeIds(List)
.RenderingEngine
interface.setOverlays
in interface RenderingEngine
overlays
- Binary mask to color map.RenderingEngine#setOverlays()
public EventContext getCurrentEventContext()
RenderingEngine
interface. TODOgetCurrentEventContext
in interface StatefulServiceInterface
StatefulServiceInterface.getCurrentEventContext()
public RGBBuffer render(PlaneDef pd)
RenderingEngine
interface.render
in interface RenderingEngine
pd
- Selects a plane orthogonal to one of the X, Y,
or Z axes.RenderingEngine.render(PlaneDef)
public int[] renderAsPackedInt(PlaneDef pd)
RenderingEngine
interface.renderAsPackedInt
in interface RenderingEngine
pd
- Selects a plane orthogonal to one of the X, Y,
or Z axes.RenderingEngine.render(PlaneDef)
public byte[] renderCompressed(PlaneDef pd)
RenderingEngine
interface.renderCompressed
in interface RenderingEngine
pd
- Selects a plane orthogonal to one of the X, Y,
or Z axes.RenderingEngine#renderCompressed()
public int[] renderProjectedAsPackedInt(int algorithm, int timepoint, int stepping, int start, int end)
RenderingEngine
interface.renderProjectedAsPackedInt
in interface RenderingEngine
algorithm
- IProjection#MAXIMUM_INTENSITY
,
IProjection#MEAN_INTENSITY
or IProjection#SUM_INTENSITY
.stepping
- Stepping value to use while calculating the projection.
For example, stepping=1
will use every optical section from
start
to end
where stepping=2
will
use every other section from start
to end
to
perform the projection.start
- Optical section to start projecting from.end
- Optical section to finish projecting.RenderingEngine#renderProjectedAsPackedInt()
public byte[] renderProjectedCompressed(int algorithm, int timepoint, int stepping, int start, int end)
RenderingEngine
interface.renderProjectedCompressed
in interface RenderingEngine
algorithm
- IProjection#MAXIMUM_INTENSITY
,
IProjection#MEAN_INTENSITY
or IProjection#SUM_INTENSITY
.stepping
- Stepping value to use while calculating the projection.
For example, stepping=1
will use every optical section from
start
to end
where stepping=2
will
use every other section from start
to end
to
perform the projection.start
- Optical section to start projecting from.end
- Optical section to finish projecting.RenderingEngine#renderProjectedCompressed()
public long resetDefaultSettings(boolean save)
RenderingEngine
interface.resetDefaultSettings
in interface RenderingEngine
save
- Pass true
to save the settings,
false
otherwise.RenderingEngine.resetDefaultSettings(boolean)
public void setCompressionLevel(float percentage)
RenderingEngine
interface.setCompressionLevel
in interface RenderingEngine
percentage
- A percentage compression level from 1.00 (100%) to
0.01 (1%).RenderingEngine#setCompressionLevel()
public float getCompressionLevel()
RenderingEngine
interface.getCompressionLevel
in interface RenderingEngine
RenderingEngine.getCompressionLevel()
@Transactional(readOnly=false) public long saveAsNewSettings()
RenderingEngine
interface.saveAsNewSettings
in interface RenderingEngine
RenderingEngine.saveAsNewSettings()
@Transactional(readOnly=false) public void saveCurrentSettings()
RenderingEngine
interface.saveCurrentSettings
in interface RenderingEngine
RenderingEngine.saveCurrentSettings()
public double getChannelCurveCoefficient(int w)
RenderingEngine
interface.getChannelCurveCoefficient
in interface RenderingEngine
w
- The channel index.RenderingEngine.getChannelCurveCoefficient(int)
public ome.model.enums.Family getChannelFamily(int w)
RenderingEngine
interface.getChannelFamily
in interface RenderingEngine
w
- The channel index.RenderingEngine.getChannelFamily(int)
public boolean getChannelNoiseReduction(int w)
RenderingEngine
interface.getChannelNoiseReduction
in interface RenderingEngine
w
- The channel index.RenderingEngine.getChannelNoiseReduction(int)
public double[] getChannelStats(int w)
RenderingEngine
interface.getChannelStats
in interface RenderingEngine
public double getChannelWindowEnd(int w)
RenderingEngine
interface.getChannelWindowEnd
in interface RenderingEngine
w
- The channel index.RenderingEngine.getChannelWindowEnd(int)
public double getChannelWindowStart(int w)
RenderingEngine
interface.getChannelWindowStart
in interface RenderingEngine
w
- The channel index.RenderingEngine.getChannelWindowStart(int)
public int[] getRGBA(int w)
RenderingEngine
interface.getRGBA
in interface RenderingEngine
w
- The channel index.RenderingEngine.getRGBA(int)
public boolean isActive(int w)
RenderingEngine
interface.isActive
in interface RenderingEngine
w
- The channel index.RenderingEngine.isActive(int)
public String getChannelLookupTable(int w)
getChannelLookupTable
in interface RenderingEngine
public void setChannelLookupTable(int w, String lookup)
setChannelLookupTable
in interface RenderingEngine
public int getDefaultT()
RenderingEngine
interface.getDefaultT
in interface RenderingEngine
RenderingEngine.getDefaultT()
public int getDefaultZ()
RenderingEngine
interface.getDefaultZ
in interface RenderingEngine
RenderingEngine.getDefaultZ()
public ome.model.enums.RenderingModel getModel()
RenderingEngine
interface.getModel
in interface RenderingEngine
RenderingEngine.getModel()
public ome.model.display.QuantumDef getQuantumDef()
RenderingEngine
interface.getQuantumDef
in interface RenderingEngine
RenderingEngine.getQuantumDef()
public ome.model.core.Pixels getPixels()
RenderingEngine
interface.getPixels
in interface RenderingEngine
RenderingEngine.getPixels()
public List getAvailableModels()
RenderingEngine
interface.getAvailableModels
in interface RenderingEngine
RenderingEngine.getAvailableModels()
public List getAvailableFamilies()
RenderingEngine
interface.getAvailableFamilies
in interface RenderingEngine
RenderingEngine.getAvailableFamilies()
public void addCodomainMap(CodomainMapContext mapCtx)
RenderingEngine
interface.addCodomainMap
in interface RenderingEngine
mapCtx
- The context to add.RenderingEngine.updateCodomainMap(CodomainMapContext)
,
RenderingEngine.removeCodomainMap(CodomainMapContext)
public void removeCodomainMap(CodomainMapContext mapCtx)
RenderingEngine
interface.removeCodomainMap
in interface RenderingEngine
mapCtx
- The context to remove.RenderingEngine.addCodomainMap(CodomainMapContext)
,
RenderingEngine.updateCodomainMap(CodomainMapContext)
public void updateCodomainMap(CodomainMapContext mapCtx)
RenderingEngine
interface.updateCodomainMap
in interface RenderingEngine
mapCtx
- The context to update.RenderingEngine.addCodomainMap(CodomainMapContext)
,
RenderingEngine.removeCodomainMap(CodomainMapContext)
public void setActive(int w, boolean active)
RenderingEngine
interface.setActive
in interface RenderingEngine
w
- The channel index.active
- Pass true
to map the channel,
false
otherwise.RenderingEngine.setActive(int, boolean)
public void setChannelWindow(int w, double start, double end)
RenderingEngine
interface.setChannelWindow
in interface RenderingEngine
w
- The channel index.start
- The lower bound of the interval.end
- The upper bound of the interval.RenderingEngine.setChannelWindow(int, double, double)
public void setCodomainInterval(int start, int end)
RenderingEngine
interface.setCodomainInterval
in interface RenderingEngine
start
- The lower bound of the interval.end
- The upper bound of the interval.RenderingEngine.setCodomainInterval(int, int)
public void setDefaultT(int t)
RenderingEngine
interface.setDefaultT
in interface RenderingEngine
t
- The value to set.RenderingEngine.setDefaultT(int)
public void setDefaultZ(int z)
RenderingEngine
interface.setDefaultZ
in interface RenderingEngine
z
- The value to set.RenderingEngine.setDefaultZ(int)
public void setModel(ome.model.enums.RenderingModel model)
RenderingEngine
interface.setModel
in interface RenderingEngine
model
- Identifies the color space model.RenderingEngine.setModel(RenderingModel)
public void setQuantizationMap(int w, ome.model.enums.Family family, double coefficient, boolean noiseReduction)
RenderingEngine
interface.setQuantizationMap
in interface RenderingEngine
w
- The channel index.family
- The mapping family.coefficient
- The coefficient identifying a curve in the family.noiseReduction
- Pass true
to turn the noise reduction algorithm
on, false
otherwise.RenderingEngine.setQuantizationMap(int, Family, double, boolean)
public void setQuantumStrategy(int bitResolution)
RenderingEngine
interface.setQuantumStrategy
in interface RenderingEngine
bitResolution
- The bit resolution defining associated to the strategy.RenderingEngine.setQuantumStrategy(int)
public void setRGBA(int w, int red, int green, int blue, int alpha)
RenderingEngine
interface.setRGBA
in interface RenderingEngine
w
- The channel index.red
- The red component. A value between 0 and 255.green
- The green component. A value between 0 and 255.blue
- The blue component. A value between 0 and 255.alpha
- The alpha component. A value between 0 and 255.RenderingEngine.setRGBA(int, int, int, int, int)
public boolean isPixelsTypeSigned()
RenderingEngine
interface.isPixelsTypeSigned
in interface RenderingEngine
RenderingEngine.isPixelsTypeSigned()
public double getPixelsTypeLowerBound(int w)
RenderingEngine
interface.getPixelsTypeLowerBound
in interface RenderingEngine
w
- The channel index.RenderingEngine.getPixelsTypeLowerBound(int)
public int getResolutionLevel()
getResolutionLevel
in interface RenderingEngine
public int getResolutionLevels()
getResolutionLevels
in interface RenderingEngine
public List<List<Integer>> getResolutionDescriptions()
getResolutionDescriptions
in interface RenderingEngine
public int[] getTileSize()
getTileSize
in interface RenderingEngine
public boolean requiresPixelsPyramid()
requiresPixelsPyramid
in interface RenderingEngine
public void setResolutionLevel(int resolutionLevel)
setResolutionLevel
in interface RenderingEngine
public double getPixelsTypeUpperBound(int w)
RenderingEngine
interface.getPixelsTypeUpperBound
in interface RenderingEngine
w
- The channel index.RenderingEngine.getPixelsTypeUpperBound(int)
protected void errorIfInvalidState()
protected void errorIfNullPixels()
ApiUsageException
if the pixels are not set.protected void errorIfNullRenderingDef()
ApiUsageException
if the rendering settings are not
set.protected void errorIfNullRenderer()
null
and has been
made passive or throws an ApiUsageException
if the rendering
engine is not set.
Version: 5.1.2-ice35-b45
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.