ini.trakem2.utils
Class AreaUtils

java.lang.Object
  extended by ini.trakem2.utils.AreaUtils

public final class AreaUtils
extends java.lang.Object


Field Summary
static java.lang.String always_interpolate_areas_with_distance_map
          Project property key.
 
Method Summary
static java.util.Map<java.lang.Float,java.awt.geom.Area> extractAreas(ij.process.ImageProcessor ip)
          Extracts all non-background areas.
static java.util.Map<java.lang.Float,java.awt.geom.Area> extractAreas(ij.process.ImageProcessor ip, java.util.HashMap<java.lang.Float,java.awt.geom.Area> map_, boolean add_background, java.awt.Rectangle box_, java.lang.Thread parent, boolean report)
          Scan line-wise for all areas, returning a Map of area pixel values in @param ip vs.
static java.util.List<javax.vecmath.Point3f> generateTriangles(Displayable d, double scale, int resample_, java.util.Map<Layer,java.awt.geom.Area> areas)
          Expects areas in local coordinates to the Displayable @param d.
static java.awt.geom.Area[] manyToManyInterpolation(java.awt.geom.Area a1, java.awt.geom.Area a2, int nInterpolates)
           
static java.awt.geom.Area[] singularInterpolation(java.awt.geom.Area a1, java.awt.geom.Area a2, int nInterpolates)
          Interpolate areas only if they are made of a single shape each.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

always_interpolate_areas_with_distance_map

public static final java.lang.String always_interpolate_areas_with_distance_map
Project property key.

See Also:
Constant Field Values
Method Detail

generateTriangles

public static java.util.List<javax.vecmath.Point3f> generateTriangles(Displayable d,
                                                                      double scale,
                                                                      int resample_,
                                                                      java.util.Map<Layer,java.awt.geom.Area> areas)
Expects areas in local coordinates to the Displayable @param d.

Parameters:
scale - The scaling of the entire universe, to limit the overall box
resample - The optimization parameter for marching cubes (i.e. a value of 2 will scale down to half, then apply marching cubes, then scale up by 2 the vertices coordinates).
Returns:
The List of triangles involved, specified as three consecutive vertices. A list of Point3f vertices.

extractAreas

public static final java.util.Map<java.lang.Float,java.awt.geom.Area> extractAreas(ij.process.ImageProcessor ip)
Extracts all non-background areas.


extractAreas

public static final java.util.Map<java.lang.Float,java.awt.geom.Area> extractAreas(ij.process.ImageProcessor ip,
                                                                                   java.util.HashMap<java.lang.Float,java.awt.geom.Area> map_,
                                                                                   boolean add_background,
                                                                                   java.awt.Rectangle box_,
                                                                                   java.lang.Thread parent,
                                                                                   boolean report)
Scan line-wise for all areas, returning a Map of area pixel values in @param ip vs. Area instances. If @param map_ is not null, it puts the areas there and returns it. If @param box_ is not null, it uses it as the unit pixel area. To make any sense, it must be setup as Rectangle(0,0,1,1). If @param report is true, it will report progress every 100 lines.


singularInterpolation

public static final java.awt.geom.Area[] singularInterpolation(java.awt.geom.Area a1,
                                                               java.awt.geom.Area a2,
                                                               int nInterpolates)
                                                        throws java.lang.Exception
Interpolate areas only if they are made of a single shape each. Assumes that areas are in the same coordinate system.

Throws:
java.lang.Exception

manyToManyInterpolation

public static final java.awt.geom.Area[] manyToManyInterpolation(java.awt.geom.Area a1,
                                                                 java.awt.geom.Area a2,
                                                                 int nInterpolates)
                                                          throws java.lang.InterruptedException,
                                                                 java.util.concurrent.ExecutionException
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException