public class ThresholdDetectorFactory<T extends RealType<T> & NativeType<T>> extends Object implements SpotDetectorFactory<T>
Modifier and Type | Field and Description |
---|---|
static String |
DETECTOR_KEY
A string key identifying this factory.
|
protected String |
errorMessage |
protected ImgPlus<T> |
img
The image to operate on.
|
static String |
INFO_TEXT
An html information text.
|
static String |
KEY_INTENSITY_THRESHOLD |
static String |
KEY_SIMPLIFY_CONTOURS |
static String |
NAME
The pretty name of the target detector.
|
protected Map<String,Object> |
settings |
Constructor and Description |
---|
ThresholdDetectorFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkSettings(Map<String,Object> lSettings)
Check that the given settings map is suitable for target detector.
|
Map<String,Object> |
getDefaultSettings()
Returns a new default settings map suitable for the target detector.
|
SpotDetector<T> |
getDetector(Interval interval,
int frame)
Returns a new
SpotDetector configured to operate on the given
target frame. |
ConfigurationPanel |
getDetectorConfigurationPanel(Settings lSettings,
Model model)
Returns a new GUI panel able to configure the settings suitable for this
specific detector factory.
|
String |
getErrorMessage()
Returns a meaningful error message for the last action on this factory.
|
ImageIcon |
getIcon()
Returns the icon for this action.
|
String |
getInfoText()
Returns a html string containing a descriptive information about this
module.
|
String |
getKey()
Returns a unique identifier of this module.
|
String |
getName()
Returns the human-compliant name of this module.
|
boolean |
has2Dsegmentation()
Return
true for the detectors that can provide a spot with a
2D SpotRoi when they operate on 2D images. |
boolean |
marshall(Map<String,Object> lSettings,
org.jdom2.Element element)
Marshalls a settings map to a JDom element, ready for saving to XML.
|
boolean |
setTarget(ImgPlus<T> img,
Map<String,Object> settings)
Configure this factory to operate on the given source image (possibly
5D), with the given settings map.
|
boolean |
unmarshall(org.jdom2.Element element,
Map<String,Object> lSettings)
Un-marshalls a JDom element to update a settings map.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forbidMultithreading
public static final String DETECTOR_KEY
public static final String NAME
public static final String INFO_TEXT
public static final String KEY_SIMPLIFY_CONTOURS
public static final String KEY_INTENSITY_THRESHOLD
protected ImgPlus<T extends RealType<T> & NativeType<T>> img
protected String errorMessage
public boolean setTarget(ImgPlus<T> img, Map<String,Object> settings)
SpotDetectorFactoryBase
Also checks the validity of the given settings map for this factory. If
check fails, return false
, an error message can be obtained
through SpotDetectorFactoryBase.getErrorMessage()
.
setTarget
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
img
- the ImgPlus
to operate on, possible 5D.settings
- the settings map, must be suitable for this detector factory.false
is the given settings map is not suitable for
this detector factory.SpotDetectorFactoryBase.getErrorMessage()
public SpotDetector<T> getDetector(Interval interval, int frame)
SpotDetectorFactory
SpotDetector
configured to operate on the given
target frame. This factory must be first given the ImgPlus
and the settings map, through the #setTarget(ImgPlus, Map)
method.getDetector
in interface SpotDetectorFactory<T extends RealType<T> & NativeType<T>>
interval
- the interval that determines the region in the source image to
operate on. This must not have a dimension for time
(e.g. if the source image is 2D+T (3D), then the
interval must be 2D; if the source image is 3D without time,
then the interval must be 3D).frame
- the frame index in the source image to operate onpublic boolean has2Dsegmentation()
SpotDetectorFactoryBase
true
for the detectors that can provide a spot with a
2D SpotRoi
when they operate on 2D images.
This flag may be used by clients to exploit the fact that the spots
created with this detector will have a contour that can be used
e.g. to compute morphological features. The default is
false
, indicating that this detector provides spots as a X,
Y, Z, radius tuple.
has2Dsegmentation
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
true
if the spots created by this detector have a 2D
contour.public String getKey()
TrackMateModule
getKey
in interface TrackMateModule
public String getErrorMessage()
SpotDetectorFactoryBase
getErrorMessage
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
SpotDetectorFactoryBase.setTarget(ImgPlus, Map)
,
SpotDetectorFactoryBase.marshall(Map, Element)
,
SpotDetectorFactoryBase.unmarshall(Element, Map)
public boolean checkSettings(Map<String,Object> lSettings)
SpotDetectorFactoryBase
checkSettings
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
lSettings
- the map to test.true
if the settings map is valid.public boolean marshall(Map<String,Object> lSettings, org.jdom2.Element element)
SpotDetectorFactoryBase
Only parameters specific to the specific detector factory are marshalled.
The element also always receive an attribute named
that saves the target
SpotDetectorFactory
key.
marshall
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
true
if marshalling was successful. If not, check
SpotDetectorFactoryBase.getErrorMessage()
public boolean unmarshall(org.jdom2.Element element, Map<String,Object> lSettings)
SpotDetectorFactoryBase
unmarshall
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
element
- the JDom element to read from.lSettings
- the map to update. Is cleared prior to updating, so that it
contains only the parameters specific to the target detector
factory.true
if un-marshalling was successful. If not, check
SpotDetectorFactoryBase.getErrorMessage()
public ConfigurationPanel getDetectorConfigurationPanel(Settings lSettings, Model model)
SpotDetectorFactoryBase
getDetectorConfigurationPanel
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
lSettings
- the current settings, used to get info to display on the GUI
panel.model
- the current model, used to get info to display on the GUI
panel.public String getInfoText()
TrackMateModule
getInfoText
in interface TrackMateModule
public String getName()
TrackMateModule
getName
in interface TrackMateModule
public Map<String,Object> getDefaultSettings()
SpotDetectorFactoryBase
getDefaultSettings
in interface SpotDetectorFactoryBase<T extends RealType<T> & NativeType<T>>
public ImageIcon getIcon()
TrackMateModule
null
.getIcon
in interface TrackMateModule
null
to be safely ignored.Copyright © 2015–2021 Fiji. All rights reserved.