public abstract class ROIDescriptor extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
compute(ROI roi,
Sequence sequence)
Computes the descriptor on the specified ROI and return the result.
|
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.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). |
boolean |
equals(java.lang.Object obj) |
abstract java.lang.String |
getDescription()
Returns a single line description (used as tooltip) for this descriptor
|
static ROIDescriptor |
getDescriptor(java.util.Collection<ROIDescriptor> descriptors,
java.lang.String id)
Returns the descriptor identified by the given id from the given list of
ROIDescriptor . |
static ROIDescriptor |
getDescriptor(java.lang.String id)
Returns the descriptor identified by the given id from the given list of
ROIDescriptor . |
static java.util.Map<ROIDescriptor,PluginROIDescriptor> |
getDescriptors()
Returns all available ROI descriptors (see
ROIDescriptor ) and their attached plugin
(see PluginROIDescriptor ). |
java.lang.String |
getId()
Returns the id of this descriptor.
|
java.lang.String |
getName()
Returns the name of this descriptor.
|
java.lang.Class<?> |
getType()
Returns the type of result for this descriptor
|
java.lang.String |
getUnit(Sequence sequence)
Returns the unit of this descriptor (
ex: "px", "mm", "µm2"... |
int |
hashCode() |
boolean |
needRecompute(ROIEvent change)
Returns
true if this descriptor need to be recomputed when the specified ROI change event happen. |
boolean |
needRecompute(SequenceEvent change)
Returns
true if this descriptor need to be recomputed when the specified Sequence change event
happen. |
boolean |
separateChannel()
Returns
true if this descriptor compute its result on Sequence data and *per channel* (as
pixel intensity information). |
java.lang.String |
toString() |
public static java.util.Map<ROIDescriptor,PluginROIDescriptor> getDescriptors()
ROIDescriptor
) and their attached plugin
(see PluginROIDescriptor
).PluginROIDescriptor
interface.public static ROIDescriptor getDescriptor(java.util.Collection<ROIDescriptor> descriptors, java.lang.String id)
ROIDescriptor
.null
if the descriptor is not found in the given list.id
- the id of the descriptor (ROIBasicMeasureDescriptorsPlugin.ID_VOLUME
for instance) @see
#getDescriptors()computeDescriptor(String, ROI, Sequence)
public static ROIDescriptor getDescriptor(java.lang.String id)
ROIDescriptor
.null
if the descriptor is not found in the given list.id
- the id of the descriptor (ROIBasicMeasureDescriptorsPlugin.ID_VOLUME
for instance) @see
#getDescriptors()computeDescriptor(String, ROI, Sequence)
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).roiDescriptors
- the input ROIDescriptor
set (see getDescriptors()
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 descriptorpublic static java.lang.Object computeDescriptor(java.lang.String descriptorId, ROI roi, Sequence sequence)
null
if the descriptor is
not found).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 descriptorpublic java.lang.String getId()
public java.lang.String getName()
public abstract java.lang.String getDescription()
public java.lang.String getUnit(Sequence sequence)
ex: "px", "mm", "µm2"...
).
It can return an empty or null
string (default implementation) if there is no
specific unit attached to the descriptor.sequence
- the sequence on which we want to compute the descriptor (if required) to get access to
the pixel size informations and return according unitpublic java.lang.Class<?> getType()
compute(ROI, Sequence)
public boolean separateChannel()
true
if this descriptor compute its result on Sequence
data and *per channel* (as
pixel intensity information).false
, override this method if a descriptor require per channel computation.compute(ROI, Sequence)
public boolean needRecompute(SequenceEvent change)
true
if this descriptor need to be recomputed when the specified Sequence change event
happen.false
, override this method if a descriptor need a specific implementation.compute(ROI, Sequence)
public boolean needRecompute(ROIEvent change)
true
if this descriptor need to be recomputed when the specified ROI change event happen.true
on ROI content change, override this method if a descriptor need a
specific implementation.compute(ROI, Sequence)
public abstract java.lang.Object compute(ROI roi, Sequence sequence) throws java.lang.UnsupportedOperationException
roi
- the ROI on which the descriptor(s) should be computedsequence
- an optional sequence where the pixel informations can be retrieved (see separateChannel()
)java.lang.UnsupportedOperationException
- if the type of the given ROI is not supported by this descriptor, or if sequence
is
null
while the calculation requires itpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object