Modifier and Type | Field and Description |
---|---|
(package private) ClusterOrderResult<D> |
co
The result to plot
|
(package private) OPTICSColorAdapter |
colors
Color adapter to use
|
(package private) OPTICSDistanceAdapter<D> |
distanceAdapter
The mapping from cluster order entry to value
|
(package private) int |
height
Height of plot
|
private static String |
IMGFILEPREFIX
Prefix for filenames
|
protected static Logging |
logger
Logger
|
protected RenderedImage |
plot
The Optics plot.
|
(package private) LinearScale |
scale
Scale to use
|
protected File |
tempFile
The plot saved to a temp file.
|
(package private) int |
width
Width of plot
|
Constructor and Description |
---|
OPTICSPlot(ClusterOrderResult<D> co,
OPTICSColorAdapter colors)
Constructor, with automatic distance adapter detection.
|
OPTICSPlot(ClusterOrderResult<D> co,
OPTICSColorAdapter colors,
OPTICSDistanceAdapter<D> distanceAdapter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static <D extends Distance<D>> |
canPlot(ClusterOrderResult<D> co)
Test whether this class can produce an OPTICS plot for the given cluster
order.
|
protected LinearScale |
computeScale(List<ClusterOrderEntry<D>> order)
Compute the scale (value range)
|
void |
forgetRenderedImage()
Free memory used by rendered image.
|
private static <D extends Distance<D>> |
getAdapterForDistance(ClusterOrderResult<D> co)
Try to find a distance adapter.
|
File |
getAsTempFile()
Get a temporary file for the optics plot.
|
ClusterOrderResult<D> |
getClusterOrder()
Get the cluster order we are attached to.
|
OPTICSDistanceAdapter<D> |
getDistanceAdapter()
Get the distance adapter-
|
int |
getHeight() |
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
RenderedImage |
getPlot()
Get the OPTICS plot.
|
double |
getRatio()
Get width-to-height ratio of image.
|
LinearScale |
getScale() |
String |
getShortName()
A short name for the result, useful for file names.
|
int |
getWidth() |
static <D extends Distance<D>> |
plotForClusterOrder(ClusterOrderResult<D> co,
VisualizerContext context)
Static method to find an optics plot for a result,
or to create a new one using the given context.
|
void |
replot()
Trigger a redraw of the OPTICS plot
|
protected static final Logging logger
private static final String IMGFILEPREFIX
LinearScale scale
int width
int height
final ClusterOrderResult<D extends Distance<D>> co
final OPTICSColorAdapter colors
final OPTICSDistanceAdapter<D extends Distance<D>> distanceAdapter
protected RenderedImage plot
protected File tempFile
public OPTICSPlot(ClusterOrderResult<D> co, OPTICSColorAdapter colors, OPTICSDistanceAdapter<D> distanceAdapter)
co
- Cluster order to plot.colors
- Coloring strategydistanceAdapter
- Distance adapterpublic OPTICSPlot(ClusterOrderResult<D> co, OPTICSColorAdapter colors)
co
- Cluster order to plot.colors
- Coloring strategyprivate static <D extends Distance<D>> OPTICSDistanceAdapter<D> getAdapterForDistance(ClusterOrderResult<D> co)
D
- distance typeco
- ClusterOrderResultpublic static <D extends Distance<D>> boolean canPlot(ClusterOrderResult<D> co)
D
- Distance typeco
- Cluster order resultpublic void replot()
protected LinearScale computeScale(List<ClusterOrderEntry<D>> order)
order
- Cluster order to processpublic LinearScale getScale()
public int getWidth()
public int getHeight()
public double getRatio()
width / height
public RenderedImage getPlot()
public OPTICSDistanceAdapter<D> getDistanceAdapter()
public File getAsTempFile() throws IOException
IOException
public void forgetRenderedImage()
public String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result
public static <D extends Distance<D>> OPTICSPlot<D> plotForClusterOrder(ClusterOrderResult<D> co, VisualizerContext context)
D
- Distance typeco
- Cluster ordercontext
- Context (for colors and reference clustering)public ClusterOrderResult<D> getClusterOrder()