Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Roi Class Reference
Inheritance diagram for Roi:
Line OvalRoi PolygonRoi ShapeRoi TextRoi FreehandRoi

Public Member Functions

 Roi (int x, int y, int width, int height)
 
 Roi (int x, int y, ImagePlus imp)
 
 Roi (int x, int y, int width, int height, ImagePlus imp)
 
void setLocation (int x, int y)
 
void setImage (ImagePlus imp)
 
int getType ()
 
int getState ()
 
double getLength ()
 
double getFeretsDiameter ()
 
Rectangle getBounds ()
 
Rectangle getBoundingRect ()
 
Polygon getPolygon ()
 
synchronized Object clone ()
 
void nudge (int key)
 
void nudgeCorner (int key)
 
void draw (Graphics g)
 
void drawPixels ()
 
boolean contains (int x, int y)
 
int isHandle (int sx, int sy)
 
void modifyRoi ()
 
ImageProcessor getMask ()
 
void endPaste ()
 
void abortPaste ()
 
double getAngle (int x1, int y1, int x2, int y2)
 
String getName ()
 
void setName (String name)
 
int getPasteMode ()
 
boolean isArea ()
 
String getTypeAsString ()
 
String toString ()
 

Static Public Member Functions

static Color getColor ()
 
static void setColor (Color c)
 
static void setPasteMode (int transferMode)
 
static int getCurrentPasteMode ()
 

Static Public Attributes

static final int CONSTRUCTING =0
 
static final int RECTANGLE =0
 
static final int HANDLE_SIZE = 5
 
static final int NOT_PASTING = -1
 
static Roi previousRoi
 

Protected Member Functions

void grow (int xNew, int yNew)
 
void moveHandle (int ox, int oy)
 
void updateClipRect ()
 
void handleMouseDrag (int sx, int sy, int flags)
 
void mouseDownInHandle (int handle, int sx, int sy)
 
void handleMouseDown (int sx, int sy)
 
void handleMouseUp (int screenX, int screenY)
 
void showStatus ()
 

Protected Attributes

int type
 
int xMax
 
ImagePlus imp
 
ImageCanvas ic
 
int oldX
 
int clipX
 
ImagePlus clipboard
 
boolean constrain
 
boolean center
 
boolean updateFullWindow
 
double mag = 1.0
 
String name
 
ImageProcessor cachedMask
 

Static Protected Attributes

static Color ROIColor = Prefs.getColor(Prefs.ROICOLOR,Color.yellow)
 
static int pasteMode = Blitter.COPY
 

Detailed Description

A rectangular region of interest and superclass for the other ROI classes.

Definition at line 13 of file Roi.java.

Constructor & Destructor Documentation

Roi ( int  x,
int  y,
int  width,
int  height 
)
inline

Creates a new rectangular Roi.

Definition at line 44 of file Roi.java.

Roi ( int  x,
int  y,
ImagePlus  imp 
)
inline

Starts the process of creating a user-defined rectangular Roi.

Definition at line 73 of file Roi.java.

Roi ( int  x,
int  y,
int  width,
int  height,
ImagePlus  imp 
)
inline

Obsolete

Definition at line 83 of file Roi.java.

Member Function Documentation

synchronized Object clone ( )
inline

Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning.

Definition at line 178 of file Roi.java.

double getAngle ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Returns the angle in degrees between the specified line and a horizontal line.

Definition at line 601 of file Roi.java.

Rectangle getBoundingRect ( )
inline

This obsolete method has been replaced by getBounds().

Definition at line 152 of file Roi.java.

Rectangle getBounds ( )
inline

Return this selection's bounding rectangle.

Definition at line 147 of file Roi.java.

static Color getColor ( )
inlinestatic

Returns the color used for drawing ROI outlines.

Definition at line 642 of file Roi.java.

static int getCurrentPasteMode ( )
inlinestatic

Returns the current paste transfer mode.

Definition at line 693 of file Roi.java.

double getFeretsDiameter ( )
inline

Returns Feret's diameter, the greatest distance between any two points along the ROI boundary.

Definition at line 136 of file Roi.java.

double getLength ( )
inline

Returns the perimeter length.

Definition at line 124 of file Roi.java.

String getName ( )
inline

Returns the name of this ROI, or null.

Definition at line 652 of file Roi.java.

int getPasteMode ( )
inline

Returns the current paste transfer mode, or NOT_PASTING (-1) if no paste operation is in progress.

See Also
ij.process.Blitter

Definition at line 685 of file Roi.java.

Polygon getPolygon ( )
inline

Returns the outline of this selection as a Polygon, or null if this is a straight line selection.

See Also
ij.process.ImageProcessor::setRoi
ij.process.ImageProcessor::drawPolygon
ij.process.ImageProcessor::fillPolygon

Definition at line 162 of file Roi.java.

String getTypeAsString ( )
inline

Convenience method that converts Roi type to a human-readable form.

Definition at line 708 of file Roi.java.

boolean isArea ( )
inline

Returns true if this is an area selection.

Definition at line 698 of file Roi.java.

int isHandle ( int  sx,
int  sy 
)
inline

Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.

Definition at line 457 of file Roi.java.

void nudge ( int  key)
inline

Nudge ROI one pixel on arrow key press.

Definition at line 280 of file Roi.java.

void nudgeCorner ( int  key)
inline

Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.

Definition at line 311 of file Roi.java.

static void setColor ( Color  c)
inlinestatic

Sets the color used for ROI outline to the specified value.

Definition at line 647 of file Roi.java.

void setName ( String  name)
inline

Sets the name of this ROI.

Definition at line 657 of file Roi.java.

static void setPasteMode ( int  transferMode)
inlinestatic

Sets the Paste transfer mode.

See Also
ij.process.Blitter

Definition at line 664 of file Roi.java.


The documentation for this class was generated from the following file: