public class BooleanMask3D extends java.lang.Object implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
Rectangle3D.Integer |
bounds
Region represented by the mask.
|
java.util.TreeMap<java.lang.Integer,BooleanMask2D> |
mask
Boolean mask 2D array.
|
Constructor and Description |
---|
BooleanMask3D() |
BooleanMask3D(Point3D.Integer[] points)
Build a new 3D boolean mask from the specified array of
Point3D . |
BooleanMask3D(Point3D[] points)
Build a new boolean mask from the specified array of
Point3D . |
BooleanMask3D(Rectangle3D.Integer bounds,
BooleanMask2D[] mask)
Build a new 3D boolean mask with specified bounds and 2D mask array.
|
BooleanMask3D(Rectangle3D.Integer bounds,
java.util.TreeMap<java.lang.Integer,BooleanMask2D> mask) |
BooleanMask3D(java.util.TreeMap<java.lang.Integer,BooleanMask2D> mask) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
contains(BooleanMask2D booleanMask,
int z)
Return true if mask contains the specified 2D mask at position Z.
|
boolean |
contains(BooleanMask3D booleanMask)
Return true if mask contains the specified 3D mask.
|
boolean |
contains(int x,
int y,
int z)
Return true if mask contains the specified point
|
BooleanMask3D |
downscale()
Fast 2x down scaling (each 2x2x2 block points become 1 point).
|
static BooleanMask3D |
downscale(BooleanMask3D mask)
Fast 2x down scaling (each 2x2x2 block points become 1 point).
|
static BooleanMask3D |
downscale(BooleanMask3D mask,
int nbPointForTrue)
Fast 2x down scaling (each 2x2x2 block points become 1 point).
|
BooleanMask3D |
downscale(int nbPointForTrue)
Fast 2x down scaling (each 2x2x2 block points become 1 point).
|
BooleanMask3D |
downscale2D()
Fast 2x down scaling (each 2x2 block points become 1 point).
|
static BooleanMask3D |
downscale2D(BooleanMask3D mask)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
static BooleanMask3D |
downscale2D(BooleanMask3D mask,
int nbPointForTrue)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
BooleanMask3D |
downscale2D(int nbPointForTrue)
Fast 2x down scaling (each 2x2 block points become 1 point).
|
double |
getContourLength()
Computes and returns the length of the contour.
|
Point3D.Integer[] |
getContourPoints()
Return an array of
Point3D.Integer containing the contour/surface
points of the 3D mask. |
int[] |
getContourPointsAsIntArray()
Return an array of integer containing the contour/surface points of the 3D mask.
|
static BooleanMask3D |
getExclusiveUnion(BooleanMask3D mask1,
BooleanMask3D mask2)
Build resulting mask from exclusive union of the mask1 and mask2:
mask1 xor mask2 = result
################ ################
############## ############## ## ##
############ ############ #### ####
########## ########## ###### ######
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
static BooleanMask3D |
getIntersection(BooleanMask3D mask1,
BooleanMask3D mask2)
Build resulting mask from intersection of the mask1 and mask2:
mask1 intersect mask2 = result
################ ################ ################
############## ############## ############
############ ############ ########
########## ########## ####
######## ########
###### ######
#### ####
## ##
|
BooleanMask2D |
getMask2D(int z)
Returns the 2D boolean mask for the specified Z position
|
int |
getNumberOfPoints()
Return the number of points contained in this boolean mask.
|
Rectangle3D.Integer |
getOptimizedBounds()
Optimize mask bounds so it fits mask content.
|
Rectangle3D.Integer |
getOptimizedBounds(boolean compute2DBounds)
Optimize mask bounds so it fits mask content.
|
Point3D.Integer[] |
getPoints()
Return an array of
Point3D.Integer representing all points of the
current 3D mask. |
int[] |
getPointsAsIntArray()
Return an array of integer representing all points of the current 3D mask.
|
static BooleanMask3D |
getSubtraction(BooleanMask3D mask1,
BooleanMask3D mask2)
Build resulting mask from the subtraction of mask2 from mask1:
mask1 - mask2 = result
################ ################
############## ############## ##
############ ############ ####
########## ########## ######
######## ######## ########
###### ###### ######
#### #### ####
## ## ##
|
static BooleanMask3D |
getUnion(BooleanMask3D mask1,
BooleanMask3D mask2)
Build resulting mask from union of the mask1 and mask2:
mask1 + mask2 = result
################ ################ ################
############## ############## ################
############ ############ ################
########## ########## ################
######## ######## ################
###### ###### ###### ######
#### #### #### ####
## ## ## ##
|
boolean |
intersects(BooleanMask2D booleanMask,
int z)
Return true if mask intersects (contains at least one point) the specified 2D mask at
position Z.
|
boolean |
intersects(BooleanMask3D booleanMask)
Return true if mask intersects (contains at least one point) the specified 3D mask region.
|
boolean |
isEmpty()
Return
true if boolean mask is empty |
void |
moveBounds(Rectangle3D.Integer value)
Change the bounds of BooleanMask.
|
void |
optimizeBounds()
Optimize mask bounds so it fits mask content.
|
static int[] |
toInt3D(int[] source2D,
int z)
Transforms the specified 3D coordinates int array [x,y,z] in 4D coordinates int array [x,y,z,t] with the
specified T value.
|
BooleanMask3D |
upscale()
Fast 2x up scaling (each point become 2x2x2 bloc point).
|
static BooleanMask3D |
upscale(BooleanMask3D mask)
Fast 2x up scaling (each point become 2x2x2 bloc points).
|
BooleanMask3D |
upscale2D()
Fast 2x up scaling (each point become 2x2 bloc point).
|
static BooleanMask3D |
upscale2D(BooleanMask3D mask)
Fast 2x up scaling (each point become 2x2 bloc points).
|
public Rectangle3D.Integer bounds
public final java.util.TreeMap<java.lang.Integer,BooleanMask2D> mask
public BooleanMask3D(Rectangle3D.Integer bounds, java.util.TreeMap<java.lang.Integer,BooleanMask2D> mask)
public BooleanMask3D(java.util.TreeMap<java.lang.Integer,BooleanMask2D> mask)
public BooleanMask3D(Rectangle3D.Integer bounds, BooleanMask2D[] mask)
bounds.getSizeZ()
.public BooleanMask3D(Point3D.Integer[] points)
Point3D
.public BooleanMask3D(Point3D[] points)
Point3D
.public BooleanMask3D()
public static BooleanMask3D getUnion(BooleanMask3D mask1, BooleanMask3D mask2)
mask1 + mask2 = result ################ ################ ################ ############## ############## ################ ############ ############ ################ ########## ########## ################ ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public static BooleanMask3D getIntersection(BooleanMask3D mask1, BooleanMask3D mask2)
mask1 intersect mask2 = result ################ ################ ################ ############## ############## ############ ############ ############ ######## ########## ########## #### ######## ######## ###### ###### #### #### ## ##
public static BooleanMask3D getExclusiveUnion(BooleanMask3D mask1, BooleanMask3D mask2)
mask1 xor mask2 = result ################ ################ ############## ############## ## ## ############ ############ #### #### ########## ########## ###### ###### ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
public static BooleanMask3D getSubtraction(BooleanMask3D mask1, BooleanMask3D mask2)
mask1 - mask2 = result ################ ################ ############## ############## ## ############ ############ #### ########## ########## ###### ######## ######## ######## ###### ###### ###### #### #### #### ## ## ##
public static BooleanMask3D upscale(BooleanMask3D mask)
public static BooleanMask3D downscale(BooleanMask3D mask, int nbPointForTrue)
mask
- the boolean mask to downloadnbPointForTrue
- the minimum number of true
points from a 2x2x2 block to give a true
resulting
point.public static BooleanMask3D downscale(BooleanMask3D mask)
public static BooleanMask3D upscale2D(BooleanMask3D mask)
public static BooleanMask3D downscale2D(BooleanMask3D mask, int nbPointForTrue)
mask
- the boolean mask to downloadnbPointForTrue
- the minimum number of true
points from a 2x2 block to give a true
resulting
point.public static BooleanMask3D downscale2D(BooleanMask3D mask)
public BooleanMask2D getMask2D(int z)
public boolean isEmpty()
true
if boolean mask is emptypublic boolean contains(int x, int y, int z)
public boolean contains(BooleanMask2D booleanMask, int z)
public boolean contains(BooleanMask3D booleanMask)
public boolean intersects(BooleanMask2D booleanMask, int z)
public boolean intersects(BooleanMask3D booleanMask)
public Rectangle3D.Integer getOptimizedBounds(boolean compute2DBounds)
public Rectangle3D.Integer getOptimizedBounds()
public void optimizeBounds()
public void moveBounds(Rectangle3D.Integer value)
public BooleanMask3D upscale()
public BooleanMask3D downscale(int nbPointForTrue)
nbPointForTrue
- the minimum number of true
points from a 2x2x2 block to give a true
resulting
point.public BooleanMask3D downscale()
public BooleanMask3D upscale2D()
public BooleanMask3D downscale2D(int nbPointForTrue)
nbPointForTrue
- the minimum number of true
points from a 2x2 block to give a true
resulting
point.public BooleanMask3D downscale2D()
public static int[] toInt3D(int[] source2D, int z)
public int getNumberOfPoints()
public Point3D.Integer[] getPoints()
Point3D.Integer
representing all points of the
current 3D mask.public int[] getPointsAsIntArray()
result.length
= number of point * 3result[(pt * 3) + 0]
= X coordinate for point pt.result[(pt * 3) + 1]
= Y coordinate for point pt.result[(pt * 3) + 2]
= Z coordinate for point pt.public Point3D.Integer[] getContourPoints()
Point3D.Integer
containing the contour/surface
points of the 3D mask.getContourPointsAsIntArray()
public int[] getContourPointsAsIntArray()
result.length
= number of point * 3result[(pt * 3) + 0]
= X coordinate for point pt.result[(pt * 3) + 1]
= Y coordinate for point pt.result[(pt * 3) + 2]
= Z coordinate for point pt.getContourPoints()
public double getContourLength()
public java.lang.Object clone()
clone
in class java.lang.Object