public class JAH_Utils
extends java.lang.Object
Constructor and Description |
---|
JAH_Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
convertToGray32(ImagePlus image)
A utility function for converting an ImagePlus image or stack of images to 32-bit.
|
static boolean |
doesNotHaveValueAbove(ImageProcessor ip,
double valueIndicatingADrop) |
static Roi |
findRoi(java.lang.String roiName) |
static Wave |
findWave(java.lang.String waveName) |
static java.lang.String |
format(double val,
int precision) |
static double |
getAverageDistanceBetweenROIs(Roi[] rois)
Calculates the Euclidean distance between the centroids of two Rois passed as arguments (in pixel values).
|
static ImagePlus |
getAvgZProjection(ImagePlus imagePlus,
ImagePlus avgImage) |
static java.lang.String[] |
getIntStrings(java.io.File file) |
static double |
getMaxValue(ImageProcessor ip) |
static double[] |
getNormalizedZAxisProfile(Analyzer analyzer,
Calibration cal,
ImageStack stack,
Roi roi) |
static double |
getRoiArea(Roi roi)
Calculates the area of the Roi passed as argument (in pixel values).
|
static java.awt.Point |
getRoiCentroid(Roi roi)
Calculates the centroid point of the Roi passed as argument (in pixel coordinates).
|
static Roi[] |
getRoisAsArray()
A utility function for returning all the Rois in the RoiManager.
|
static Roi[] |
getSelectedRoisAsArray()
A utility function for returning the selected Rois in the RoiManager.
|
static java.util.Vector |
getSelectedRoisAsVector() |
static Wave[] |
getSelectedWavesAsArray()
A utility function for returning the selected Waves in the WaveManager.
|
static java.util.Vector |
getSelectedWavesAsVector() |
static java.lang.String |
getStackTrace(java.lang.Exception ex)
Returns a String representing the stack trace of the Exception passed as argument.
|
static java.lang.String |
getTimestamp() |
static double[] |
getTrace(java.lang.String filename,
int iterateBy) |
static Wave[] |
getWavesAsArray()
A utility function for returning all the Waves in the WaveManager.
|
static double[] |
getZAxisProfile(Analyzer analyzer,
Calibration cal,
ImageStack stack,
Roi roi) |
static ImagePlus |
getZProjection(ImagePlus imagePlus,
int method)
A convenience function for projecting a time-series to one plane using the method specified in the argument.
|
static java.lang.String |
leftPad(java.lang.String stringToPad,
int digits)
Pads a string with 0's on the left side of the String passed as argument to the number of digits passed.
|
static java.lang.String |
ltrim(java.lang.String s)
From http://stackoverflow.com/questions/15567010/what-is-a-good-alternative-of-ltrim-and-rtrim-in-java
|
static ImagePlus |
makeBackgroundImage(ImageStack stack2,
ImagePlus dupe,
ImagePlus backgroundImage,
int firstIndex,
int lastIndex,
double thresholdToDropFrame) |
static ImagePlus |
makeBackgroundImageRolling(ImageStack stack2,
ImagePlus dupe,
ImagePlus backgroundImage,
int firstIndex,
int lastIndex,
int cursor) |
static ImagePlus |
makeBackgroundImageRolling(ImageStack stack2,
ImagePlus dupe,
ImagePlus backgroundImage,
int firstIndex,
int lastIndex,
int cursor,
double thresholdToDropFrame) |
static ImagePlus |
makeBackgroundImageRolling(ImageStack stack2,
ImagePlus dupe,
ImagePlus backgroundImage,
int firstIndex,
int lastIndex,
int cursor,
double thresholdToDropFrame,
boolean dontDropFrameByThreshold) |
static java.lang.String |
normalizePhysImagePath(java.lang.String path)
If the path passed as argument is not an absolute path, this function prefixes the filename with the base directory path.
|
static double[] |
normalizeValues(double[] values) |
static void |
openImage(java.lang.String epochImage) |
static void |
openRoi(java.lang.String roiName) |
static java.lang.String |
rtrim(java.lang.String s)
From http://stackoverflow.com/questions/15567010/what-is-a-good-alternative-of-ltrim-and-rtrim-in-java
|
static void |
sendTemplateToWfdIV(java.lang.String filename)
A convenience function to send a holographic mask to WfdIV, note: only actually sends
the file if Configuration_.isAutoSendingTemplatesToWfdIV() is true.
|
static void |
showStackTrace()
Prints a stack trace to stdout from the current location in the code.
|
static void |
showStackTrace(java.lang.Exception ex)
Prints the stack trace of the Exception passed as argument to stdout.
|
static java.lang.String |
stripFilename(java.lang.String filename)
This utility function strips a file path all the way to the actual filename in a platform-independent manner.
|
static void |
writeRoisToZip(java.lang.String path,
Roi[] rois) |
static void |
writeRoisToZip(java.lang.String path,
java.util.Vector rois) |
static void |
writeRoiVectorToZip(java.lang.String path,
java.util.Vector rois) |
public static java.lang.String normalizePhysImagePath(java.lang.String path)
public static double getRoiArea(Roi roi)
public static java.awt.Point getRoiCentroid(Roi roi)
public static double getAverageDistanceBetweenROIs(Roi[] rois)
public static java.lang.String leftPad(java.lang.String stringToPad, int digits)
public static void convertToGray32(ImagePlus image)
public static Wave[] getSelectedWavesAsArray()
public static Wave[] getWavesAsArray()
public static java.util.Vector getSelectedWavesAsVector()
public static Roi[] getSelectedRoisAsArray()
public static Roi[] getRoisAsArray()
public static java.util.Vector getSelectedRoisAsVector()
public static double[] getZAxisProfile(Analyzer analyzer, Calibration cal, ImageStack stack, Roi roi)
public static double[] normalizeValues(double[] values)
public static double[] getNormalizedZAxisProfile(Analyzer analyzer, Calibration cal, ImageStack stack, Roi roi)
public static java.lang.String[] getIntStrings(java.io.File file)
public static double[] getTrace(java.lang.String filename, int iterateBy)
public static void showStackTrace(java.lang.Exception ex)
public static java.lang.String getStackTrace(java.lang.Exception ex)
public static void showStackTrace()
public static ImagePlus getZProjection(ImagePlus imagePlus, int method)
public static java.lang.String getTimestamp()
public static void writeRoisToZip(java.lang.String path, java.util.Vector rois)
public static void writeRoisToZip(java.lang.String path, Roi[] rois)
public static java.lang.String format(double val, int precision)
public static void writeRoiVectorToZip(java.lang.String path, java.util.Vector rois)
public static void openImage(java.lang.String epochImage)
public static void openRoi(java.lang.String roiName)
public static Roi findRoi(java.lang.String roiName)
public static ImagePlus getAvgZProjection(ImagePlus imagePlus, ImagePlus avgImage)
public static double getMaxValue(ImageProcessor ip)
public static boolean doesNotHaveValueAbove(ImageProcessor ip, double valueIndicatingADrop)
public static ImagePlus makeBackgroundImage(ImageStack stack2, ImagePlus dupe, ImagePlus backgroundImage, int firstIndex, int lastIndex, double thresholdToDropFrame)
public static ImagePlus makeBackgroundImageRolling(ImageStack stack2, ImagePlus dupe, ImagePlus backgroundImage, int firstIndex, int lastIndex, int cursor)
public static ImagePlus makeBackgroundImageRolling(ImageStack stack2, ImagePlus dupe, ImagePlus backgroundImage, int firstIndex, int lastIndex, int cursor, double thresholdToDropFrame)
public static ImagePlus makeBackgroundImageRolling(ImageStack stack2, ImagePlus dupe, ImagePlus backgroundImage, int firstIndex, int lastIndex, int cursor, double thresholdToDropFrame, boolean dontDropFrameByThreshold)
public static void sendTemplateToWfdIV(java.lang.String filename)
public static Wave findWave(java.lang.String waveName)
public static java.lang.String stripFilename(java.lang.String filename)
public static java.lang.String ltrim(java.lang.String s)
public static java.lang.String rtrim(java.lang.String s)