public class ROIUtil extends java.lang.Object
Constructor and Description |
---|
ROIUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
computeDescriptor(java.util.Set<ROIDescriptor> roiDescriptors,
java.lang.String descriptorId,
ROI roi,
Sequence sequence,
int z,
int t,
int c)
Computes the specified descriptor from the input
ROIDescriptor set on given ROI
and returns the result (or null if the descriptor is not found). |
static java.lang.Object |
computeDescriptor(java.lang.String descriptorId,
ROI roi,
Sequence sequence,
int z,
int t,
int c)
Computes the specified descriptor on given ROI and returns the result (or
null
if the descriptor is not found). |
static java.lang.String |
getArea(Sequence sequence,
ROI roi)
Return area of the specified ROI.
|
static java.lang.String |
getArea(Sequence sequence,
ROI roi,
int roundSignificant)
Return area of the specified ROI.
|
static java.lang.String |
getContourSize(Sequence sequence,
double contourPoints,
ROI roi,
int dim,
int roundSignificant)
Returns the contour size for specified sequence and dimension from a given number of contour
points.
|
static java.lang.String |
getContourSize(Sequence sequence,
ROI roi,
int dim)
Returns the ROI contour size for specified sequence and dimension.
|
static java.lang.String |
getContourSize(Sequence sequence,
ROI roi,
int dim,
int roundSignificant)
Returns the ROI contour size for specified sequence and dimension.
|
static ROI |
getExclusiveUnion(java.util.List<? extends ROI> rois)
Builds and returns a ROI corresponding to the exclusive union of the specified ROI list.
|
static IntensityInfo |
getIntensityInfo(Sequence sequence,
ROI roi)
Returns the min, max, mean intensity of sequence pixels contained in the specified ROI.
|
static IntensityInfo |
getIntensityInfo(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Computes and returns the min, max, mean intensity for the specified sequence region.
|
static java.lang.String |
getInteriorSize(Sequence sequence,
double interiorPoints,
ROI roi,
int dim,
int roundSignificant)
Returns the ROI interior size for specified sequence and dimension from a given number of
interior points.
|
static java.lang.String |
getInteriorSize(Sequence sequence,
ROI roi,
int dim)
Returns the ROI interior size for specified sequence and dimension.
|
static java.lang.String |
getInteriorSize(Sequence sequence,
ROI roi,
int dim,
int roundSignificant)
Returns the ROI interior size for specified sequence and dimension.
|
static ROI |
getIntersection(java.util.List<? extends ROI> rois)
Builds and returns a ROI corresponding to the intersection of the specified ROI list.
|
static Point5D |
getMassCenter(ROI roi)
Returns the mass center of specified ROI.
|
static java.awt.geom.Point2D |
getMassCenter(ROI2D roi)
Returns the mass center of specified 2D ROI.
|
static Point3D |
getMassCenter(ROI3D roi)
Returns the mass center of specified 3D ROI.
|
static Point4D |
getMassCenter(ROI4D roi)
Returns the mass center of specified 4D ROI.
|
static Point5D |
getMassCenter(ROI5D roi)
Returns the mass center of specified 5D ROI.
|
static double |
getMaxIntensity(Sequence sequence,
ROI roi)
Returns the maximum intensity of sequence pixels contained in the specified ROI.
|
static double |
getMaxIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Returns the maximum intensity of sequence pixels contained in the specified ROI.
|
static double |
getMeanIntensity(Sequence sequence,
ROI roi)
Returns the mean intensity of sequence pixels contained in the specified ROI.
|
static double |
getMeanIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Returns the mean intensity of sequence pixels contained in the specified ROI.
|
static double |
getMinIntensity(Sequence sequence,
ROI roi)
Returns the minimum intensity of sequence pixels contained in the specified ROI.
|
static double |
getMinIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Returns the minimum intensity of sequence pixels contained in the specified ROI.
|
static long |
getNumPixel(Sequence sequence,
ROI roi)
Returns the number of sequence pixels contained in the specified ROI.
|
static long |
getNumPixel(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Returns the number of sequence pixels contained in the specified ROI.
|
static java.lang.String |
getPerimeter(Sequence sequence,
ROI roi)
Return perimeter of the specified ROI with the correct unit.
|
static java.lang.String |
getPerimeter(Sequence sequence,
ROI roi,
int roundSignificant)
Return perimeter of the specified ROI with the correct unit.
|
static java.util.Map<ROIDescriptor,PluginROIDescriptor> |
getROIDescriptors()
Returns all available ROI descriptors (see
ROIDescriptor ) and their attached plugin
(see PluginROIDescriptor ). |
static double |
getStandardDeviation(Sequence sequence,
ROI roi)
Computes and returns the standard deviation for the specified sequence region.
|
static double |
getStandardDeviation(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Computes and returns the standard deviation for the specified sequence region.
|
static double |
getSumIntensity(Sequence sequence,
ROI roi)
Returns the sum of all intensity of sequence pixels contained in the specified ROI.
|
static double |
getSumIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Returns the sum of all intensity of sequence pixels contained in the specified ROI.
|
static java.lang.String |
getSurfaceArea(Sequence sequence,
ROI roi)
Return surface area of the specified ROI.
|
static java.lang.String |
getSurfaceArea(Sequence sequence,
ROI roi,
int roundSignificant)
Return surface area of the specified ROI.
|
static ROI |
getUnion(java.util.List<? extends ROI> rois)
Builds and returns a ROI corresponding to the union of the specified ROI list.
|
static java.lang.String |
getVolume(Sequence sequence,
ROI roi)
Return volume of the specified ROI.
|
static java.lang.String |
getVolume(Sequence sequence,
ROI roi,
int roundSignificant)
Return volume of the specified ROI.
|
static ROI |
merge(java.util.List<? extends ROI> rois,
ShapeUtil.BooleanOperator operator)
Merge the specified array of
ROI with the given ShapeUtil.BooleanOperator . |
static ROI |
subtract(ROI roi1,
ROI roi2)
Subtract the content of the roi2 from the roi1 and return the result as a new
ROI . |
public ROIUtil()
public static java.util.Map<ROIDescriptor,PluginROIDescriptor> getROIDescriptors()
ROIDescriptor
) and their attached plugin
(see PluginROIDescriptor
).PluginROIDescriptor
interface.public static java.lang.Object computeDescriptor(java.util.Set<ROIDescriptor> roiDescriptors, java.lang.String descriptorId, ROI roi, Sequence sequence, int z, int t, int c)
ROIDescriptor
set on given ROI
and returns the result (or null
if the descriptor is not found).roiDescriptors
- the input ROIDescriptor
set (see getROIDescriptors()
method)descriptorId
- the id of the descriptor we want to compute (
BasicROIDescriptorPlugin.ID_VOLUME
for
instance)roi
- the ROI on which the descriptor(s) should be computedsequence
- an optional sequence where the pixel size can be retrievedz
- the specific Z position (slice) where we want to compute the descriptor or
-1
to compute it over the whole ROI Z dimension.t
- the specific T position (frame) where we want to compute the descriptor or
-1
to compute it over the whole ROI T dimension.c
- the specific C position (channel) where we want to compute the descriptor or
-1
to compute it over the whole ROI C dimension.null
if the descriptor if not found in the
specified setjava.lang.UnsupportedOperationException
- if the type of the given ROI is not supported by this descriptor, or if
sequence
is null
while the calculation requires it, or if
the specified Z, T or C position are not supported by the descriptorpublic static java.lang.Object computeDescriptor(java.lang.String descriptorId, ROI roi, Sequence sequence, int z, int t, int c)
null
if the descriptor is not found).descriptorId
- the id of the descriptor we want to compute (
BasicROIDescriptorPlugin.ID_VOLUME
for
instance)roi
- the ROI on which the descriptor(s) should be computedsequence
- an optional sequence where the pixel size can be retrievedz
- the specific Z position (slice) where we want to compute the descriptor or
-1
to compute it over the whole ROI Z dimension.t
- the specific T position (frame) where we want to compute the descriptor or
-1
to compute it over the whole ROI T dimension.c
- the specific C position (channel) where we want to compute the descriptor or
-1
to compute it over the whole ROI C dimension.null
if the descriptor if not found in the
specified setjava.lang.UnsupportedOperationException
- if the type of the given ROI is not supported by this descriptor, or if
sequence
is null
while the calculation requires it, or if
the specified Z, T or C position are not supported by the descriptorpublic static double getStandardDeviation(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the intensity informations.roi
- The ROI define the region where we want to compute the standard deviation.z
- The specific Z position (slice) where we want to compute the standard deviation or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute the standard deviation or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute the standard deviation or
-1
to use the ROI C dimension information.public static IntensityInfo getIntensityInfo(Sequence sequence, ROI roi, int z, int t, int c)
null
if the sequence or the ROI has changed during the operation.sequence
- The sequence we want to get the intensity informations.roi
- The ROI define the region where we want to compute intensity information.z
- The specific Z position (slice) where we want to compute intensity information or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute intensity information or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute intensity information or
-1
to use the ROI C dimension information.public static long getNumPixel(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the number of pixel.roi
- The ROI define the region where we want to compute the number of pixel.z
- The specific Z position (slice) where we want to compute the number of pixel or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute the number of pixel or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute the number of pixel or
-1
to use the ROI C dimension information.public static double getMinIntensity(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the min intensity information.roi
- The ROI define the region where we want to compute min intensity.z
- The specific Z position (slice) where we want to compute min intensity or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute min intensity or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute min intensity or
-1
to use the ROI C dimension information.public static double getMaxIntensity(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the max intensity information.roi
- The ROI define the region where we want to compute max intensity.z
- The specific Z position (slice) where we want to compute max intensity or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute max intensity or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute max intensity or
-1
to use the ROI C dimension information.public static double getMeanIntensity(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the mean intensity.roi
- The ROI define the region where we want to compute mean intensity.z
- The specific Z position (slice) where we want to compute mean intensity or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute mean intensity or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute mean intensity or
-1
to use the ROI C dimension information.public static double getSumIntensity(Sequence sequence, ROI roi, int z, int t, int c)
sequence
- The sequence we want to get the intensity sum.roi
- The ROI define the region where we want to compute intensity sum.z
- The specific Z position (slice) where we want to compute intensity sum or
-1
to use the ROI Z dimension information.t
- The specific T position (frame) where we want to compute intensity sum or
-1
to use the ROI T dimension information.c
- The specific C position (channel) where we want to compute intensity sum or
-1
to use the ROI C dimension information.public static double getStandardDeviation(Sequence sequence, ROI roi)
sequence
- The sequence we want to get the intensity informations.roi
- The ROI define the region where we want to compute the standard deviation.public static IntensityInfo getIntensityInfo(Sequence sequence, ROI roi)
sequence
- The sequence we want to get the intensity informations.roi
- The ROI define the region where we want to compute intensity information.public static long getNumPixel(Sequence sequence, ROI roi)
public static double getMinIntensity(Sequence sequence, ROI roi)
public static double getMaxIntensity(Sequence sequence, ROI roi)
public static double getMeanIntensity(Sequence sequence, ROI roi)
public static double getSumIntensity(Sequence sequence, ROI roi)
public static Point5D getMassCenter(ROI roi)
public static java.awt.geom.Point2D getMassCenter(ROI2D roi)
public static Point3D getMassCenter(ROI3D roi)
public static Point4D getMassCenter(ROI4D roi)
public static Point5D getMassCenter(ROI5D roi)
public static ROI merge(java.util.List<? extends ROI> rois, ShapeUtil.BooleanOperator operator) throws java.lang.UnsupportedOperationException
rois
- ROIs we want to merge.operator
- ShapeUtil.BooleanOperator
to apply.ROI
representing the result of the merge operation.java.lang.UnsupportedOperationException
public static ROI getUnion(java.util.List<? extends ROI> rois) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public static ROI getExclusiveUnion(java.util.List<? extends ROI> rois) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public static ROI getIntersection(java.util.List<? extends ROI> rois) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public static ROI subtract(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
ROI
.roi1.getSubtraction(roi2)
ROI
representing the result of subtraction.java.lang.UnsupportedOperationException
public static java.lang.String getContourSize(Sequence sequence, double contourPoints, ROI roi, int dim, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.contourPoints
- the number of contour points (override the ROI value)roi
- the ROI we want to compute the contour sizedim
- the dimension for the contour size operation (2 = perimeter, 3 = surface area, ...)roundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getContourSize(Sequence sequence, ROI roi, int dim, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the contour sizedim
- the dimension for the contour size operation (2 = perimeter, 3 = surface area, ...)roundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getContourSize(Sequence sequence, ROI roi, int dim)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the contour sizedim
- the dimension for the contour size operation (2 = perimeter, 3 = surface area, ...)public static java.lang.String getInteriorSize(Sequence sequence, double interiorPoints, ROI roi, int dim, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.interiorPoints
- the number of interior points (override the ROI value)roi
- the ROI we want to compute the interior sizedim
- the dimension for the interior size operation (2 = area, 3 = volume, ...)roundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).getArea(Sequence, ROI)
,
getVolume(Sequence, ROI)
public static java.lang.String getInteriorSize(Sequence sequence, ROI roi, int dim, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the interior sizedim
- the dimension for the interior size operation (2 = area, 3 = volume, ...)roundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).getArea(Sequence, ROI)
,
getVolume(Sequence, ROI)
public static java.lang.String getInteriorSize(Sequence sequence, ROI roi, int dim)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the interior sizedim
- the dimension for the interior size operation (2 = area, 3 = volume, ...)getArea(Sequence, ROI)
,
getVolume(Sequence, ROI)
public static java.lang.String getPerimeter(Sequence sequence, ROI roi, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the perimeterroundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getPerimeter(Sequence sequence, ROI roi)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the perimeterpublic static java.lang.String getArea(Sequence sequence, ROI roi, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the arearoundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getArea(Sequence sequence, ROI roi)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the areapublic static java.lang.String getSurfaceArea(Sequence sequence, ROI roi, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the surface arearoundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getSurfaceArea(Sequence sequence, ROI roi)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the surface areapublic static java.lang.String getVolume(Sequence sequence, ROI roi, int roundSignificant)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the volumeroundSignificant
- Round result value to specified number of significant digit (0 to keep all precision).public static java.lang.String getVolume(Sequence sequence, ROI roi)
sequence
- the input sequence used to retrieve operation unit by using pixel size information.roi
- the ROI we want to compute the volume