public class ROIUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MASK_SUFFIX |
static java.lang.String |
OBJECT_SUFFIX |
static java.lang.String |
PART_SUFFIX |
static java.lang.String |
SHAPE_SUFFIX |
static java.lang.String |
STACK_SUFFIX |
Constructor and Description |
---|
ROIUtil() |
Modifier and Type | Method and Description |
---|---|
static ROI |
adjustToSequence(ROI roi,
Sequence source,
Sequence destination)
Create a copy of the specified ROI coming from source sequence adjusted to the destination sequence.
|
static ROI |
adjustToSequence(ROI roi,
Sequence source,
Sequence destination,
boolean translate,
boolean scale)
Create a copy of the specified ROI coming from source sequence adjusted to the destination sequence.
|
static ROI |
adjustToSequence(ROI roi,
Sequence source,
Sequence destination,
boolean translate,
boolean scale,
boolean ignoreErrorOnScale)
Create a copy of the specified ROI coming from source sequence adjusted to the destination sequence.
|
static java.lang.Object |
computeDescriptor(java.util.Collection<ROIDescriptor> roiDescriptors,
java.lang.String descriptorId,
ROI roi,
Sequence sequence)
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.util.Set<ROIDescriptor> roiDescriptors,
java.lang.String descriptorId,
ROI roi,
Sequence sequence)
Deprecated.
|
static java.lang.Object |
computeDescriptor(java.lang.String descriptorId,
ROI roi,
Sequence sequence)
Computes the specified descriptor on given ROI and returns the result (or
null if the descriptor is
not found). |
static ROI2DEllipse |
convertToEllipse(ROI roi,
double radiusX,
double radiusY)
Converts the specified ROI to a 2D ellipse type ROI centered on the mass center of the input ROI.
|
static ROI |
convertToMask(ROI roi)
Converts the specified ROI to a boolean mask type ROI (ROI Area).
|
static ROI |
convertToPoint(ROI roi)
Converts the specified ROI to a ROI Point (
ROI2DPoint or ROI3DPoint ) representing the mass center of the input ROI. |
static ROI2DRectangle |
convertToRectangle(ROI roi,
double width,
double height)
Converts the specified ROI to a 2D rectangle type ROI centered on the mass center of the input ROI.
|
static Sequence |
convertToSequence(java.util.List<ROI> inputRois,
int sizeX,
int sizeY,
int sizeC,
int sizeZ,
int sizeT,
DataType dataType,
boolean label)
Convert a list of ROI into a binary / labeled Sequence.
|
static Sequence |
convertToSequence(java.util.List<ROI> inputRois,
Sequence sequence,
boolean label)
Convert a list of ROI into a binary / labeled Sequence.
|
static Sequence |
convertToSequence(ROI inputRoi,
Sequence sequence)
Convert a single ROI into a binary / labeled Sequence.
|
static ROI |
convertToShape(ROI roi,
double maxDeviation)
Converts the specified ROI to a shape type ROI (ROI Polygon or ROI Mesh).
|
static ROI |
convertToStack(ROI2D roi,
int zMin,
int zMax)
Converts the specified 2D ROI to 3D Stack ROI (ROI3DStack) by stacking it along the Z axis given zMin and zMax
(inclusive) parameters.
|
static void |
copyROIProperties(ROI source,
ROI destination,
boolean copyName)
Copy properties (name, color...) from
source ROI and apply it to destination ROI. |
static ROI |
get2XScaled(ROI roi,
boolean scaleOnZ,
boolean down)
Create and returns a new ROI which is a 2x up/down scaled version of the input ROI.
|
static java.lang.String |
getArea(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIAreaDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static java.lang.String |
getArea(Sequence sequence,
ROI roi,
int roundSignificant)
Deprecated.
Use
ROIAreaDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static java.util.List<ROI> |
getConnectedComponents(ROI roi)
Returns connected component from specified ROI as a list of ROI (Area type).
|
static java.lang.String |
getContourSize(Sequence sequence,
double contourPoints,
ROI roi,
int dim,
int roundSignificant)
Deprecated.
Use
ROIContourDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static java.lang.String |
getContourSize(Sequence sequence,
ROI roi,
int dim)
Deprecated.
Use
ROIContourDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static java.lang.String |
getContourSize(Sequence sequence,
ROI roi,
int dim,
int roundSignificant)
Deprecated.
Use
ROIContourDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static ROI |
getDownscaled(ROI roi,
boolean scaleOnZ)
Create and returns a new ROI which is a 2x down scaled version of the input ROI.
|
static int |
getEffectiveDimension(Rectangle5D bounds)
Returns the effective ROI number of dimension needed for the specified bounds.
|
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 ROI |
getExclusiveUnion(ROI roi1,
ROI roi2)
Compute exclusive union of specified
ROI and return result in a new ROI . |
static IntensityInfo |
getIntensityInfo(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIIntensityDescriptorsPlugin or computeDescriptor(String, ROI, Sequence) method
instead. |
static IntensityInfo |
getIntensityInfo(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROIIntensityDescriptorsPlugin or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getInteriorSize(Sequence sequence,
double interiorPoints,
ROI roi,
int dim,
int roundSignificant)
Deprecated.
Use
ROIInteriorDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getInteriorSize(Sequence sequence,
ROI roi,
int dim)
Deprecated.
Use
ROIInteriorDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getInteriorSize(Sequence sequence,
ROI roi,
int dim,
int roundSignificant)
Deprecated.
Use
ROIInteriorDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static ROI |
getIntersection(java.util.List<? extends ROI> rois)
Builds and returns a ROI corresponding to the intersection of the specified ROI list.
|
static ROI |
getIntersection(ROI roi1,
ROI roi2)
Computes intersection of specified
ROI and return result in a new ROI . |
static Point5D |
getMassCenter(ROI roi)
Deprecated.
Use
ROIMassCenterDescriptorsPlugin or computeDescriptor(String, ROI, Sequence)
method instead. |
static java.awt.geom.Point2D |
getMassCenter(ROI2D roi)
Deprecated.
Use
ROIMassCenterDescriptorsPlugin or computeDescriptor(String, ROI, Sequence)
method instead. |
static Point3D |
getMassCenter(ROI3D roi)
Deprecated.
Use
ROIMassCenterDescriptorsPlugin or computeDescriptor(String, ROI, Sequence)
method instead. |
static Point4D |
getMassCenter(ROI4D roi)
Deprecated.
Use
ROIMassCenterDescriptorsPlugin or computeDescriptor(String, ROI, Sequence)
method instead. |
static Point5D |
getMassCenter(ROI5D roi)
Deprecated.
Use
ROIMassCenterDescriptorsPlugin or computeDescriptor(String, ROI, Sequence)
method instead. |
static double |
getMaxIntensity(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIMaxIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getMaxIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROIMaxIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getMeanIntensity(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIMeanIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getMeanIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROIMeanIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getMinIntensity(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIMinIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getMinIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROIMinIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
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)
Deprecated.
Use
ROIPerimeterDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getPerimeter(Sequence sequence,
ROI roi,
int roundSignificant)
Deprecated.
Use
ROIPerimeterDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
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)
Deprecated.
Use
ROIStandardDeviationDescriptor or computeDescriptor(String, ROI, Sequence)
method instead. |
static double |
getStandardDeviation(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROIStandardDeviationDescriptor or computeDescriptor(String, ROI, Sequence)
method instead. |
static ROI |
getSubtraction(ROI roi1,
ROI roi2)
Computes the subtraction of roi1 - roi2 and returns result in a new
ROI . |
static double |
getSumIntensity(Sequence sequence,
ROI roi)
Deprecated.
Use
ROISumIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static double |
getSumIntensity(Sequence sequence,
ROI roi,
int z,
int t,
int c)
Deprecated.
Use
ROISumIntensityDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getSurfaceArea(Sequence sequence,
ROI roi)
Deprecated.
Use
ROISurfaceAreaDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static java.lang.String |
getSurfaceArea(Sequence sequence,
ROI roi,
int roundSignificant)
Deprecated.
Use
ROISurfaceAreaDescriptor or computeDescriptor(String, ROI, Sequence) method
instead. |
static ROI |
getUnion(java.util.List<? extends ROI> rois)
Builds and returns a ROI corresponding to the union of the specified ROI list.
|
static ROI |
getUnion(ROI roi1,
ROI roi2)
Computes union of specified
ROI and return result in a new ROI . |
static Rectangle5D |
getUnionBounds(ROI roi1,
ROI roi2)
Compute the resulting bounds for union operation between specified ROIs.
|
static ROI |
getUpscaled(ROI roi,
boolean scaleOnZ)
Create and returns a new ROI which is a 2x up scaled version of the input ROI.
|
static java.lang.String |
getVolume(Sequence sequence,
ROI roi)
Deprecated.
Use
ROIVolumeDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static java.lang.String |
getVolume(Sequence sequence,
ROI roi,
int roundSignificant)
Deprecated.
Use
ROIVolumeDescriptor or computeDescriptor(String, ROI, Sequence) method instead. |
static ROI |
merge(java.util.List<? extends ROI> rois,
ShapeUtil.BooleanOperator operator)
Merge the specified array of
ROI with the given ShapeUtil.BooleanOperator . |
static void |
scale(ROI roi,
double scale)
Scale the given ROI by specified scale factor.
|
static void |
scale(ROI roi,
double scaleX,
double scaleY)
Scale (2D) the given ROI by specified X/Y factor.
|
static void |
scale(ROI roi,
double scaleX,
double scaleY,
double scaleZ)
Scale (3D) the given ROI by specified X,Y,Z factors.
|
static java.util.List<ROI> |
split(ROI roi,
java.awt.geom.Line2D line)
Cut the specified ROI with the given Line2D (extended to ROI bounds) and return the 2 resulting ROI in a
list.
|
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 static final java.lang.String STACK_SUFFIX
public static final java.lang.String MASK_SUFFIX
public static final java.lang.String SHAPE_SUFFIX
public static final java.lang.String OBJECT_SUFFIX
public static final java.lang.String PART_SUFFIX
public ROIUtil()
public static java.util.Map<ROIDescriptor,PluginROIDescriptor> getROIDescriptors()
ROIDescriptor
) and their attached plugin
(see PluginROIDescriptor
).PluginROIDescriptor
interface.ROIDescriptor.getDescriptors()
public static java.lang.Object computeDescriptor(java.util.Collection<ROIDescriptor> roiDescriptors, java.lang.String descriptorId, ROI roi, Sequence sequence)
ROIDescriptor
set on given ROI
and returns the result (or null
if the descriptor is not found).ROIDescriptor.computeDescriptor(Collection, String, ROI, Sequence)
roiDescriptors
- the input ROIDescriptor
set (see getROIDescriptors()
method)descriptorId
- the id of the descriptor we want to compute (ROIBasicMeasureDescriptorsPlugin.ID_VOLUME
for
instance)roi
- the ROI on which the descriptor(s) should be computedsequence
- an optional sequence where the pixel size can be retrievednull
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 descriptor@Deprecated public static java.lang.Object computeDescriptor(java.util.Set<ROIDescriptor> roiDescriptors, java.lang.String descriptorId, ROI roi, Sequence sequence)
ROIDescriptor.computeDescriptor(Collection, String, ROI, Sequence)
insteadpublic static java.lang.Object computeDescriptor(java.lang.String descriptorId, ROI roi, Sequence sequence)
null
if the descriptor is
not found).ROIDescriptor.computeDescriptor(String, ROI, Sequence)
descriptorId
- the id of the descriptor we want to compute (ROIBasicMeasureDescriptorsPlugin.ID_VOLUME
for
instance)roi
- the ROI on which the descriptor(s) should be computedsequence
- an optional sequence where the pixel size can be retrievednull
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 descriptor@Deprecated public static double getStandardDeviation(Sequence sequence, ROI roi, int z, int t, int c)
ROIStandardDeviationDescriptor
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static IntensityInfo getIntensityInfo(Sequence sequence, ROI roi, int z, int t, int c)
ROIIntensityDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method
instead.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.@Deprecated public static double getMinIntensity(Sequence sequence, ROI roi, int z, int t, int c)
ROIMinIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getMaxIntensity(Sequence sequence, ROI roi, int z, int t, int c)
ROIMaxIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getMeanIntensity(Sequence sequence, ROI roi, int z, int t, int c)
ROIMeanIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getSumIntensity(Sequence sequence, ROI roi, int z, int t, int c)
ROISumIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getStandardDeviation(Sequence sequence, ROI roi)
ROIStandardDeviationDescriptor
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static IntensityInfo getIntensityInfo(Sequence sequence, ROI roi)
ROIIntensityDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method
instead.public static long getNumPixel(Sequence sequence, ROI roi)
@Deprecated public static double getMinIntensity(Sequence sequence, ROI roi)
ROIMinIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getMaxIntensity(Sequence sequence, ROI roi)
ROIMaxIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getMeanIntensity(Sequence sequence, ROI roi)
ROIMeanIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static double getSumIntensity(Sequence sequence, ROI roi)
ROISumIntensityDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static Point5D getMassCenter(ROI roi)
ROIMassCenterDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static java.awt.geom.Point2D getMassCenter(ROI2D roi)
ROIMassCenterDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static Point3D getMassCenter(ROI3D roi)
ROIMassCenterDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static Point4D getMassCenter(ROI4D roi)
ROIMassCenterDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static Point5D getMassCenter(ROI5D roi)
ROIMassCenterDescriptorsPlugin
or computeDescriptor(String, ROI, Sequence)
method instead.@Deprecated public static java.lang.String getContourSize(Sequence sequence, double contourPoints, ROI roi, int dim, int roundSignificant)
@Deprecated public static java.lang.String getContourSize(Sequence sequence, ROI roi, int dim, int roundSignificant)
@Deprecated public static java.lang.String getContourSize(Sequence sequence, ROI roi, int dim)
@Deprecated public static java.lang.String getInteriorSize(Sequence sequence, double interiorPoints, ROI roi, int dim, int roundSignificant)
@Deprecated public static java.lang.String getInteriorSize(Sequence sequence, ROI roi, int dim, int roundSignificant)
@Deprecated public static java.lang.String getInteriorSize(Sequence sequence, ROI roi, int dim)
@Deprecated public static java.lang.String getPerimeter(Sequence sequence, ROI roi, int roundSignificant)
@Deprecated public static java.lang.String getPerimeter(Sequence sequence, ROI roi)
@Deprecated public static java.lang.String getArea(Sequence sequence, ROI roi, int roundSignificant)
@Deprecated public static java.lang.String getSurfaceArea(Sequence sequence, ROI roi, int roundSignificant)
ROISurfaceAreaDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static java.lang.String getSurfaceArea(Sequence sequence, ROI roi)
ROISurfaceAreaDescriptor
or computeDescriptor(String, ROI, Sequence)
method
instead.@Deprecated public static java.lang.String getVolume(Sequence sequence, ROI roi, int roundSignificant)
public static int getEffectiveDimension(Rectangle5D bounds)
public static Rectangle5D getUnionBounds(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public static ROI getUnion(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
ROI
and return result in a new ROI
.java.lang.UnsupportedOperationException
public static ROI getIntersection(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
ROI
and return result in a new ROI
.java.lang.UnsupportedOperationException
public static ROI getExclusiveUnion(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
ROI
and return result in a new ROI
.java.lang.UnsupportedOperationException
public static ROI getSubtraction(ROI roi1, ROI roi2) throws java.lang.UnsupportedOperationException
ROI
.java.lang.UnsupportedOperationException
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 ROI convertToPoint(ROI roi)
ROI2DPoint
or ROI3DPoint
) representing the mass center of the input ROI.public static ROI2DEllipse convertToEllipse(ROI roi, double radiusX, double radiusY)
public static ROI2DRectangle convertToRectangle(ROI roi, double width, double height)
public static ROI convertToStack(ROI2D roi, int zMin, int zMax)
null
if the input ROI was nullpublic static ROI convertToMask(ROI roi)
public static ROI convertToShape(ROI roi, double maxDeviation) throws java.lang.UnsupportedOperationException
roi
- the roi to convert to shape type ROImaxDeviation
- maximum allowed deviation/distance of resulting ROI polygon from the input ROI contour (in pixel).
Use -1
for automatic maximum deviation calculation.java.lang.UnsupportedOperationException
public static java.util.List<ROI> getConnectedComponents(ROI roi) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public static java.util.List<ROI> split(ROI roi, java.awt.geom.Line2D line)
null
is returned.public static Sequence convertToSequence(java.util.List<ROI> inputRois, int sizeX, int sizeY, int sizeC, int sizeZ, int sizeT, DataType dataType, boolean label)
inputRois
- list of ROI to convertsizeX
- the wanted size X of output Sequence, if set to 0
then Sequence size X is computed
automatically from
the global ROI bounds.sizeY
- the wanted size Y of output Sequence, if set to 0
then Sequence size Y is computed
automatically from
the global ROI bounds.sizeC
- the wanted size C of output Sequence, if set to 0
then Sequence size C is computed
automatically from
the global ROI bounds.sizeZ
- the wanted size Z of output Sequence, if set to 0
then Sequence size Z is computed
automatically from
the global ROI bounds.sizeT
- the wanted size T of output Sequence, if set to 0
then Sequence size T is computed
automatically from
the global ROI bounds.dataType
- the wanted dataType of output Sequencelabel
- if set to true
then each ROI will be draw as a separate label (value) in the sequence
starting from 1.public static Sequence convertToSequence(java.util.List<ROI> inputRois, Sequence sequence, boolean label)
inputRois
- list of ROI to convertsequence
- the sequence used to define the wanted sequence dimension in return.null
then the global ROI bounds will be used to define the Sequence
dimensionlabel
- if set to true
then each ROI will be draw as a separate label (value) in the sequence
starting from 1.public static Sequence convertToSequence(ROI inputRoi, Sequence sequence)
inputRoi
- ROI to convertsequence
- the sequence used to define the wanted sequence dimension in return.null
then the global ROI bounds will be used to define the Sequence
dimensionpublic static void scale(ROI roi, double scaleX, double scaleY, double scaleZ) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to rescalejava.lang.UnsupportedOperationException
- if input ROI is not ROI2DShape or ROI3DShape (scaling supported only for these ROI)public static void scale(ROI roi, double scaleX, double scaleY) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to rescalejava.lang.UnsupportedOperationException
- if input ROI is not ROI2DShape or ROI3DShape (scaling supported only for these ROI)public static void scale(ROI roi, double scale) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to rescalejava.lang.UnsupportedOperationException
- if input ROI is not ROI2DShape or ROI3DShape (scaling supported only for these ROI)public static ROI get2XScaled(ROI roi, boolean scaleOnZ, boolean down) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to get the up scaled formscaleOnZ
- Set to true
to scale as well on Z dimension (XY dimension only otherwise)down
- Set to true
for down scaling and false
for up scaling operationjava.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D (up scaling not supported for these ROI)public static ROI getUpscaled(ROI roi, boolean scaleOnZ) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to get the up scaled formscaleOnZ
- Set to true
to scale as well on Z dimension (XY dimension only otherwise)java.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D (up scaling not supported for these ROI)public static ROI getDownscaled(ROI roi, boolean scaleOnZ) throws java.lang.UnsupportedOperationException
roi
- input ROI we want to get the up scaled formscaleOnZ
- Set to true
to scale as well on Z dimension (XY dimension only otherwise)java.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D (up scaling not supported for these ROI)public static ROI adjustToSequence(ROI roi, Sequence source, Sequence destination, boolean translate, boolean scale, boolean ignoreErrorOnScale) throws java.lang.UnsupportedOperationException
Sequence.getPosition()
are not identical on the 2 sequences.Sequence.getPixelSize()
are not identical on the 2 sequencesroi
- input ROI we want to adjustsource
- the source sequence where the ROI was initially generated (should contains valid origin information, see Sequence#getOriginXXX(} methods)destination
- the destination sequence where we want to copy the ROI (should contains valid origin information, see Sequence#getOriginXXX(} methods)translate
- if we allow the returned ROI to be translated compared to the original ROIscale
- if we allow the returned ROI to be scaled compared to the original ROIignoreErrorOnScale
- ignore unsupported scaling operation, in which case the result ROI won't be correctly scaledjava.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D while scaling is required (scaling not supported for these ROI) and ignoreErrorOnScale
is set to
FALSE
public static ROI adjustToSequence(ROI roi, Sequence source, Sequence destination, boolean translate, boolean scale) throws java.lang.UnsupportedOperationException
Sequence.getPosition()
are not identical on the 2 sequences.Sequence.getPixelSize()
are not identical on the 2 sequencesroi
- input ROI we want to adjustsource
- the source sequence where the ROI was initially generated (should contains valid origin information, see Sequence#getOriginXXX(} methods)destination
- the destination sequence where we want to copy the ROI (should contains valid origin information, see Sequence#getOriginXXX(} methods)translate
- if we allow the returned ROI to be translated compared to the original ROIscale
- if we allow the returned ROI to be scaled compared to the original ROIjava.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D while scaling is required (scaling not supported for these ROI) and ignoreErrorOnScale
is set to
FALSE
public static ROI adjustToSequence(ROI roi, Sequence source, Sequence destination) throws java.lang.UnsupportedOperationException
Sequence.getPosition()
are not identical on the 2 sequences.Sequence.getPixelSize()
are not identical on the 2 sequencesroi
- input ROI we want to adjustsource
- the source sequence where the ROI was initially generated (should contains valid origin information, see Sequence#getOriginXXX(} methods)destination
- the destination sequence where we want to copy the ROI (should contains valid origin information, see Sequence#getOriginXXX(} methods)java.lang.UnsupportedOperationException
- if input ROI is ROI4D or ROI5D while scaling is required (scaling not supported for these ROI)public static void copyROIProperties(ROI source, ROI destination, boolean copyName)
source
ROI and apply it to destination
ROI.