File: PlugInFilter.java

package info (click to toggle)
imagej 1.51i%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,244 kB
  • ctags: 13,220
  • sloc: java: 113,144; sh: 285; xml: 50; makefile: 8
file content (91 lines) | stat: -rw-r--r-- 4,578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package ij.plugin.filter;
import ij.*;
import ij.process.*;

/** ImageJ plugins that process an image should implement this interface.
 *  For filters that have a dialog asking for options or parameters as well
 *  as for filters that have a progress bar and process stacks the
 *  ExtendedPlugInFilter interface is recommended.
 */
public interface PlugInFilter {

	/** This method is called once when the filter is loaded. 'arg',
		which may be blank, is the argument specified for this plugin 
		in IJ_Props.txt or in the plugins.config file of a jar archive
        containing the plugin. 'imp' is the currently active image.
		This method should return a flag word that specifies the
		filters capabilities.
        <p>
        For Plugin-filters specifying the {@link #FINAL_PROCESSING} flag,
        the setup method will be called again, this time with
        arg = "final" after all other processing is done.
     */
	public int setup(String arg, ImagePlus imp);

	/** Filters use this method to process the image. If the
	 	{@link #DOES_STACKS} flag was set, it is called for each slice in
	 	a stack. With {@link #CONVERT_TO_FLOAT}, the filter is called with
        the image data converted to a FloatProcessor (3 times per
        image for RGB images). ImageJ will lock the image before calling
		this method and unlock it when the filter is finished.
        For PlugInFilters specifying the {@link #NO_IMAGE_REQUIRED} flag
        and not the {@link #DONE} flag, run(ip) is called once with the
        argument <code>null</code>.
     */
	public void run(ImageProcessor ip);

	/** Set this flag if the filter handles 8-bit grayscale images. */
	public int DOES_8G = 1;
	/** Set this flag if the filter handles 8-bit indexed color images. */
	public int DOES_8C = 2;
	/** Set this flag if the filter handles 16-bit images. */
	public int DOES_16 = 4;
	/** Set this flag if the filter handles float images. */
	public int DOES_32 = 8;
	/** Set this flag if the filter handles RGB images. */
	public int DOES_RGB = 16;
	/** Set this flag if the filter handles all types of images. */
	public int DOES_ALL = DOES_8G+DOES_8C+DOES_16+DOES_32+DOES_RGB;
	/** Set this flag if the filter wants its run() method to be
		called for all the slices in a stack. */
	public int DOES_STACKS = 32;
	/** Set this flag if the filter wants ImageJ, for non-rectangular
		ROIs, to restore that part of the image that's inside the bounding
		rectangle but outside of the ROI. */
	public int SUPPORTS_MASKING = 64;
	/** Set this flag if the filter makes no changes to the pixel data and does not require undo. */
	public int NO_CHANGES = 128;
	/** Set this flag if the filter does not require undo. */
	public int NO_UNDO = 256;
	/** Set this flag if the filter does not require that an image be open. */
	public int NO_IMAGE_REQUIRED = 512;
	/** Set this flag if the filter requires an ROI. */
	public int ROI_REQUIRED = 1024;
	/** Set this flag if the filter requires a stack. */
	public int STACK_REQUIRED = 2048;
	/** Set this flag if the filter does not want its run method called. */
	public int DONE = 4096;
	/** Set this flag to have the ImageProcessor that is passed to the run() method 
		converted  to a FloatProcessor. With  RGB images, the run() method is  
		called three times, once for each channel. */
	public int CONVERT_TO_FLOAT = 8192;
	/** Set this flag if the filter requires a snapshot (copy of the pixels array). */
	public int SNAPSHOT = 16384;
    /** Set this flag if the filter wants to be called with arg = "dialog" after
        being invocated the first time */
    /** Set this flag if the slices of a stack may be processed in parallel threads */
    public final int PARALLELIZE_STACKS = 32768;
    /** Set this flag if the setup method of the filter should be called again after
     *  the calls to the run(ip) have finished. The argument <code>arg</code> of setup
     *  will be "final" in that case. */
    public final int FINAL_PROCESSING = 65536;
    /** Set this flag to keep the invisible binary threshold from being reset. */
    public final int KEEP_THRESHOLD = 131072;
    /** Set this flag if images may be processed in parallel threads. Overrides PARALLELIZE_STACKS.
		The plugin's run() method is called in parallel threads, with the ROI rectangle of the
		ImageProcessor set according to the area that should be processed. Use the
		Edit/Options/Memory & Threads command to view or set the thread count. */
    public final int PARALLELIZE_IMAGES = 262144;

    // flags 0x01000000 and above are reserved for ExtendedPlugInFilter
}