|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbijnum.BIJutil
public class BIJutil
Utilities to link BIJ things to ImageJ. Copyright (c) 1999-2004, Michael Abramoff. All rights reserved.
| Constructor Summary | |
|---|---|
BIJutil()
|
|
| Method Summary | |
|---|---|
static void |
addSlice(java.lang.String label,
byte[] img,
ij.ImageStack is)
Add an image to a ImageStack of FloatProcessors. |
static void |
addSlice(java.lang.String label,
float[] img,
ij.ImageStack is)
Add an image to a ImageStack of FloatProcessors. |
static void |
addSlice(java.lang.String label,
ij.process.ImageProcessor ip,
ij.ImageStack is)
Add an image to a ImageStack of FloatProcessors. |
static void |
addSlice(java.lang.String label,
int[] img,
ij.ImageStack is)
Add an image to a ImageStack of FloatProcessors. |
static void |
addSlice(java.lang.String label,
short[] img,
ij.ImageStack is)
Add an image to a ImageStack of FloatProcessors. |
static void |
bin(double[] x,
int binwidth)
Bin a vector x. |
static float[] |
center(float[] image0,
int width0,
float[] image1,
int width1,
float scaling)
Center a scaled image1 into the center of a larger image0. |
static float[] |
center(float[] image0,
int width0,
float[] image1,
int width1,
float scaling,
int offset_x,
int offset_y)
Center a scaled image1 into the center of a larger image0 with offset offset_x and offset_y. |
static float[] |
crop(float[] image,
int width,
int height,
int x,
int y,
int newwidth,
int newheight)
Crop a float image to the rectangular size of a ROI defined by x,y,newwidth,newheight |
static byte[] |
fit(byte[] image,
int width)
Fit a byte image into a new power of 2 size image of newwidth * newwidth. |
static float[] |
fit(float[] image,
int width)
Fit a float image into a new power of 2 size image of newwidth * newwidth. |
static float[] |
fit(float[] spectrum,
int width,
int height)
Fit a square image into a smaller image widthxheight, with the center in the center of the new image. |
static float[] |
getMask(ij.gui.Roi roi,
int width,
int height)
Make a mask within an image widthxheight for Roi. |
static int |
getMatrixWidth(ij.ImagePlus imp)
Compute the width of the images in imp, or the ROI if one has been selected. |
static int |
getMatrixWidth(ij.ImagePlus imp,
double scaleFactor)
Compute the width of the images in imp, containing a stack, including scaling. |
static ij.ImageStack |
imageStackFromMatrix(float[][] a,
int width)
Create an ImageJ ImageStack out of a float matrix. |
static ij.ImageStack |
imageStackFromMatrix(short[][] a,
int width)
Create an ImageJ ImageStack out of a float matrix. |
static float[] |
makePower2(float[] v)
Mirror a vector so that is has power of 2 length and does not contain extra edges. |
static float[][] |
matrixFromImageStack(ij.ImagePlus imp)
Convert the data in the ImageStack in imp into a float[][] matrix for further processing. |
static float[][] |
matrixFromImageStack(ij.ImagePlus imp,
double scaleFactor)
Convert the data in the ImageStack in imp into a float[][] matrix and scale by scaleFactor on the fly. |
static float[][] |
matrixFromImageStack(ij.ImageStack is)
Access the data in the ImageStack in imp into a float[][] matrix for further processing. |
static float[][] |
matrixFromImageStackRoi(ij.ImagePlus imp)
Convert the data only within the rectangular Roi in the ImageStack in imp into a float[][] matrix for further processing. |
static int |
minPower2(int n)
Find the minimal power of 2 that is larger than n. |
static float[] |
montage(float[][] a,
int awidth,
int columns)
Make a montage of all images in a, with columns images per row, so that the width of the returned image will be awidth*columns. |
static boolean |
saveAsText(float[] v,
java.lang.String path)
Save vector v as a text file. |
static boolean |
saveImagePlusAsTiff(java.lang.String directory,
java.lang.String name,
ij.ImagePlus imp)
|
static boolean |
saveImageStackAsTiff(java.lang.String directory,
java.lang.String name,
ij.ImageStack is)
|
static short[][] |
shortMatrixFromImageStack(ij.ImagePlus imp)
Convert the data in the ImageStack in imp into a short [][] matrix for further processing. |
static ij.ImagePlus |
showVectorAsImage(float[] v,
int width)
|
static float[] |
tile(float[] image,
int width)
Fit an image into a new image of newwidth * newwidth, where newwidth is next large power of 2 than width. |
static byte[] |
toByte(float[] img)
|
static float[] |
tofloat(byte[] v)
|
static float[] |
tofloat(double[] v)
|
static float[] |
tofloat(int[] v)
|
static java.lang.String |
toString(double[] m)
|
static java.lang.String |
toString(double[][] m)
|
static java.lang.String |
toString(float[] m)
|
static java.lang.String |
toString(float[][] m)
|
static java.lang.String |
toString(int[][] m)
|
static float[] |
vectorFromImageStack(ij.ImagePlus imp,
int i)
Convert the data in the ImagePlus image stack into a float[] vector for further processing. |
static float[] |
vectorFromImageStack(ij.ImagePlus imp,
int i,
float scaleFactor)
Convert the data in the ImageStack in imp into a float[][] matrix and scale by scaleFactor on the fly. |
static float[] |
vectorFromImageStackRoi(ij.ImagePlus imp)
Convert the data in the i'th ImagePlus image into a float[] vector for further processing. |
static float[] |
vectorFromImageStackRoi(ij.ImagePlus imp,
int i)
Convert the data in the i'th ImagePlus image into a float[] vector for further processing. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BIJutil()
| Method Detail |
|---|
public static ij.ImageStack imageStackFromMatrix(float[][] a,
int width)
a - a float[][] matrix with the images as column vectors.width - the width of each image in pixels.
public static ij.ImageStack imageStackFromMatrix(short[][] a,
int width)
a - a float[][] matrix with the images as column vectors.width - the width of each image in pixels.
public static int getMatrixWidth(ij.ImagePlus imp)
public static int getMatrixWidth(ij.ImagePlus imp,
double scaleFactor)
scaleFactor - the scaling factor.
public static float[][] matrixFromImageStack(ij.ImagePlus imp)
public static float[][] matrixFromImageStack(ij.ImageStack is)
public static ij.ImagePlus showVectorAsImage(float[] v,
int width)
public static float[] vectorFromImageStack(ij.ImagePlus imp,
int i)
imp - the imageplus containing the stack.i - the image number in the stack, starting with 0.
public static float[] vectorFromImageStack(ij.ImagePlus imp,
int i,
float scaleFactor)
imp - the imageplus containing the stack.i - the image number in the stack, starting with 0.scaleFactor - the scaling factor.
public static float[] vectorFromImageStackRoi(ij.ImagePlus imp)
public static float[] vectorFromImageStackRoi(ij.ImagePlus imp,
int i)
public static float[] crop(float[] image,
int width,
int height,
int x,
int y,
int newwidth,
int newheight)
image - a float[] vector imagewidth - the width in pixels of imageheight - the width in pixels of imagex, - y, newwidth, newheight the ROI
public static float[][] matrixFromImageStack(ij.ImagePlus imp,
double scaleFactor)
imp - an ImagePlusscaleFactor - the scalefactor between 100-0.01.
public static float[][] matrixFromImageStackRoi(ij.ImagePlus imp)
public static short[][] shortMatrixFromImageStack(ij.ImagePlus imp)
public static float[] montage(float[][] a,
int awidth,
int columns)
a - a float[][] with the images.awidth, - the width of each image in pixels.columns - the number of columns desired.
public static int minPower2(int n)
public static void bin(double[] x,
int binwidth)
public static float[] makePower2(float[] v)
public static float[] tile(float[] image,
int width)
image - a float[] with the imagewidth - the width of image.
public static float[] fit(float[] image,
int width)
image - a float[] with the imagewidth - the width of image.
public static float[] fit(float[] spectrum,
int width,
int height)
spectrum - a square image vector.width - the width in pixels of the new image.height - the height of the new image.
public static byte[] fit(byte[] image,
int width)
image - a byte[] with the imagewidth - the width of image.
public static float[] getMask(ij.gui.Roi roi,
int width,
int height)
roi - the roi.width - the width of the mask.height - the height of the mask.
public static float[] center(float[] image0,
int width0,
float[] image1,
int width1,
float scaling)
image0 - the base imagewidth0 - the width in pixels of the base imageimage1 - the image to be insertedwidth1 - the width in pixels of the new imagescaling - the amount by which image1 will be scaled.
public static float[] center(float[] image0,
int width0,
float[] image1,
int width1,
float scaling,
int offset_x,
int offset_y)
image0 - the base imagewidth0 - the width in pixels of the base imageimage1 - the image to be insertedwidth1 - the width in pixels of the new imagescaling - the amount by which image1 will be scaled.
public static boolean saveAsText(float[] v,
java.lang.String path)
v - the float[] vectorpath - a String with the path to save the vector to.
public static float[] tofloat(double[] v)
public static float[] tofloat(byte[] v)
public static float[] tofloat(int[] v)
public static java.lang.String toString(float[][] m)
public static java.lang.String toString(double[][] m)
public static java.lang.String toString(int[][] m)
public static java.lang.String toString(float[] m)
public static java.lang.String toString(double[] m)
public static boolean saveImageStackAsTiff(java.lang.String directory,
java.lang.String name,
ij.ImageStack is)
public static boolean saveImagePlusAsTiff(java.lang.String directory,
java.lang.String name,
ij.ImagePlus imp)
public static byte[] toByte(float[] img)
public static void addSlice(java.lang.String label,
float[] img,
ij.ImageStack is)
public static void addSlice(java.lang.String label,
byte[] img,
ij.ImageStack is)
public static void addSlice(java.lang.String label,
short[] img,
ij.ImageStack is)
public static void addSlice(java.lang.String label,
int[] img,
ij.ImageStack is)
public static void addSlice(java.lang.String label,
ij.process.ImageProcessor ip,
ij.ImageStack is)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||