|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectini.trakem2.persistence.DBObject
ini.trakem2.display.Displayable
ini.trakem2.display.ZDisplayable
ini.trakem2.display.AreaList
public class AreaList
A list of brush painted areas similar to a set of labelfields in Amira. For each layer where painting has been done, there is an entry in the ht_areas HashMap that contains the layer's id as a Long, and a java.awt.geom.Area object. All Area objects are local to this AreaList's AffineTransform.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ini.trakem2.display.Displayable |
---|
Displayable.DataPackage, Displayable.DoEdit, Displayable.DoEdits, Displayable.DoTransforms, Displayable.SliderListener |
Field Summary |
---|
Fields inherited from class ini.trakem2.display.ZDisplayable |
---|
layer_set |
Fields inherited from class ini.trakem2.display.Displayable |
---|
alpha, annotation, at, color, COMPOSITE_ADD, COMPOSITE_COLOR_YCBCR, COMPOSITE_DIFFERENCE, COMPOSITE_MULTIPLY, COMPOSITE_NORMAL, COMPOSITE_SUBTRACT, compositeModes, height, hs_linked, last_color, layer, linked_props, linked_props_origins, locked, props, TAG_ATTR1, TAG_ATTR2, title, visible, width |
Fields inherited from class ini.trakem2.persistence.DBObject |
---|
id, project |
Constructor Summary | |
---|---|
AreaList(Project project,
long id,
java.util.HashMap<java.lang.String,java.lang.String> ht_attributes,
java.util.HashMap<Displayable,java.lang.String> ht_links)
Reconstruct from XML. |
|
AreaList(Project project,
long id,
java.lang.String title,
float width,
float height,
float alpha,
boolean visible,
java.awt.Color color,
boolean locked,
java.util.ArrayList<java.lang.Long> al_ul,
java.awt.geom.AffineTransform at)
Reconstruct from the database. |
|
AreaList(Project project,
java.lang.String title,
double x,
double y)
|
Method Summary | |
---|---|
void |
add(long layer_id,
ij.gui.ShapeRoi roi)
Adds the given ROI, which is expected in world/LayerSet coordinates, to the area present at Layer with id layer_id, or set it if none present yet. |
void |
addArea(long layer_id,
java.awt.geom.Area area)
Add a copy of an Area object to the existing, if any, area object at Layer with layer_id as given, or if not existing, just set the copy as it. |
void |
adjustProperties()
Shows a dialog to adjust properties of this object. |
boolean |
apply(Layer la,
java.awt.geom.Area roi,
mpicbg.models.CoordinateTransform ct)
Applies the 2D transform @ict (which is expected to operate on the world coordinates version of the data contained here) only to the data that falls within the @param roi (in world coords), and then recomputes the bounding box and affine transform (to a translation or identity). |
boolean |
apply(VectorDataTransform vdt)
|
boolean |
calculateBoundingBox(Layer la)
Calculate box, make this width,height be that of the box, and translate all areas to fit in. |
Displayable |
clone(Project pr,
boolean copy_id)
Performs a deep copy of this object, without the links. |
boolean |
contains(Layer layer,
int x,
int y)
Returns whether the point x,y is contained in this object at the given Layer. |
boolean |
crop(java.util.List<Layer> range)
Retain the data within the layer range, and through out all the rest. |
static void |
exportAsLabels(java.util.List<Displayable> list,
ij.gui.Roi roi,
float scale,
int first_layer,
int last_layer,
boolean visible_only,
boolean to_file,
boolean as_amira_labels)
Export all given AreaLists as one per pixel value, what is called a "labels" file; a file dialog is offered to save the image as a tiff stack. |
static void |
exportDTD(java.lang.StringBuilder sb_header,
java.util.HashSet<java.lang.String> hs,
java.lang.String indent)
|
void |
exportXML(java.lang.StringBuilder sb_body,
java.lang.String indent,
java.lang.Object any)
The oid is this objects' id, whereas the 'id' tag will be the id of the wrapper Thing object. |
void |
fillHoles(Layer la)
|
java.util.List<javax.vecmath.Point3f> |
generateTriangles(double scale,
int resample)
|
java.util.HashMap<java.lang.Long,java.util.ArrayList<java.util.ArrayList<java.awt.Point>>> |
getAllPaths()
Returns a table of Long layer ids versus the ArrayList that getPaths(long) returns for it. |
java.awt.geom.Area |
getArea(Layer la)
|
java.awt.geom.Area |
getArea(long layer_id)
|
java.awt.geom.Area |
getAreaAt(Layer layer)
In world coordinates, a copy of the area at . |
java.util.List<java.awt.geom.Area> |
getAreas(Layer layer,
java.awt.Rectangle box)
|
java.awt.Rectangle |
getBounds(java.awt.Rectangle r,
Layer layer)
Returns the bounds of this object as it shows in the given layer. |
Layer |
getFirstLayer()
Returns the layer of lowest Z coordinate Layer where this ZDisplayable has a point in. |
java.lang.String |
getInfo()
Measure the volume (in voxels) of this AreaList, and the surface area, the latter estimated as the number of voxels that make the outline. |
Layer |
getLastLayer()
Returns the layer of highest Z coordinate Layer where this ZDisplayable has a point in. |
java.util.Collection<java.lang.Long> |
getLayerIds()
Get the list of Layer ids on which this ZDisplayable has data on. |
java.util.List<Layer> |
getLayerRange()
Get the range of layers betweeh the first and last layers in which this AreaList paints to. |
int |
getNAreas()
How many layers does this object paint to. |
java.util.ArrayList<java.util.ArrayList<java.awt.Point>> |
getPaths(long layer_id)
Returns an ArrayList of ArrayList of Point as value with all paths for the Area of the given layer_id. |
ij.ImagePlus |
getStack(int type,
double scale)
Returns a stack of images representing the pixel data of this LayerSet inside this AreaList. |
boolean |
interpolate(Layer first,
Layer last,
boolean always_use_distance_map)
Interpolate areas between the given first and last layers, both of which must contain an area. |
boolean |
intersects(java.awt.geom.Area area,
double z_first,
double z_last)
|
boolean |
intersects(Layer layer,
java.awt.geom.Area area)
Calls intersects(area) unless overriden -- intended for ZDisplayable objects to return whether they intersect the given area at the given layer. |
boolean |
intersects(Layer layer,
java.awt.Rectangle r)
|
boolean |
isDeletable()
|
boolean |
isFillPaint()
|
boolean |
isRoughlyInside(Layer layer,
java.awt.Rectangle box)
If this Displayable intersects with @param r or almost intersects, then returns true. |
void |
keyPressed(java.awt.event.KeyEvent ke)
|
protected boolean |
layerRemoved(Layer la)
Update internal datastructures to reflect the fact that @param layer has been removed from the containing LayerSet. |
boolean |
linkPatches()
Link the Patch objects that lay underneath the part of the bounding box of this profile that shows in the current layer, so that they cannot be dragged independently. |
double[] |
measure()
Returns a double array with 0=volume, 1=lower_bound_surface, 2=upper_bound_surface_smoothed, 3=upper_bound_surface, 4=max_diameter, 5=all_tops_and_bottoms All measures are approximate. |
ij.measure.ResultsTable |
measure(ij.measure.ResultsTable rt)
Does nothing unless overriden. |
ij.measure.ResultsTable |
measureAreas(ij.measure.ResultsTable rt)
|
static AreaList |
merge(java.util.ArrayList<Displayable> al)
Merge all arealists contained in the ArrayList to the first one found, and remove the others from the project, and only if they belong to the same LayerSet. |
void |
mouseDragged(java.awt.event.MouseEvent me,
Layer la,
int x_p,
int y_p,
int x_d,
int y_d,
int x_d_old,
int y_d_old)
|
void |
mousePressed(java.awt.event.MouseEvent me,
Layer la,
int x_p_w,
int y_p_w,
double mag)
|
void |
mouseReleased(java.awt.event.MouseEvent me,
Layer la,
int x_p,
int y_p,
int x_d,
int y_d,
int x_r,
int y_r)
|
void |
paint(java.awt.Graphics2D g,
java.awt.Rectangle srcRect,
double magnification,
boolean active,
int channels,
Layer active_layer,
java.util.List<Layer> layers)
|
boolean |
paintsAt(Layer layer)
Check if this instance will paint anything at the level of the given Layer. |
AreaList |
part(long layer_id,
ij.gui.ShapeRoi sroi)
Subtracts the given ROI, and then creates a new AreaList with identical properties and the content of the subtracted part. |
void |
setArea(long layer_id,
java.awt.geom.Area area)
Directly place an Area for the specified layer. |
void |
subtract(long layer_id,
ij.gui.ShapeRoi roi)
Subtracts the given ROI, which is expected in world/LayerSet coordinates, to the area present at Layer with id layer_id, or set it if none present yet. |
void |
transformPoints(Layer layer,
double dx,
double dy,
double rot,
double xo,
double yo)
Transform points falling within the given layer; translate by dx,dy and rotate by rot relative to origin xo,yo |
Methods inherited from class ini.trakem2.display.ZDisplayable |
---|
exportDTD, getBucketable, getLayerSet, remove, remove2, setColor, setLayer, setLayerSet, setLayerSet, setPosition, setVisible, softRemove, updateBucket, updateBucket |
Methods inherited from class ini.trakem2.persistence.DBObject |
---|
addToDatabase, getId, getProject, getUniqueIdentifier, removeFromDatabase, updateInDatabase |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AreaList(Project project, java.lang.String title, double x, double y)
public AreaList(Project project, long id, java.util.HashMap<java.lang.String,java.lang.String> ht_attributes, java.util.HashMap<Displayable,java.lang.String> ht_links)
public AreaList(Project project, long id, java.lang.String title, float width, float height, float alpha, boolean visible, java.awt.Color color, boolean locked, java.util.ArrayList<java.lang.Long> al_ul, java.awt.geom.AffineTransform at)
Method Detail |
---|
public void paint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer, java.util.List<Layer> layers)
paint
in interface Paintable
paint
in class Displayable
public void transformPoints(Layer layer, double dx, double dy, double rot, double xo, double yo)
ZDisplayable
transformPoints
in class ZDisplayable
public Layer getFirstLayer()
getFirstLayer
in class ZDisplayable
public Layer getLastLayer()
public java.util.List<Layer> getLayerRange()
public boolean linkPatches()
ZDisplayable
linkPatches
in class ZDisplayable
public boolean contains(Layer layer, int x, int y)
contains
in class Displayable
public boolean intersects(Layer layer, java.awt.Rectangle r)
intersects
in class Displayable
public boolean intersects(Layer layer, java.awt.geom.Area area)
Displayable
intersects
in class Displayable
public java.awt.Rectangle getBounds(java.awt.Rectangle r, Layer layer)
getBounds
in class Displayable
public boolean isDeletable()
isDeletable
in class Displayable
public void mousePressed(java.awt.event.MouseEvent me, Layer la, int x_p_w, int y_p_w, double mag)
mousePressed
in class Displayable
public void mouseDragged(java.awt.event.MouseEvent me, Layer la, int x_p, int y_p, int x_d, int y_d, int x_d_old, int y_d_old)
mouseDragged
in class Displayable
public void mouseReleased(java.awt.event.MouseEvent me, Layer la, int x_p, int y_p, int x_d, int y_d, int x_r, int y_r)
mouseReleased
in class Displayable
public boolean calculateBoundingBox(Layer la)
calculateBoundingBox
in interface AreaContainer
calculateBoundingBox
in class ZDisplayable
public static void exportDTD(java.lang.StringBuilder sb_header, java.util.HashSet<java.lang.String> hs, java.lang.String indent)
public void exportXML(java.lang.StringBuilder sb_body, java.lang.String indent, java.lang.Object any)
Displayable
exportXML
in class ZDisplayable
public java.util.ArrayList<java.util.ArrayList<java.awt.Point>> getPaths(long layer_id)
public java.util.HashMap<java.lang.Long,java.util.ArrayList<java.util.ArrayList<java.awt.Point>>> getAllPaths()
public void fillHoles(Layer la)
public boolean paintsAt(Layer layer)
ZDisplayable
paintsAt
in class ZDisplayable
public void adjustProperties()
Displayable
adjustProperties
in class Displayable
public boolean isFillPaint()
public static AreaList merge(java.util.ArrayList<Displayable> al)
public int getNAreas()
public java.awt.geom.Area getArea(Layer la)
public java.awt.geom.Area getArea(long layer_id)
public Displayable clone(Project pr, boolean copy_id)
clone
in class Displayable
public java.util.List<javax.vecmath.Point3f> generateTriangles(double scale, int resample)
public void setArea(long layer_id, java.awt.geom.Area area)
public void addArea(long layer_id, java.awt.geom.Area area)
public void add(long layer_id, ij.gui.ShapeRoi roi) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public void subtract(long layer_id, ij.gui.ShapeRoi roi) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public AreaList part(long layer_id, ij.gui.ShapeRoi sroi) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in class Displayable
public java.lang.String getInfo()
getInfo
in class DBObject
public boolean intersects(java.awt.geom.Area area, double z_first, double z_last)
intersects
in class ZDisplayable
area
- is expected in world coordinates.public static void exportAsLabels(java.util.List<Displayable> list, ij.gui.Roi roi, float scale, int first_layer, int last_layer, boolean visible_only, boolean to_file, boolean as_amira_labels)
public ij.measure.ResultsTable measure(ij.measure.ResultsTable rt)
Displayable
measure
in class Displayable
public double[] measure()
public boolean crop(java.util.List<Layer> range)
crop
in class ZDisplayable
public ij.ImagePlus getStack(int type, double scale)
public java.util.List<java.awt.geom.Area> getAreas(Layer layer, java.awt.Rectangle box)
getAreas
in interface AreaContainer
protected boolean layerRemoved(Layer la)
ZDisplayable
layerRemoved
in class ZDisplayable
public boolean apply(Layer la, java.awt.geom.Area roi, mpicbg.models.CoordinateTransform ct) throws java.lang.Exception
VectorData
apply
in interface VectorData
la
- Only data at this Layer may be transformed.roi
- Only data inside this world-coordinates Area may be transformed.ct
- The transform to apply to the data that is in @param la and within @param roi.
java.lang.Exception
public boolean apply(VectorDataTransform vdt) throws java.lang.Exception
apply
in interface VectorData
java.lang.Exception
public java.util.Collection<java.lang.Long> getLayerIds()
ZDisplayable
getLayerIds
in class ZDisplayable
public java.awt.geom.Area getAreaAt(Layer layer)
getAreaAt
in class Displayable
public boolean isRoughlyInside(Layer layer, java.awt.Rectangle box)
Displayable
isRoughlyInside
in class Displayable
public ij.measure.ResultsTable measureAreas(ij.measure.ResultsTable rt)
measureAreas
in interface AreaContainer
public boolean interpolate(Layer first, Layer last, boolean always_use_distance_map) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |