300 likes | 668 Views
ImageJ. ImageJ Diagrams. 2010. Plugins. What is ImageJ ?. Application/GUI. Extension Points. Menus/ Commands. WindowManager. Command Recorder. ToolBar. ImageDisplay. Macros. StatusBar. ROI. Plugins API. Data Structures. Plugin. I/O. ImagePlus. ImageProcessor. Stacks.
E N D
ImageJ ImageJ Diagrams 2010
Plugins What is ImageJ ? Application/GUI Extension Points Menus/ Commands WindowManager Command Recorder ToolBar ImageDisplay Macros StatusBar ROI Plugins API Data Structures Plugin I/O ImagePlus ImageProcessor Stacks PluginFrame Conversion GenericDialog Image Processing Adjust Manipulation Analysis Measurement
Implementation Application Framework Events, Binding Interface Display Component Interfaces Actions Image Persistence ImageJ API Core/Library ImageData SPI Plugin Manager Image I/O
Plugins Plugins Directory IJ.getDirectory("plugins") On startup: java -Dplugins.dir=/Users/wayne -cp ij.jar ij.ImageJ
Extending with Listeners… ImageListener MacroExtension,ExtensionDescriptor CommandListener Component (New listener) FocusListener, WindowListener, WindowStateListener, MouseWheelListener Frame MouseListener, MouseMotionListener Canvas Runnable, AdjustmentListener, ActionListener, MouseWheelListener ImageCanvas ImageWindow StackWindow ImageWindowPlus StackWindowPlus HandleExtraFileTypes
ImageWindow ImageCanvas Screen area for display StackWindow ImageCanvas Screen area for display Objects in ImageJ WindowManager current number Image file AWT Image Frame ImageWindow ImageWindow ImagePlus ImageWindow expandable array of images ImageStack Slice ImageProcessor ImageProcessor pixels snapShotPixels
ImagePlus image ip win title Image Fileinfo stack stacksize currentSlice imageType (COLOR_256 COLOR_RGB GRAY16 GRAY32 GRAY8) roi ImageJ Classes ImageStack width height pixels LUT cm ImageWindow ImageCanvas CompositeImage java.awt.Image expandable array of images ImageStack ImageProcessor ByteProcessor ShortProcessor ColorProcessor FloatProcessor getPixels() Slice array ImageProcessor Image File TIFF, BMP, DICOM, FITS, PGM, GIF or JPRG
ImagePlus Fields private ImageJ ij = IJ.getInstance(); String title; String url; FileInfo fileInfo; Properties properties; ImageStack stack; (+ Dimensions (static final String[] orders = {"xyczt(default)", "xyctz", "xyzct", "xyztc", "xytcz", "xytzc"};) int nSlices = 1; int nChannels = 1; int nFrames = 1; int[] position = {1,1,1}; int imageType = GRAY8; int ID; int imageUpdateY, imageUpdateW; long startTime; // for operation duration Calibration calibration; boolean imageLoaded; boolean activated; boolean ignoreFlush; boolean errorLoadingImage; boolean openAsHyperStack; boolean noUpdateMode; ImageCanvas flatteningCanvas; (is this new?) Overlay overlay; public static final int GRAY8 = 0; GRAY16 = 1; GRAY32 = 2; COLOR_256 = 3; COLOR_RGB = 4; public boolean changes; protected Image img; (BufferedImage, rendered, with a MemoryImageSource) ImageProcessor ip; ImageWindow win; Roi roi; int currentSlice; static final int OPENED=0, CLOSED=1, UPDATED=2; boolean compositeImage; int width; int height; boolean locked = false; static int currentID = -1; Component comp; (NOTE use of prepareImage(), is this only for progress display?) Calibration globalCalibration; ImagePlus clipboard; Vector listeners = new Vector();
ImageStack fields static final int INITIAL_SIZE = 25; String outOfRange = "Argument out of range: "; private int nSlices = 0; Object[] stack; String[] label; int width, height; Rectangle roi; (also in ImagePlus) ColorModel cm; double min=Double.MAX_VALUE; double max; float[] cTable; no type
ImageProcessor fields protected int lineWidth = 1; int cx, cy; //current drawing coordinates Font font; FontMetrics fontMetrics; boolean antialiasedText; boolean boldFont; int width, snapshotWidth; int height, snapshotHeight; int roiX, roiY, roiWidth, roiHeight; int xMin, xMax, yMin, yMax; ColorModel baseCM; // base color model ColorModel cm; byte[] rLUT1, gLUT1, bLUT1; // base LUT byte[] rLUT2, gLUT2, bLUT2; // LUT as modified by setMinAndMax and setThreshold boolean interpolate; // replaced by interpolationMethod int interpolationMethod = NONE; double minThreshold=NO_THRESHOLD, maxThreshold=NO_THRESHOLD; int histogramSize = 256; double histogramMin, histogramMax; float[] cTable; boolean lutAnimation; MemoryImageSource source; Image img; boolean newPixels; Color drawingColor = Color.black; int clipXMin, clipXMax, clipYMin, clipYMax; // clip rect used by drawTo, drawLine, drawDot and drawPixel int justification = LEFT_JUSTIFY; int lutUpdateMode; WritableRaster raster; BufferedImage image; BufferedImage fmImage; ColorModel cm2; SampleModel sampleModel; IndexColorModel defaultColorModel; boolean minMaxSet; public static final int BLACK = 0xFF000000; double NO_THRESHOLD = -808080.0; int LEFT_JUSTIFY = 0; int CENTER_JUSTIFY = 1; int RIGHT_JUSTIFY = 2; int ISODATA = 0; int ISODATA2 = 1; int NEAREST_NEIGHBOR=0, NONE=0, BILINEAR=1, BICUBIC=2; int BLUR_MORE=0, FIND_EDGES=1, MEDIAN_FILTER=2, MIN=3, MAX=4, CONVOLVE=5; int RED_LUT=0, BLACK_AND_WHITE_LUT=1, NO_LUT_UPDATE=2, OVER_UNDER_LUT=3; static final int INVERT=0, FILL=1, ADD=2, MULT=3, AND=4, OR=5, XOR=6, GAMMA=7, LOG=8, MINIMUM=9, MAXIMUM=10, SQR=11, SQRT=12, EXP=13, ABS=14; static final String WRONG_LENGTH = "width*height!=pixels.length"; int fgColor = 0; boolean snapshotCopyMode; ImageProcessor mask; ProgressBar progressBar; private static String[] interpolationMethods; // Over/Under tresholding colors int overRed, overGreen=255, overBlue; int underRed, underGreen, underBlue=255; boolean useBicubic; private int sliceNumber;
extends implements Plugins - Related Classes & Execution Mechanisms ij.plugin.ClassChecker ij.io.PluginClassLoader Why not extends Plugin? PlugInFilter Plugin java.awt.Frame ExtendedPlugInFilter invokes PlugInFilterRunner PlugInFrame ij.Executer runs the specified menu command in a separate thread IJ.runPlugin() IJ.runMacroFile() IJ.runUserPlugin() IJ.runMacro() ij.macro.macroRunner
Important ImageJ Classes Graphics. drawImage()