public class AreaList extends ZDisplayable implements AreaContainer, VectorData
Displayable.DataPackage, Displayable.DoEdit, Displayable.DoEdits, Displayable.DoTransforms, Displayable.SliderListenerlayer_setalpha, 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| Constructor and Description |
|---|
AreaList(Project project,
long id,
HashMap<String,String> ht_attributes,
HashMap<Displayable,String> ht_links)
Reconstruct from XML.
|
AreaList(Project project,
long id,
String title,
float width,
float height,
float alpha,
boolean visible,
Color color,
boolean locked,
ArrayList<Long> al_ul,
AffineTransform at)
Reconstruct from the database.
|
AreaList(Project project,
String title,
double x,
double y) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long layer_id,
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,
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,
Area roi,
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,
double x,
double y)
Returns whether the point x,y is contained in this object at the given Layer.
|
boolean |
crop(List<Layer> range)
Retain the data within the layer range, and through out all the rest.
|
static void |
exportAsLabels(List<Displayable> listToPaint,
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(StringBuilder sb_header,
HashSet<String> hs,
String indent) |
void |
exportXML(StringBuilder sb_body,
String indent,
XMLOptions options)
The oid is this objects' id, whereas the 'id' tag will be the id of the wrapper Thing object.
|
void |
fillHoles(Layer la) |
List<Point3f> |
generateTriangles(double scale,
int resample) |
HashMap<Long,ArrayList<ArrayList<Point>>> |
getAllPaths()
Returns a table of Long layer ids versus the ArrayList that getPaths(long) returns for it.
|
Area |
getArea(Layer la) |
Area |
getArea(long layer_id) |
Area |
getAreaAt(Layer layer)
In world coordinates, a copy of the area at
layer. |
List<Area> |
getAreas(Layer layer,
Rectangle box) |
Rectangle |
getBounds(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.
|
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.
|
Collection<Long> |
getLayerIds()
Get the list of Layer ids on which this ZDisplayable has data on.
|
List<Layer> |
getLayerRange()
Get the range of layers between the first and last layers in which this AreaList paints to.
|
int |
getNAreas()
How many layers does this object paint to.
|
ArrayList<ArrayList<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(Area area,
double z_first,
double z_last) |
boolean |
intersects(Layer layer,
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,
Rectangle r) |
boolean |
isDeletable() |
boolean |
isFillPaint() |
boolean |
isRoughlyInside(Layer layer,
Rectangle box)
If this Displayable intersects with @param r or almost intersects, then returns true.
|
void |
keyPressed(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(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(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(MouseEvent me,
Layer la,
int x_p_w,
int y_p_w,
double mag) |
void |
mouseReleased(MouseEvent me,
Layer la,
int x_p,
int y_p,
int x_d,
int y_d,
int x_r,
int y_r) |
void |
paint(Graphics2D g,
Rectangle srcRect,
double magnification,
boolean active,
int channels,
Layer active_layer,
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,
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,
Area area)
Directly place an Area for the specified layer.
|
static ArrayList<AreaList> |
split(List<Displayable> al)
For each AreaList in the list, find disconnected volumes within each and make an AreaList out of each.
|
void |
subtract(long layer_id,
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
|
exportDTD, getBucketable, getLayerSet, remove, remove2, setColor, setLayer, setLayerSet, setLayerSet, setVisible, softRemove, updateBucket, updateBucketareThereLayerCrossLinks, canSendTo, clone, clone, commonDTDChildren, contains, deselect, destroy, displacePoints, exportSVG, findById, findNearestPoint, findNearestPoint, getAffineTransform, getAffineTransformCopy, getAlpha, getAnnotation, getArea, getAreaForBucket, getBoundingBox, getBoundingBox, getBoundingBox, getBounds, getColor, getComposite, getComposite, getCompositeMode, getHeight, getIntersection, getLayer, getLayersWithData, getLinked, getLinked, getLinkedBox, getLinkedGroup, getLinkedProperties, getLinkedProperties, getLinkedProperty, getLinkedProperty, getMinimalBoundingBox, getNameId, getPerimeter, getPerimeter, getProperties, getProperty, getProperty, getShortTitle, getTitle, getWidth, getX, getXMLSafeValue, getXMLSafeValue, getY, hasLinkedGroupWithinLayer, hasProperties, intersects, intersects, inverseTransformPoint, isLinked, isLinked, isLinked, isLocked, isLocked2, isOnlyLinkedTo, isOnlyLinkedTo, isOutOfRepaintingClip, isOutOfRepaintingClip, isVisible, link, link, makeAdjustPropertiesDialog, mouseWheelMoved, paintAsBox, paintOffscreen, paintSnapshot, preConcatenate, prePaint, preTransform, processAdjustPropertiesDialog, removeLinkedProperties, removeLinkedPropertiesFromOrigins, repaint, restXML, rotate, rotate, rotatePoints, scale, scale, scalePoints, setAffineTransform, setAlpha, setAlpha, setAnnotation, setCompositeMode, setDimensions, setDimensions, setLayer, setLinkedProperties, setLinkedProperty, setLocation, setLocked, setProperty, setTitle, setVisible, snapTo, toString, transform, transformPoint, transformPoint, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformPoints, transformRectangle, translate, translate, unlink, unlink, unlinkAll, updateInDatabase, xmlError, xmlErroraddToDatabase, getId, getProject, getUniqueIdentifier, removeFromDatabase, updateInDatabasepublic AreaList(Project project, long id, HashMap<String,String> ht_attributes, HashMap<Displayable,String> ht_links)
public void paint(Graphics2D g, Rectangle srcRect, double magnification, boolean active, int channels, Layer active_layer, List<Layer> layers)
paint in interface Paintablepaint in class Displayablepublic void transformPoints(Layer layer, double dx, double dy, double rot, double xo, double yo)
ZDisplayabletransformPoints in class ZDisplayablepublic Layer getFirstLayer()
getFirstLayer in class ZDisplayablepublic Layer getLastLayer()
public List<Layer> getLayerRange()
public boolean linkPatches()
ZDisplayablelinkPatches in class ZDisplayablepublic boolean contains(Layer layer, double x, double y)
contains in class Displayablepublic boolean intersects(Layer layer, Rectangle r)
intersects in class Displayablepublic boolean intersects(Layer layer, Area area)
Displayableintersects in class Displayablepublic Rectangle getBounds(Rectangle r, Layer layer)
getBounds in class Displayablepublic boolean isDeletable()
isDeletable in class Displayablepublic void mousePressed(MouseEvent me, Layer la, int x_p_w, int y_p_w, double mag)
mousePressed in class Displayablepublic void mouseDragged(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 Displayablepublic void mouseReleased(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 Displayablepublic boolean calculateBoundingBox(Layer la)
calculateBoundingBox in interface AreaContainercalculateBoundingBox in class ZDisplayablela - is the currently active Layer.public static void exportDTD(StringBuilder sb_header, HashSet<String> hs, String indent)
public void exportXML(StringBuilder sb_body, String indent, XMLOptions options)
DisplayableexportXML in class ZDisplayablepublic ArrayList<ArrayList<Point>> getPaths(long layer_id)
public HashMap<Long,ArrayList<ArrayList<Point>>> getAllPaths()
public void fillHoles(Layer la)
public boolean paintsAt(Layer layer)
ZDisplayablepaintsAt in class ZDisplayablepublic void adjustProperties()
DisplayableadjustProperties in class Displayablepublic boolean isFillPaint()
public static AreaList merge(ArrayList<Displayable> al)
public static ArrayList<AreaList> split(List<Displayable> al) throws Exception
al - The list of AreaList to split.Exceptionpublic int getNAreas()
public Area getArea(long layer_id)
public Displayable clone(Project pr, boolean copy_id)
clone in class Displayablepublic void setArea(long layer_id,
Area area)
public void addArea(long layer_id,
Area area)
public void add(long layer_id,
ShapeRoi roi)
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic void subtract(long layer_id,
ShapeRoi roi)
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic AreaList part(long layer_id, ShapeRoi sroi) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic void keyPressed(KeyEvent ke)
keyPressed in class Displayablepublic String getInfo()
public boolean intersects(Area area, double z_first, double z_last)
intersects in class ZDisplayablearea - is expected in world coordinates.public static void exportAsLabels(List<Displayable> listToPaint, 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)
Displayablemeasure in class Displayablepublic double[] measure()
public boolean crop(List<Layer> range)
crop in class ZDisplayablepublic ij.ImagePlus getStack(int type,
double scale)
public List<Area> getAreas(Layer layer, Rectangle box)
getAreas in interface AreaContainerprotected boolean layerRemoved(Layer la)
ZDisplayablelayerRemoved in class ZDisplayablepublic boolean apply(Layer la, Area roi, CoordinateTransform ct) throws Exception
VectorDataapply in interface VectorDatala - 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.Exceptionpublic boolean apply(VectorDataTransform vdt) throws Exception
apply in interface VectorDataExceptionpublic Collection<Long> getLayerIds()
ZDisplayablegetLayerIds in class ZDisplayablepublic Area getAreaAt(Layer layer)
layer. May be null.getAreaAt in class Displayablepublic boolean isRoughlyInside(Layer layer, Rectangle box)
DisplayableisRoughlyInside in class Displayablepublic ij.measure.ResultsTable measureAreas(ij.measure.ResultsTable rt)
measureAreas in interface AreaContainerCopyright © 2015–2021 Fiji. All rights reserved.