omeis.providers.re
Interface RenderingEngine

All Superinterfaces:
ServiceInterface, StatefulServiceInterface
All Known Implementing Classes:
RenderingBean

public interface RenderingEngine
extends StatefulServiceInterface

Defines a service to render a given pixels set.

A pixels set is a 5D array that stores the pixels data of an image, that is the pixels intensity values. Every instance of this service is paired up to a pixels set. Use this service to transform planes within the pixels set onto an RGB image.

The RenderingEngine allows to fine-tune the settings that define the transformation context — that is, a specification of how raw pixels data is to be transformed into an image that can be displayed on screen. Those settings are referred to as rendering settings or display options. After tuning those settings it is possible to save them to the metadata repository so that they can be used the next time the pixels set is accessed for rendering; for example by another RenderingEngine instance. Note that the display options are specific to the given pixels set and are experimenter scoped — that is, two different users can specify different display options for the same pixels set. (A RenderingEngine instance takes this into account automatically as it is always bound to a given experimenter.)

This service is thread-safe.

Since:
OME2.2
Version:
2.2 (Internal version: $Revision$ $Date: 2005/06/12 23:28:59 $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk,
Andrea Falconi      a.falconi@dundee.ac.uk

Method Summary
 void addCodomainMap(CodomainMapContext mapCtx)
          Adds the context to the mapping chain.
 List getAvailableFamilies()
          Returns the list of mapping families supported by the Rendering engine.
 List getAvailableModels()
          Returns the list of color models supported by the Rendering engine.
 double getChannelCurveCoefficient(int w)
          Returns the coefficient identifying a map in the family.
 ome.model.enums.Family getChannelFamily(int w)
          Returns the family associated to the specified channel.
 boolean getChannelNoiseReduction(int w)
          Returns true if the noise reduction algorithm used to map the pixels intensity values is turned on, false if the algorithm is turned off.
 double[] getChannelStats(int w)
           
 double getChannelWindowEnd(int w)
          Returns the upper bound of the pixels intensity interval.
 double getChannelWindowStart(int w)
          Returns the lower bound of the pixels intensity interval.
 float getCompressionLevel()
          Returns the current compression level for the service.
 int getDefaultT()
          Returns the default timepoint index.
 int getDefaultZ()
          Returns the index of the default focal section.
 ome.model.enums.RenderingModel getModel()
          Returns the model that dictates how transformed raw data has to be mapped onto a color space.
 ome.model.core.Pixels getPixels()
          Returns the Pixels set the Rendering engine is for.
 double getPixelsTypeLowerBound(int w)
          Returns the minimum value for that channels depending on the pixels type and the original range (globalmax, globalmin)
 double getPixelsTypeUpperBound(int w)
          Returns the maximum value for that channels depending on the pixels type and the original range (globalmax, globalmin)
 ome.model.display.QuantumDef getQuantumDef()
          Returns the quantization object.
 long getRenderingDefId()
          Returns the id of the RederingDef loaded by either lookupRenderingDef(long) or loadRenderingDef(long).
 int getResolutionLevel()
           
 int getResolutionLevels()
           
 int[] getRGBA(int w)
          Returns a 4D-array representing the color associated to the specified channel.
 int[] getTileSize()
           
 boolean isActive(int w)
          Returns true if the channel is mapped, false otherwise.
 boolean isPixelsTypeSigned()
          Returns true if the pixels type is signed, false otherwise.
 void load()
          Creates a instance of the rendering engine.
 void loadRenderingDef(long renderingDefId)
          Loads a specific set of rendering settings that does not necessarily have to be linked to the given Pixels set.
 void lookupPixels(long pixelsId)
          Loads the Pixels set this Rendering Engine is for.
 boolean lookupRenderingDef(long pixelsId)
          Loads the rendering settings associated to the specified pixels set.
 void removeCodomainMap(CodomainMapContext mapCtx)
          Removes the specified context from the chain.
 RGBBuffer render(PlaneDef pd)
          Renders the data selected by pd according to the current rendering settings.
 int[] renderAsPackedInt(PlaneDef pd)
          Renders the data selected by pd according to the current rendering settings.
 int[] renderAsPackedIntAsRGBA(PlaneDef pd)
          Renders the data selected by pd according to the current rendering settings.
 byte[] renderCompressed(PlaneDef pd)
          Renders the data selected by pd according to the current rendering settings and compresses the resulting RGBA composite image.
 int[] renderProjectedAsPackedInt(int algorithm, int timepoint, int stepping, int start, int end)
          Performs a projection through selected optical sections of a particular timepoint with the currently active channels and renders the data for display.
 byte[] renderProjectedCompressed(int algorithm, int timepoint, int stepping, int start, int end)
          Performs a projection through selected optical sections of a particular timepoint with the currently active channels, renders the data for display and compresses the resulting RGBA composite image.
 boolean requiresPixelsPyramid()
           
 void resetDefaults()
          Resets the default settings i.e. the default values internal to the Rendering engine.
 void resetDefaultsNoSave()
          Resets the default settings i.e. the default values internal to the Rendering engine.
 void saveCurrentSettings()
          Saves the current rendering settings in the database.
 void setActive(int w, boolean active)
          Maps the specified channel if true, unmaps the channel otherwise.
 void setChannelWindow(int w, double start, double end)
          Returns the pixels intensity interval.
 void setCodomainInterval(int start, int end)
          Sets the sub-interval of the device space i.e. a discrete sub-interval of [0, 255]
 void setCompressionLevel(float percentage)
          Sets the current compression level for the service.
 void setDefaultT(int t)
          Sets the default timepoint index.
 void setDefaultZ(int z)
          Sets the index of the default focal section.
 void setModel(ome.model.enums.RenderingModel model)
          Specifies the model that dictates how transformed raw data has to be mapped onto a color space.
 void setOverlays(Map<byte[],Integer> overlays)
          Informs the rendering engine that it should render a set of overlays on each rendered frame.
 void setQuantizationMap(int w, ome.model.enums.Family family, double coefficient, boolean noiseReduction)
          Sets the quantization map, one per channel.
 void setQuantumStrategy(int bitResolution)
          Sets the quantization strategy.
 void setResolutionLevel(int resolutionLevel)
           
 void setRGBA(int w, int red, int green, int blue, int alpha)
          Sets the four components composing the color associated to the specified channel.
 void updateCodomainMap(CodomainMapContext mapCtx)
          Updates the specified context.
 
Methods inherited from interface ome.api.StatefulServiceInterface
activate, close, getCurrentEventContext, passivate
 

Method Detail

render

RGBBuffer render(PlaneDef pd)
Renders the data selected by pd according to the current rendering settings. The passed argument selects a plane orthogonal to one of the X, Y, or Z axes. How many wavelengths are rendered and what color model is used depends on the current rendering settings.

Parameters:
pd - Selects a plane orthogonal to one of the X, Y, or Z axes.
Returns:
An RGB image ready to be displayed on screen.
Throws:
ome.conditions.ValidationException - If pd is null.

renderAsPackedInt

int[] renderAsPackedInt(PlaneDef pd)
Renders the data selected by pd according to the current rendering settings. The passed argument selects a plane orthogonal to one of the X, Y, or Z axes. How many wavelengths are rendered and what color model is used depends on the current rendering settings.

Parameters:
pd - Selects a plane orthogonal to one of the X, Y, or Z axes.
Returns:
An RGB image ready to be displayed on screen.
Throws:
ome.conditions.ValidationException - If pd is null.
See Also:
render()

renderAsPackedIntAsRGBA

int[] renderAsPackedIntAsRGBA(PlaneDef pd)
Renders the data selected by pd according to the current rendering settings. The passed argument selects a plane orthogonal to one of the X, Y, or Z axes. How many wavelengths are rendered and what color model is used depends on the current rendering settings.

Parameters:
pd - Selects a plane orthogonal to one of the X, Y, or Z axes.
Returns:
An RGB image ready to be displayed on screen, using packed int in the format RGBA, note that java uses colour format of ARGB.
Throws:
ome.conditions.ValidationException - If pd is null.
See Also:
render()

renderCompressed

byte[] renderCompressed(PlaneDef pd)
Renders the data selected by pd according to the current rendering settings and compresses the resulting RGBA composite image.

Parameters:
pd - Selects a plane orthogonal to one of the X, Y, or Z axes.
Returns:
A compressed RGBA JPEG for display.
Throws:
ome.conditions.ValidationException - If pd is null.
See Also:
render(), renderAsPackedInt()

renderProjectedAsPackedInt

int[] renderProjectedAsPackedInt(int algorithm,
                                 int timepoint,
                                 int stepping,
                                 int start,
                                 int end)
Performs a projection through selected optical sections of a particular timepoint with the currently active channels and renders the data for display.

Parameters:
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.
Returns:
A packed-integer RGBA rendered image of the projected pixels.
Throws:
ome.conditions.ValidationException - Where:
  • algorithm is unknown
  • timepoint is out of range
  • start is out of range
  • end is out of range
  • start > end
See Also:
IPixels#projectPixels()

renderProjectedCompressed

byte[] renderProjectedCompressed(int algorithm,
                                 int timepoint,
                                 int stepping,
                                 int start,
                                 int end)
Performs a projection through selected optical sections of a particular timepoint with the currently active channels, renders the data for display and compresses the resulting RGBA composite image.

Parameters:
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.
Returns:
A compressed RGBA rendered JPEG image of the projected pixels.
Throws:
ome.conditions.ValidationException - Where:
  • algorithm is unknown
  • timepoint is out of range
  • start is out of range
  • end is out of range
  • start > end
See Also:
IPixels#projectPixels()

lookupPixels

void lookupPixels(long pixelsId)
Loads the Pixels set this Rendering Engine is for.

Parameters:
pixelsId - The pixels set ID.

getRenderingDefId

long getRenderingDefId()
Returns the id of the RederingDef loaded by either lookupRenderingDef(long) or loadRenderingDef(long).


lookupRenderingDef

boolean lookupRenderingDef(long pixelsId)
Loads the rendering settings associated to the specified pixels set.

Parameters:
pixelsId - The pixels set ID.
Returns:
true if a RenderingDef exists for the Pixels set, otherwise false.

loadRenderingDef

void loadRenderingDef(long renderingDefId)
Loads a specific set of rendering settings that does not necessarily have to be linked to the given Pixels set. However, the rendering settings must be linked to a compatible Pixels set as defined by .

Parameters:
renderingDefId - The rendering definition ID.
Throws:
ome.conditions.ValidationException - If a RenderingDef does not exist with the ID renderingDefId or if the RenderingDef is incompatible due to differing pixels sets.

setOverlays

void setOverlays(Map<byte[],Integer> overlays)
Informs the rendering engine that it should render a set of overlays on each rendered frame. These are expected to be binary masks.

Parameters:
overlays - Binary mask to color map.

load

void load()
Creates a instance of the rendering engine.


setModel

void setModel(ome.model.enums.RenderingModel model)
Specifies the model that dictates how transformed raw data has to be mapped onto a color space.

Parameters:
model - Identifies the color space model.

getModel

ome.model.enums.RenderingModel getModel()
Returns the model that dictates how transformed raw data has to be mapped onto a color space.

Returns:
See above.

getDefaultZ

int getDefaultZ()
Returns the index of the default focal section.

Returns:
See above.

getDefaultT

int getDefaultT()
Returns the default timepoint index.

Returns:
See above.

setDefaultZ

void setDefaultZ(int z)
Sets the index of the default focal section. This index is used to define a default plane.

Parameters:
z - The value to set.

setDefaultT

void setDefaultT(int t)
Sets the default timepoint index. This index is used to define a default plane.

Parameters:
t - The value to set.

getPixels

ome.model.core.Pixels getPixels()
Returns the Pixels set the Rendering engine is for.

Returns:
See above.

getAvailableModels

List getAvailableModels()
Returns the list of color models supported by the Rendering engine.

Returns:
See above.

getAvailableFamilies

List getAvailableFamilies()
Returns the list of mapping families supported by the Rendering engine.

Returns:
See above.

setQuantumStrategy

void setQuantumStrategy(int bitResolution)
Sets the quantization strategy. The strategy is common to all channels.

Parameters:
bitResolution - The bit resolution defining associated to the strategy.

setCodomainInterval

void setCodomainInterval(int start,
                         int end)
Sets the sub-interval of the device space i.e. a discrete sub-interval of [0, 255]

Parameters:
start - The lower bound of the interval.
end - The upper bound of the interval.

getQuantumDef

ome.model.display.QuantumDef getQuantumDef()
Returns the quantization object.

Returns:
See above.

setQuantizationMap

void setQuantizationMap(int w,
                        ome.model.enums.Family family,
                        double coefficient,
                        boolean noiseReduction)
Sets the quantization map, one per channel.

Parameters:
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.
See Also:
getAvailableFamilies(), getChannelCurveCoefficient(int), getChannelFamily(int), getChannelNoiseReduction(int)

getChannelFamily

ome.model.enums.Family getChannelFamily(int w)
Returns the family associated to the specified channel.

Parameters:
w - The channel index.
Returns:
See above.
See Also:
getAvailableFamilies()

getChannelNoiseReduction

boolean getChannelNoiseReduction(int w)
Returns true if the noise reduction algorithm used to map the pixels intensity values is turned on, false if the algorithm is turned off. Each channel has an algorithm associated to it.

Parameters:
w - The channel index.
Returns:
See above.

getChannelStats

double[] getChannelStats(int w)

getChannelCurveCoefficient

double getChannelCurveCoefficient(int w)
Returns the coefficient identifying a map in the family. Each channel has a map associated to it.

Parameters:
w - The channel index.
Returns:
See above.
See Also:
getChannelFamily(int)

setChannelWindow

void setChannelWindow(int w,
                      double start,
                      double end)
Returns the pixels intensity interval. Each channel has a pixels intensity interval associated to it.

Parameters:
w - The channel index.
start - The lower bound of the interval.
end - The upper bound of the interval.

getChannelWindowStart

double getChannelWindowStart(int w)
Returns the lower bound of the pixels intensity interval. Each channel has a pixels intensity interval associated to it.

Parameters:
w - The channel index.
Returns:
See above.

getChannelWindowEnd

double getChannelWindowEnd(int w)
Returns the upper bound of the pixels intensity interval. Each channel has a pixels intensity interval associated to it.

Parameters:
w - The channel index.
Returns:
See above.

setRGBA

void setRGBA(int w,
             int red,
             int green,
             int blue,
             int alpha)
Sets the four components composing the color associated to the specified channel.

Parameters:
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.

getRGBA

int[] getRGBA(int w)
Returns a 4D-array representing the color associated to the specified channel. The first element corresponds to the red component (value between 0 and 255). The second corresponds to the green component (value between 0 and 255). The third corresponds to the blue component (value between 0 and 255). The fourth corresponds to the alpha component (value between 0 and 255).

Parameters:
w - The channel index.
Returns:
See above

setActive

void setActive(int w,
               boolean active)
Maps the specified channel if true, unmaps the channel otherwise.

Parameters:
w - The channel index.
active - Pass true to map the channel, false otherwise.

isActive

boolean isActive(int w)
Returns true if the channel is mapped, false otherwise.

Parameters:
w - The channel index.
Returns:
See above.

addCodomainMap

void addCodomainMap(CodomainMapContext mapCtx)
Adds the context to the mapping chain. Only one context of the same type can be added to the chain. The codomain transformations are functions from the device space to device space. Each time a new context is added, the second LUT is rebuilt.

Parameters:
mapCtx - The context to add.
See Also:
updateCodomainMap(CodomainMapContext), removeCodomainMap(CodomainMapContext)

updateCodomainMap

void updateCodomainMap(CodomainMapContext mapCtx)
Updates the specified context. The codomain chain already contains the specified context. Each time a new context is updated, the second LUT is rebuilt.

Parameters:
mapCtx - The context to update.
See Also:
addCodomainMap(CodomainMapContext), removeCodomainMap(CodomainMapContext)

removeCodomainMap

void removeCodomainMap(CodomainMapContext mapCtx)
Removes the specified context from the chain. Each time a new context is removed, the second LUT is rebuilt.

Parameters:
mapCtx - The context to remove.
See Also:
addCodomainMap(CodomainMapContext), updateCodomainMap(CodomainMapContext)

saveCurrentSettings

void saveCurrentSettings()
Saves the current rendering settings in the database.


resetDefaults

void resetDefaults()
Resets the default settings i.e. the default values internal to the Rendering engine. The settings will be saved.


resetDefaultsNoSave

void resetDefaultsNoSave()
Resets the default settings i.e. the default values internal to the Rendering engine. In this case, the rendering settings will not be saved.


setCompressionLevel

void setCompressionLevel(float percentage)
Sets the current compression level for the service. (The default is 85%)

Parameters:
percentage - A percentage compression level from 1.00 (100%) to 0.01 (1%).
Throws:
ome.conditions.ValidationException - if the percentage is out of range.
See Also:
ICompress#setCompressionLevel()

getCompressionLevel

float getCompressionLevel()
Returns the current compression level for the service.

Returns:
See above.
See Also:
ICompress#getCompressionLevel()

isPixelsTypeSigned

boolean isPixelsTypeSigned()
Returns true if the pixels type is signed, false otherwise.

Returns:
See above.

getPixelsTypeLowerBound

double getPixelsTypeLowerBound(int w)
Returns the minimum value for that channels depending on the pixels type and the original range (globalmax, globalmin)

Parameters:
w - The channel index.
Returns:
See above.

getPixelsTypeUpperBound

double getPixelsTypeUpperBound(int w)
Returns the maximum value for that channels depending on the pixels type and the original range (globalmax, globalmin)

Parameters:
w - The channel index.
Returns:
See above.

requiresPixelsPyramid

boolean requiresPixelsPyramid()

getResolutionLevels

int getResolutionLevels()

getResolutionLevel

int getResolutionLevel()

setResolutionLevel

void setResolutionLevel(int resolutionLevel)

getTileSize

int[] getTileSize()


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

Copyright © 2009 The University of Dundee. All Rights Reserved.