Modifier and Type | Method and Description |
---|---|
static <T> boolean |
checkMapKeys(Map<T,?> map,
Collection<T> mandatoryKeys,
Collection<T> optionalKeys,
StringBuilder errorHolder)
Check that the given map has all some keys.
|
static boolean |
checkParameter(Map<String,Object> map,
String key,
Class<?> expectedClass,
StringBuilder errorHolder)
Check the presence and the validity of a key in a map, and test it is of
the desired class.
|
static String |
echoMap(Map<String,Object> map,
int indent)
Generate a string representation of a map, typically a settings map.
|
static <J,K> List<K> |
getArrayFromMaping(Collection<J> keys,
Map<J,K> mapping)
Returns the mapping in a map that is targeted by a list of keys, in the
order given in the list.
|
static Context |
getContext()
Obtains the SciJava
Context in use by ImageJ. |
static String |
getCurrentTimeString() |
static Interval |
getInterval(ImgPlus<?> img,
Settings settings)
Returns an interval object that in the specified
ImgPlus slice
in a single time frame. |
static Interval |
getIntervalWithTime(ImgPlus<?> img,
Settings settings)
Returns an interval object that slices in the specified
ImgPlus
in a single channel (the channel dimension is dropped). |
static int |
getNBins(double[] values,
int minBinNumber,
int maxBinNumber)
Return the optimal bin number for a histogram of the data given in array,
using the Freedman and Diaconis rule (bin_space = 2*IQR/n^(1/3)).
|
static double |
getPercentile(double[] values,
double p)
Returns an estimate of the
p th percentile of the values in
the values array. |
static double[] |
getSpatialCalibration(ij.ImagePlus imp) |
static double[] |
getSpatialCalibration(ImgPlusMetadata img)
Return the xyz calibration stored in an
ImgPlusMetadata in a
3-elements double array. |
static String |
getUnitsFor(Dimension dimension,
String spaceUnits,
String timeUnits)
Return a String unit for the given dimension.
|
static <T extends Type<T>> |
hyperSlice(ImgPlus<T> img,
long channel,
long frame) |
static void |
localize(Spot spot,
double[] coords)
Store the x, y, z coordinates of the specified spot in the first 3
elements of the specified double array.
|
static double |
otsuThreshold(double[] data)
Return a threshold for the given data, using an Otsu histogram
thresholding method.
|
static File |
proposeTrackMateSaveFile(Settings settings,
Logger logger)
Creates a default file path to save the TrackMate session to, based on
the image TrackMate works on.
|
static ImgPlus |
rawWraps(ij.ImagePlus imp)
Wraps an IJ
ImagePlus in an imglib2 ImgPlus , without
parameterized types. |
static <K,V extends Comparable<? super V>> |
sortByValue(Map<K,V> map,
Comparator<V> comparator)
Return a new map sorted by its values.
|
static double |
standardDeviation(double[] data) |
static double |
sum(double[] intensities) |
static double |
variance(double[] data) |
public static <K,V extends Comparable<? super V>> Map<K,V> sortByValue(Map<K,V> map, Comparator<V> comparator)
public static final String echoMap(Map<String,Object> map, int indent)
public static final ImgPlus rawWraps(ij.ImagePlus imp)
ImagePlus
in an imglib2 ImgPlus
, without
parameterized types. The only way I have found to beat javac constraints
on bounded multiple wildcard.public static final <T> boolean checkMapKeys(Map<T,?> map, Collection<T> mandatoryKeys, Collection<T> optionalKeys, StringBuilder errorHolder)
map
- the map to inspect.mandatoryKeys
- the collection of keys that are expected to be in the map. Can
be null
.optionalKeys
- the collection of keys that can be - or not - in the map. Can
be null
.errorHolder
- will be appended with an error message.public static final boolean checkParameter(Map<String,Object> map, String key, Class<?> expectedClass, StringBuilder errorHolder)
map
- the map to inspect.key
- the key to find.expectedClass
- the expected class of the target value .errorHolder
- will be appended with an error message.public static final <J,K> List<K> getArrayFromMaping(Collection<J> keys, Map<J,K> mapping)
public static final double[] getSpatialCalibration(ImgPlusMetadata img)
ImgPlusMetadata
in a
3-elements double array. Calibration is ordered as X, Y, Z. If one axis
is not found, then the calibration for this axis takes the value of 1.public static double[] getSpatialCalibration(ij.ImagePlus imp)
public static final double getPercentile(double[] values, double p)
p
th percentile of the values in
the values
array. Taken from commons-math.public static final void localize(Spot spot, double[] coords)
public static final int getNBins(double[] values, int minBinNumber, int maxBinNumber)
public static final double otsuThreshold(double[] data)
public static final String getUnitsFor(Dimension dimension, String spaceUnits, String timeUnits)
public static final String getCurrentTimeString()
public static <T extends Type<T>> ImgPlus<T> hyperSlice(ImgPlus<T> img, long channel, long frame)
public static final Interval getIntervalWithTime(ImgPlus<?> img, Settings settings)
ImgPlus
in a single channel (the channel dimension is dropped).
The specified Settings
object is used to determine a crop-cube
that will determine the X,Y,Z size of the interval. The channel dimension
will be dropped.
If the specified ImgPlus
has a time axis, it will be included,
using the Settings.tstart
and Settings.tend
as bounds. If
it is a singleton dimension (1 time-point) it won't be dropped.
img
- the source image into which the interval is to be defined.settings
- the settings object that will determine the interval size.public static final Interval getInterval(ImgPlus<?> img, Settings settings)
ImgPlus
slice
in a single time frame.
The specified Settings
object is used to determine a crop-cube
that will determine the X,Y,Z size of the interval. A single channel will
be taken in the case of a multi-channel image. If the detector set in the
settings object has a parameter for the target channel
DetectorKeys.KEY_TARGET_CHANNEL
,
it will be used; otherwise the first channel will be taken.
If the specified ImgPlus
has a time axis, it will be dropped and
the returned interval will have one dimension less.
img
- the source image into which the interval is to be defined.settings
- the settings object that will determine the interval size.public static File proposeTrackMateSaveFile(Settings settings, Logger logger)
settings
- the settings object from which to read the image, its folder,
etc.logger
- a logger instance in which to echo problems if any.public static final double variance(double[] data)
public static final double standardDeviation(double[] data)
public static double sum(double[] intensities)
Copyright © 2015–2021 Fiji. All rights reserved.