Constructor and Description |
---|
IjUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
askForOpenPath(String title)
Queries the user for an arbitrary file to be opened.
|
static ij.ImagePlus |
createImage(String title,
double[][] M)
Creates an ImageJ
ImagePlus image for the matrix M[r][c] (2D array),
where r is treated as the row (vertical) coordinate and
c is treated as the column (horizontal) coordinate. |
static ij.ImagePlus |
createImage(String title,
float[][] M)
Creates an ImageJ
ImagePlus image for the matrix M[r][c] (2D array),
where r is treated as the row (vertical) coordinate and
c is treated as the column (horizontal) coordinate. |
static String[] |
getImageShortTitles(ij.ImagePlus[] images)
Returns an array of strings containing the short titles
of the images supplied.
|
static ij.ImagePlus[] |
getOpenImages(boolean sortByTitle)
Returns a (possibly empty) array of ImagePlus objects that are
sorted by their titles if the 'sortByTitle' flag is set.
|
static ij.ImagePlus[] |
getOpenImages(boolean sortByTitle,
ij.ImagePlus exclude)
Returns a (possibly empty) array of
ImagePlus objects that are
sorted by their titles if the sortByTitle flag is set. |
static ij.ImagePlus |
selectOpenImage(String title)
Opens a dialog to let the user select one of the currently open images.
|
static void |
setRgbConversionWeights(ij.process.ImageProcessor ip)
Sets the weighing factors for the color components used
in RGB-to-grayscale conversion for the specified image
ip . |
static void |
setRgbConversionWeights(ij.process.ImageProcessor ip,
double wr,
double wg,
double wb)
Sets the weighing factors for the color components used
in RGB-to-grayscale conversion for the specified image
ip . |
public IjUtils()
public static ij.ImagePlus[] getOpenImages(boolean sortByTitle)
sortByTitle
- flag, result is sorted if true.public static String[] getImageShortTitles(ij.ImagePlus[] images)
images
- array of images.public static ij.ImagePlus selectOpenImage(String title)
title
- string to show in the dialogpublic static ij.ImagePlus[] getOpenImages(boolean sortByTitle, ij.ImagePlus exclude)
ImagePlus
objects that are
sorted by their titles if the sortByTitle flag is set.
The image "exclude" (typically the current image) is not included
in the returned array (pass null to exclude no image).sortByTitle
- set true
to return images sorted by titleexclude
- reference to an image to be excluded (may be null
)ImagePlus
objectspublic static String askForOpenPath(String title)
title
- string to be shown in the interaction window.public static ij.ImagePlus createImage(String title, float[][] M)
ImagePlus
image for the matrix M[r][c]
(2D array),
where r
is treated as the row (vertical) coordinate and
c
is treated as the column (horizontal) coordinate.
Use show()
to display the resulting image.title
- image titleM
- 2D arrayImagePlus
imagepublic static ij.ImagePlus createImage(String title, double[][] M)
ImagePlus
image for the matrix M[r][c]
(2D array),
where r
is treated as the row (vertical) coordinate and
c
is treated as the column (horizontal) coordinate.
Use show()
to display the resulting image.title
- the image titleM
- a 2D array holding the image dataImagePlus
instancepublic static void setRgbConversionWeights(ij.process.ImageProcessor ip)
ip
.
Note that this method can be applied to any ImageProcessor
instance but has no effect unless ip
is of type
ColorProcessor
. Applies standard (ITU-709) weights.ip
- The affected imagepublic static void setRgbConversionWeights(ij.process.ImageProcessor ip, double wr, double wg, double wb)
ip
.
Note that this method can be applied to any ImageProcessor
instance but has no effect unless ip
is of type
ColorProcessor
.ip
- The affected imagewr
- Red weightwg
- Green weightwb
- Blue weightCopyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)