Modifier and Type | Field and Description |
---|---|
String |
info
Used to store information about this bounding box.
|
protected PointInImage |
origin
The bounding box origin (SE, lower corner)
|
protected PointInImage |
originOpposite
The origin opposite (NW, upper corner)
|
protected String |
spacingUnit |
double |
xSpacing
The 'voxel width' of the bounding box
|
double |
ySpacing
The 'voxel height' of the bounding box
|
double |
zSpacing
The 'voxel depth' of the bounding box
|
Constructor and Description |
---|
BoundingBox()
Constructs an 'empty' BoundingBox using default values, with the box origin
defined as a point with
Double.NaN coordinates and
Double.NaN dimensions |
Modifier and Type | Method and Description |
---|---|
void |
append(Iterator<? extends SNTPoint> iterator)
Computes the bounding box of the specified point cloud and appends it to this
bounding box, resizing it as needed.
|
BoundingBox |
clone() |
void |
combine(BoundingBox boundingBox)
Combines Combines this bounding box with another one.
|
void |
compute(Iterator<? extends SNTPoint> iterator)
Computes a new positioning so that this box encloses the specified point
cloud.
|
boolean |
contains(BoundingBox boundingBox)
Checks whether the specified BoundingBox is enclosed by this one .
|
boolean |
contains(SNTPoint point) |
double |
depth() |
boolean |
equals(Object obj) |
ij.measure.Calibration |
getCalibration()
Creates a Calibration object using information from this BoundingBox
|
SNTPoint |
getCentroid() |
double |
getDiagonal()
Gets the box diagonal
|
double[] |
getDimensions()
Gets this BoundingBox dimensions in real world units.
|
double[] |
getDimensions(boolean scaled)
Gets this BoundingBox dimensions.
|
String |
getUnit()
Gets the length unit of voxel spacing
|
boolean |
hasDimensions() |
int |
hashCode() |
double |
height() |
void |
inferSpacing(Collection<SWCPoint> points)
Infers the voxel spacing of this box from the inter-node distances of a
Collection of
SWCPoint s. |
boolean |
isScaled()
Checks whether this BoundingBox is spatially calibrated, i.e., if voxel
spacing has been specified
|
PointInImage |
origin()
Retrieves the origin of this box.
|
PointInImage |
originOpposite()
Retrieves the origin opposite of this box.
|
protected void |
reset() |
void |
setDimensions(long uncalibratedWidth,
long uncalibratedHeight,
long uncalibratedDepth)
Sets the dimensions of this bounding box using uncalibrated (pixel)
lengths.
|
void |
setOrigin(PointInImage origin)
Sets the origin for this box, i.e., its (xMin, yMin, zMin) vertex.
|
void |
setOriginOpposite(PointInImage originOpposite)
Sets the origin opposite for this box, i.e., its (xMax, yMax, zMax) vertex.
|
void |
setSpacing(double xSpacing,
double ySpacing,
double zSpacing,
String spacingUnit)
Sets the voxel spacing.
|
void |
setUnit(String unit)
Sets the default length unit for voxel spacing (typically um, for SWC
reconstructions)
|
String |
toString() |
PointInImage |
unscaledOrigin()
Retrieves the origin of this box in unscaled ("pixel" units)
|
PointInImage |
unscaledOriginOpposite()
Retrieves the origin opposite of this box in unscaled ("pixel" units)
|
double |
width() |
public double xSpacing
public double ySpacing
public double zSpacing
public String info
protected String spacingUnit
protected PointInImage origin
protected PointInImage originOpposite
public BoundingBox()
Double.NaN
coordinates and
Double.NaN
dimensionsprotected void reset()
public void setSpacing(double xSpacing, double ySpacing, double zSpacing, String spacingUnit)
xSpacing
- the 'voxel width' of the bounding boxySpacing
- the 'voxel height' of the bounding boxzSpacing
- the 'voxel depth' of the bounding boxspacingUnit
- the length unitpublic void compute(Iterator<? extends SNTPoint> iterator)
iterator
- the iterator of the points Collectionpublic void append(Iterator<? extends SNTPoint> iterator)
iterator
- the iterator of the points Collectionpublic SNTPoint getCentroid()
public void inferSpacing(Collection<SWCPoint> points)
SWCPoint
s.points
- the point collectionpublic boolean isScaled()
public void setUnit(String unit)
unit
- the new unitpublic String getUnit()
public ij.measure.Calibration getCalibration()
public double[] getDimensions()
public double[] getDimensions(boolean scaled)
scaled
- If true, dimensions are retrieved in real world units,
otherwise in ("pixel") unitspublic double getDiagonal()
public boolean contains(BoundingBox boundingBox)
boundingBox
- the bounding box to be testedpublic boolean contains(SNTPoint point)
public void combine(BoundingBox boundingBox)
boundingBox
- the bounding box to be combined.public PointInImage origin()
public PointInImage originOpposite()
public PointInImage unscaledOrigin()
public PointInImage unscaledOriginOpposite()
public double width()
public double height()
public double depth()
public void setDimensions(long uncalibratedWidth, long uncalibratedHeight, long uncalibratedDepth) throws IllegalArgumentException
uncalibratedWidth
- the uncalibrated widthuncalibratedHeight
- the uncalibrated heightuncalibratedDepth
- the uncalibrated depthIllegalArgumentException
- If origin has not been set or
compute(Iterator)
has not been calledpublic void setOrigin(PointInImage origin)
origin
- the new originpublic void setOriginOpposite(PointInImage originOpposite)
originOpposite
- the new origin opposite.public boolean hasDimensions()
public BoundingBox clone()
Copyright © 2015–2021 Fiji. All rights reserved.