public class Viewer2D extends TreeColorMapper
Tree
s as 2D plots that can be exported as SVG,
PNG or PDF.Modifier and Type | Field and Description |
---|---|
protected net.imagej.plot.XYPlot |
plot |
AVG_SPINE_DENSITY, LENGTH, MEAN_RADIUS, N_BRANCH_POINTS, N_NODES, N_SPINES, NODE_RADIUS, PATH_DISTANCE, PATH_FRAME, PATH_ORDER, paths, SHOLL_COUNTS, STRAHLER_NUMBER, TAG_FILENAME, VALUES, X_COORDINATES, Y_COORDINATES, Z_COORDINATES
colorTable, integerScale, max, min
Constructor and Description |
---|
Viewer2D()
Instantiates an empty 2D viewer.
|
Viewer2D(Context context)
Instantiates an empty 2D viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(List<Tree> trees,
String lut)
Adds a list of trees while assigning each tree to a LUT index.
|
void |
add(Tree tree)
Appends a tree to the viewer using default options.
|
void |
add(Tree tree,
ColorRGB color)
Appends a tree to the viewer.
|
void |
add(Tree tree,
String color)
Appends a tree to the viewer.
|
void |
add(Tree tree,
String measurement,
ColorTable colorTable,
double min,
double max)
Appends a tree to the viewer rendered after the specified measurement.
|
void |
add(Tree tree,
String measurement,
String lut)
Appends a tree to the viewer rendered after the specified measurement.
|
void |
add(Tree tree,
String measurement,
String lut,
double min,
double max)
Appends a tree to the viewer rendered after the specified measurement.
|
void |
addColorBarLegend()
Adds a color bar legend (LUT ramp) to the viewer.
|
void |
addColorBarLegend(ColorTable colorTable,
double min,
double max)
Adds a color bar legend (LUT ramp).
|
protected void |
addColorBarLegend(String colorTable,
double min,
double max) |
<T extends ColorMapper> |
addColorBarLegend(T colorMapper)
Adds a color bar legend (LUT ramp) from a
ColorMapper . |
void |
addPolygon(Polygon2D poly,
String label) |
void |
addTree(Tree tree)
Deprecated.
Use
add(Tree) instead |
SNTChart |
getChart()
Gets the current viewer as a
SNTChart object |
JFreeChart |
getJFreeChart()
Gets the current viewer as a
JFreeChart object |
protected PaintScaleLegend |
getPaintScaleLegend(ColorTable colorTable,
double min,
double max) |
protected PaintScaleLegend |
getPaintScaleLegend(String colorTable,
double min,
double max) |
net.imagej.plot.XYPlot |
getPlot(boolean show)
Gets the current plot as a
XYPlot object |
String |
getTitle()
Gets the plot display title.
|
static void |
main(String... args) |
void |
setAxesVisible(boolean visible) |
void |
setDefaultColor(ColorRGB color)
Sets the default (fallback) color for plotting paths.
|
void |
setGridlinesVisible(boolean visible) |
void |
setOutlineVisible(boolean visible) |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the plot to a constant value.
|
void |
setTitle(String title)
Sets the plot display title.
|
void |
show()
Displays the current plot on a dedicated frame
|
void |
showPlot()
Deprecated.
Use
show() instead. |
getAvailableLuts, getColorTable, getMetrics, getMultiViewer, getNormalizedMeasurement, map, map, map, map, mapToProperty, mapTrees, tryReallyHardToGuessMetric
getColor, getColorRGB, getColorTable, getMinMax, map, setMinMax
protected net.imagej.plot.XYPlot plot
public Viewer2D()
public Viewer2D(Context context)
context
- the SciJava application context providing the services
required by the viewer.protected void addColorBarLegend(String colorTable, double min, double max)
public void addColorBarLegend(ColorTable colorTable, double min, double max)
colorTable
- the color tablemin
- the minimum value in the color tablemax
- the maximum value in the color tablepublic <T extends ColorMapper> void addColorBarLegend(T colorMapper)
ColorMapper
.colorMapper
- the class extending ColorMapper (TreeColorMapper
, etc.)public void addColorBarLegend()
protected PaintScaleLegend getPaintScaleLegend(String colorTable, double min, double max)
protected PaintScaleLegend getPaintScaleLegend(ColorTable colorTable, double min, double max)
@Deprecated public void addTree(Tree tree)
add(Tree)
insteadtree
- the Collection of paths to be plottedpublic void add(Tree tree)
tree
- the Collection of paths to be plottedpublic void add(List<Tree> trees, String lut)
trees
- the list of trees to be plottedlut
- the lookup table specifying the color mappingpublic void add(Tree tree, ColorRGB color)
tree
- the Collection of paths to be plottedcolor
- the color to render the Treepublic void add(Tree tree, String color)
tree
- the Collection of paths to be plottedcolor
- a string representation of the color to render the Treepublic void add(Tree tree, String measurement, ColorTable colorTable, double min, double max)
tree
- the tree to be plottedmeasurement
- the measurement (TreeColorMapper.PATH_ORDER
}TreeColorMapper.LENGTH
,
etc.)colorTable
- the color table specifying the color mappingmin
- the mapping lower bound (i.e., the highest measurement value for
the LUT scale)max
- the mapping upper bound (i.e., the highest measurement value for
the LUT scale)public void add(Tree tree, String measurement, String lut)
tree
- the tree to be plottedmeasurement
- the measurement (TreeColorMapper.PATH_ORDER
}TreeColorMapper.LENGTH
,
etc.)lut
- the lookup table specifying the color mappingpublic void add(Tree tree, String measurement, String lut, double min, double max)
tree
- the tree to be plottedmeasurement
- the measurement (TreeColorMapper.PATH_ORDER
}TreeColorMapper.LENGTH
,
etc.)lut
- the lookup table specifying the color mappingmin
- the mapping lower bound (i.e., the highest measurement value for
the LUT scale)max
- the mapping upper bound (i.e., the highest measurement value for
the LUT scale)public JFreeChart getJFreeChart()
JFreeChart
objectpublic SNTChart getChart()
SNTChart
objectpublic net.imagej.plot.XYPlot getPlot(boolean show)
XYPlot
objectshow
- if true, plot is displayedpublic void setDefaultColor(ColorRGB color)
color
- null not allowedpublic void setPreferredSize(int width, int height)
width
- the preferred widthheight
- the preferred heightpublic void setTitle(String title)
title
- the new titlepublic String getTitle()
@Deprecated public void showPlot()
show()
instead.public void show()
public void setGridlinesVisible(boolean visible)
public void setAxesVisible(boolean visible)
public void setOutlineVisible(boolean visible)
public static void main(String... args)
Copyright © 2015–2021 Fiji. All rights reserved.