public class MIJ
extends java.lang.Object
More information: https://bigwww.epfl.ch/sage/soft/mij/
Reference:
Reference: D. Sage, D. Prodanov, J.-Y. Tinevez and J. Schindelin, MIJ: Making Interoperability Between ImageJ and Matlab Possible ImageJ User & Developer Conference, 2012, Luxembourg
Important note for the installation:
To use this class, copy mij.jar and ij.jar into java/jar of the local copy of Matlab.
Set the Java path using Matlab commands:
> javaaddpath '
> javaaddpath '
Tested: This class was tested on Matlab R2023b on MacOSX 14.6 and many others versions of Matlab.
License GNU General Public License v3.0
https://www.gnu.org/licenses/why-not-lgpl.html
| Modifier and Type | Field and Description |
|---|---|
static ij.ImageJ |
imagej |
| Constructor and Description |
|---|
MIJ()
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAllWindows()
Closes all windows.
|
static ij.ImagePlus |
createColor(byte[][][][] is,
boolean showImage)
Create a new 3D color image in ImageJ from a Matlab variable.
|
static ij.ImagePlus |
createColor(byte[][][] is,
boolean showImage)
Create a new color image in ImageJ from a Matlab variable.
|
static ij.ImagePlus |
createColor(java.lang.String title,
byte[][][][] is,
boolean showImage)
Create a new 3D color image in ImageJ from a Matlab variable with a
specified title.
|
static ij.ImagePlus |
createColor(java.lang.String title,
byte[][][] is,
boolean showImage)
Create a new color image in ImageJ from a Matlab variable with a
specified title.
|
static void |
createImage(java.lang.Object object)
Create a new image in ImageJ from a Matlab variable.
|
static ij.ImagePlus |
createImage(java.lang.String title,
java.lang.Object object,
boolean showImage)
Create a new image in ImageJ from a Matlab variable with a specified
title.
|
static void |
error(java.lang.String msg)
Displays a error message in a dialog box titled "ImageJ".
|
static void |
error(java.lang.String title,
java.lang.String msg)
Displays a error message in a dialog box specified title.
|
static void |
exit()
Exits ImageJ.imagej instance
|
static java.lang.Object |
getColumn(java.lang.String heading)
Returns a specifying column the current instance of ResultsTable.
|
static java.lang.Object |
getCurrentImage()
Returns the current (selected) image from ImageJ.
|
static java.lang.String |
getCurrentTitle()
Returns the title of the current image window.
|
static java.lang.Object |
getHistogram()
Returns the histogram of the current image.
|
static java.lang.Object |
getImage(java.lang.String title)
Returns the specifying image from ImageJ.
|
static java.lang.String[] |
getListColumns()
Returns the list of columns currently used in the ResultsTable.
|
static java.lang.String[] |
getListImages()
Gives the list of the open images in the ImageJ instance.
|
static java.lang.String |
getLog()
Returns the contents of the Log window or null if the Log window is not open.
|
static java.lang.Object |
getResultsTable()
Returns the instance of the ResultsTable.
|
static java.lang.Object |
getRoi(int option)
Get a region of interest (ROI) of the current image with or without
calibration.
|
static java.lang.String |
help()
Give a brief description of the methods.
|
static void |
log(java.lang.String s)
Displays a message in the log window of ImageJ.
|
static void |
main(java.lang.String[] args)
Starts new instance of ImageJ.
|
static void |
run(java.lang.String command)
Run a ImageJ command without arguments.
|
static void |
run(java.lang.String command,
java.lang.String options)
Run a ImageJ command with specified arguments.
|
static void |
selectWindow(java.lang.String title)
Select a window.
|
static void |
setColumn(java.lang.String heading,
java.lang.Object object)
Set a specifying column into the current instance ResultsTable.
|
static void |
setRoi(double[][] roiarray,
int type)
Set a region of interest (ROI) in the current image.
|
static void |
setSlice(int slice)
Switches to the specified stack slice, where 1<='slice'<=stack-size.
|
static void |
setThreshold(double lowerThreshold,
double upperThresold)
Set the threshold values of the current image.
|
static void |
setupExt(java.lang.String IJpath)
Setup the IJPath.
|
static void |
showStatus(java.lang.String s)
Displays a message in the ImageJ status bar.
|
static void |
start()
Starts new instance of ImageJ from Matlab.
|
static void |
start(boolean v)
Starts new instance of ImageJ from Matlab with or without verbose mode.
|
static void |
start(java.lang.String IJpath)
Starts new instance of ImageJ specifying the plugins directory and macros
directory.
|
static void |
start(java.lang.String args,
java.lang.String IJpath)
Starts new instance of ImageJ specifying the command-line options .
|
static void |
start(java.lang.String homeDir,
java.lang.String IJpath,
boolean v)
Starts new instance of ImageJ specifying the plugins directory and macros
directory.
|
static java.lang.String |
version()
Get the version of the MIJ class.
|
public static java.lang.String version()
public static java.lang.String help()
public static void start()
public static void start(boolean v)
v - indicate the verbose modepublic static void start(java.lang.String IJpath)
IJpath - String that points to the folder containing ij.jar and plugins
and macros folderverbose - indicate the verbose modepublic static void start(java.lang.String homeDir,
java.lang.String IJpath,
boolean v)
homeDir - Location of the user's homeDir E.g. /home/user (ImageJ
preferences will be saved here. It also means that if you
already have preferences, opening ImageJ via Matlab will use
those preferences)IJpath - String that points to the folder containing ij.jar and plugins
and macros folderverbose - indicate the verbose modepublic static void setupExt(java.lang.String IJpath)
IJpath - String that points to the folder containing ij.jar and plugins
and macros folderpublic static void start(java.lang.String args,
java.lang.String IJpath)
args - String of the same format as ImageJ commandline e.g.
"-debug -ijpath /opt/ImageJ/plugins"IJpath - String that points to the folder containing ij.jar and plugins
and macros folderpublic static void main(java.lang.String[] args)
args - Start up arguments for MIJpublic static void exit()
public static java.lang.String[] getListImages()
public static java.lang.String getCurrentTitle()
public static void setRoi(double[][] roiarray,
int type)
roiarray - give coordinates or positions of the ROI depending of the ROI
typetype - supported types: Roi.LINE, Roi.RECTANGLE, Roi.POINT, Roi.OVAL,
Roi.POLYLINE, Roi.POLYGON, Roi.ANGLEpublic static java.lang.Object getRoi(int option)
option - CAL for using calibration or NOCAL for no calibrationpublic static java.lang.Object getCurrentImage()
public static java.lang.Object getImage(java.lang.String title)
title - title of imagepublic static java.lang.Object getHistogram()
public static java.lang.String[] getListColumns()
public static java.lang.Object getResultsTable()
public static java.lang.Object getColumn(java.lang.String heading)
heading - heading of a columnpublic static void setColumn(java.lang.String heading,
java.lang.Object object)
heading - heading of a columnobject - public static void createImage(java.lang.Object object)
object - Matlab variablepublic static ij.ImagePlus createImage(java.lang.String title,
java.lang.Object object,
boolean showImage)
title - title of the new imageobject - Matlab variableshowImage - Whether to display the newly created image or notpublic static ij.ImagePlus createColor(byte[][][] is,
boolean showImage)
is - Matlab variablepublic static ij.ImagePlus createColor(java.lang.String title,
byte[][][] is,
boolean showImage)
title - title of the new imageis - Matlab variablepublic static ij.ImagePlus createColor(byte[][][][] is,
boolean showImage)
is - Matlab variablepublic static ij.ImagePlus createColor(java.lang.String title,
byte[][][][] is,
boolean showImage)
title - title of the new imageis - Matlab variablepublic static void run(java.lang.String command)
command - command to runpublic static void run(java.lang.String command,
java.lang.String options)
command - command in ImageJoptions - options for the commandpublic static void setThreshold(double lowerThreshold,
double upperThresold)
lowerThreshold - upperThresold - public static void error(java.lang.String msg)
msg - public static void error(java.lang.String title,
java.lang.String msg)
title - msg - public static void log(java.lang.String s)
s - public static java.lang.String getLog()
public static void showStatus(java.lang.String s)
public static void closeAllWindows()
public static void selectWindow(java.lang.String title)
public static void setSlice(int slice)
slice -