|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.multisliceimage.roi.ROI
com.xinapse.multisliceimage.roi.Marker
public class Marker
A Class representing a point on an image.
| Field Summary | |
|---|---|
static int |
DEFAULT_SIZE
The size (in screen pixels) of a Marker as it is drawn on-screen (the extreme width and height). |
| Fields inherited from class com.xinapse.multisliceimage.roi.ROI |
|---|
handles, PREFERENCES_NODE_NAME, XTOKEN, YTOKEN |
| Constructor Summary | |
|---|---|
Marker(double x,
double y)
Creates a new Marker at the given (x, y) coordinate. |
|
Marker(double x,
double y,
ROIState state)
Creates a new Marker at the given (x, y) coordinate, and sets the state of the ROI. |
|
Marker(java.awt.geom.Point2D.Double pt)
Creates a new Marker at the given point. |
|
| Method Summary | |
|---|---|
java.util.List<ROI> |
add(ROI roi)
Morphologically adds an ROI to this ROI to create a new java.util.List<ROI> of ROIs that is the result of adding the shapes of the two ROIs. |
Marker |
clone()
Returns a clone of this ROI. |
boolean |
contains(ROI roi)
Indicates whether this Marker ROI contains another ROI entirely within its borders. |
java.util.List<ROI> |
dilate(double radius,
java.util.concurrent.atomic.AtomicInteger opCounter,
CancellableThread.Flag cancelFlag)
Dilates this ROI by the specified distance. |
boolean |
draw(java.awt.Graphics g,
java.awt.Rectangle visibleRectangle,
int imageDrawCols,
int imageDrawRows,
int xOffset,
int yOffset,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
boolean drawAnnotation)
Draws this ROI if it needs to be be drawn on screen. |
void |
drawInOrthoView(java.awt.Image orthoView,
javax.vecmath.Point3f orthoViewPosition,
javax.media.j3d.Transform3D imageToViewTx,
int nCols,
int nRows,
int nSlices,
float pixelXSize,
float pixelYSize,
boolean filled)
Draws this ROI on top of an orthogonal view of an image. |
boolean |
equals(java.lang.Object o)
Indicates whether some Object is equal to this ROI. |
java.util.List<ROI> |
exclusiveOr(ROI roi)
Performs an exclusive OR operation on the shape of this ROI with another ROI. |
void |
flipHorizontal(java.awt.geom.Point2D flipPoint)
Flip this ROI horizontally about a given location. |
void |
flipVertical(java.awt.geom.Point2D flipPoint)
Flip this ROI vertically about a given location. |
java.awt.geom.Rectangle2D |
getBoundingRectangle(int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
Returns a high-precision rectangle (in image pixel coordinates) that just bounds this ROI. |
static javax.swing.Icon |
getButtonIcon()
Returns an Icon that can be used for a button to create this type of ROI. |
ROI |
getCopy()
Returns a copy of this ROI. |
static ROICreateDialog |
getCreateDialog(CanAddROIToFrame listener)
Returns a JDialog that can be used to create Marker ROIs. |
static InteractionType |
getCreateInteractionType()
Returns the type of interaction needed to create a Marker. |
java.lang.String |
getDescription()
Return a description of this type of ROI. |
Feret |
getFeret()
Returns the minimum and maximum Feret's diameter for this ROI, in mm. |
static ROI |
getInstance(java.awt.geom.Point2D point,
boolean pixelSnap,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
byte userColour,
ROIState state)
Create a Marker at a point on an image. |
static java.lang.String |
getName()
Returns a descriptive name for this type of ROI. |
double |
getPerimeter()
Returns the perimeter length of this ROI. |
double |
getSquareArea()
Returns the area of this regular ROI in square mm. |
ROIStats |
getStats(java.lang.Object pix,
PixelDataType dataType,
int nCols,
int nRows,
int offset,
float pixelXSize,
float pixelYSize,
MaskAction maskAction,
MaskMode maskMode,
double maskValue,
java.io.PrintStream intensityOutputStream,
boolean isUnitsMM,
ComplexMode complexMode)
Returns statistics about this ROI, and (optionally) performs a masking operation. |
double |
getX()
Returns the x-coordinate of this Marker. |
double |
getY()
Returns the y-coordinate of this Marker. |
int |
hashCode()
Returns a hash code value for this Marker ROI. |
java.util.List<ROI> |
intersect(ROI roi)
Performs an intersection operation on the shape of this ROI with another ROI. |
boolean |
intersects(ROI roi)
Tests whether this ROI intersects another ROI. |
void |
move(double dx,
double dy)
Move this ROI by specified distances (in mm) in the x and y directions. |
boolean |
selectDeselect(java.awt.Point point,
boolean editMode,
boolean showDeleted,
int nAlreadySelected)
Selects or deselects an ROI after a user click at the point. |
void |
set(double x,
double y)
Sets the location of this Marker to the given location. |
void |
set(ROI roi)
Sets the shape of this ROI to the shape of the supplied argument ROI. |
java.util.List<ROI> |
subtract(ROI roi)
Morphologically subtracts an ROI from this ROI to create a new java.util.List<ROI> of ROIs that is the result of subtracting the shapes of the two ROIs. |
java.lang.String |
toString()
Returns a String describing this ROI. |
| Methods inherited from class com.xinapse.multisliceimage.roi.ROI |
|---|
add, addMorphological, clearDeletionHistory, clearStats, dilate, getAnnotation, getBoundingRectangle, getCachedStatistics, getClasses, getColor, getDisplayedBounds2D, getDisplayedBounds2D, getDisplayedRoiArea, getFeret, getHandles, getHandleUnderPoint, getImageSource, getPixelValue, getROIs, getROIs, getROIs, getSlice, getState, getStats, getStats, getTextColor, getTextFontSize, getUserColour, isDeleted, isEditable, isReloaded, isSelected, join, main, markDeleted, mmPosToPix, moveROIs, pixPosToMm, printStats, setAnnotation, setCreationHistory, setSlice, setState, setTextColor, setTextSize, setUserColour, subtract, write, write |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_SIZE
| Constructor Detail |
|---|
public Marker(java.awt.geom.Point2D.Double pt)
pt - the location of the marker.
public Marker(double x,
double y)
x - the x location of the marker.y - the y location of the marker.
public Marker(double x,
double y,
ROIState state)
x - the x location of the marker.y - the y location of the marker.state - the ROIState of the Marker.| Method Detail |
|---|
public double getX()
public double getY()
public double getSquareArea()
RegularROI
getSquareArea in interface RegularROIpublic static InteractionType getCreateInteractionType()
public void move(double dx,
double dy)
ROI
move in class ROIdx - the distance to move in the x-direction.dy - the distance to move in the y-direction.public void flipVertical(java.awt.geom.Point2D flipPoint)
ROI
flipVertical in class ROIflipPoint - the point about which the ROI will be flipped.public void flipHorizontal(java.awt.geom.Point2D flipPoint)
ROI
flipHorizontal in class ROIflipPoint - the point about which the ROI will be flipped.
public static ROI getInstance(java.awt.geom.Point2D point,
boolean pixelSnap,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
byte userColour,
ROIState state)
throws ROIException
point - the point on the image in pixel coordinates.pixelSnap - true if pixel snap is turned on.nCols - the number of columns in the image.nRows - the number of rows in the image.pixelXSize - the width of an image pixel in mm.pixelYSize - the height of an image pixel in mm.state - the ROIState of this ROI on creation.
ROIExceptionpublic java.util.List<ROI> add(ROI roi)
ROI
add in class ROIroi - the ROI to add.
public java.util.List<ROI> subtract(ROI roi)
ROI
subtract in class ROIroi - the ROI to add.
public java.util.List<ROI> intersect(ROI roi)
ROI
intersect in class ROIroi - the ROI with which to perform the intersection operation.
public boolean intersects(ROI roi)
ROINote that the area of intersection may be zero if one or other of the ROIs (or both) contains no area.
intersects in class ROIroi - the ROI to be tested for intersection.
public java.util.List<ROI> exclusiveOr(ROI roi)
ROI
exclusiveOr in class ROIroi - the ROI with which to perform the XOR operation.
public java.util.List<ROI> dilate(double radius,
java.util.concurrent.atomic.AtomicInteger opCounter,
CancellableThread.Flag cancelFlag)
ROI
radius - the radius of dilation.opCounter - a counter for the number of sub-operations that was performed to execute the
dilation operations.cancelFlag - a flag that, if set externally, cancels the operation.
public boolean draw(java.awt.Graphics g,
java.awt.Rectangle visibleRectangle,
int imageDrawCols,
int imageDrawRows,
int xOffset,
int yOffset,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
boolean drawAnnotation)
draw in class ROIg - the graphics context for the drawing operation.visibleRectangle - the part of the image that can be seen on-screen.imageDrawCols - width of the area in which this portion of the image is to be drawn.imageDrawRows - height of the area in which this portion of the image is to be drawn.xOffset - a horizontal offset for drawing operations.yOffset - a vertical offset for drawing operations.nCols - the number of columns in the image on which this ROI is defined.nRows - the number of rows in the image on which this ROI is defined.pixelXSize - pixel width for the image on which this ROI is defined.pixelYSize - pixel height for the image on which this ROI is defined.drawAnnotation - a flag to indicate whether annotation should be drawn.
public void drawInOrthoView(java.awt.Image orthoView,
javax.vecmath.Point3f orthoViewPosition,
javax.media.j3d.Transform3D imageToViewTx,
int nCols,
int nRows,
int nSlices,
float pixelXSize,
float pixelYSize,
boolean filled)
ROI
drawInOrthoView in class ROIorthoView - the java.awt.Image into which the ROI is to be drawn.orthoViewPosition - the coordinates (col, row, slice position) of the orthogonal view
in the original image.imageToViewTx - the Transform3D that maps original image pixel coordinates
to pixel coordinates in the orthogonal view.nCols - the number of columns in the original image.nRows - the number of rows in the original image.nSlices - the number of slices in the original image.pixelXSize - the pixel width in the original image.pixelYSize - the pixel height in the original image.filled - whether the ROI should be drawn filled (effective only for ROIs that
enclose an area).
public java.awt.geom.Rectangle2D getBoundingRectangle(int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
ROI
getBoundingRectangle in class ROInCols - the number of columns in the image on which this ROI is defined.nRows - the number of rows in the image on which this ROI is defined.pixelXSize - pixel width for the image on which this ROI is defined.pixelYSize - pixel height for the image on which this ROI is defined.
public ROIStats getStats(java.lang.Object pix,
PixelDataType dataType,
int nCols,
int nRows,
int offset,
float pixelXSize,
float pixelYSize,
MaskAction maskAction,
MaskMode maskMode,
double maskValue,
java.io.PrintStream intensityOutputStream,
boolean isUnitsMM,
ComplexMode complexMode)
ROI
getStats in class ROIpix - the whole image pixel value array. If pix is null, then the intensity-related
stats will all be set to zero.dataType - the type of pixels.nCols - the number of columns in the slice.nRows - the number of rows in the slice.offset - an offset (in pixels) into the pixel value array for the starting
pixel of the slice on which this ROI is defined.pixelXSize - the size of image pixels in the horizontal direction.pixelYSize - the size of image pixels in the vertical direction.maskAction - one of:
maskMode - how much of a pixel must be inside ROIs for the pixel to be part of the mask.maskValue - the pixel value to set outside/inside the shape when performing masking ops.intensityOutputStream - if non-null, pixel intensities within the
ROI will be printed to this PrintStream.isUnitsMM - true if the (x,y) coordinates of the pixel intensities
are to be written in mm, false if the coordinates are to be writtn in pixel units.complexMode - the calculation mode for PixelDataType.Complex images.
The statistics returned will correspond to the mode: the real part, imaginary part,
magnitude or phase.
public Feret getFeret()
ROI
getFeret in class ROIpublic double getPerimeter()
ROI
getPerimeter in class ROI
public boolean selectDeselect(java.awt.Point point,
boolean editMode,
boolean showDeleted,
int nAlreadySelected)
ROI
selectDeselect in class ROIpoint - the Point at which the user has clicked.editMode - true if the tool working with ROIs is in edit mode;
false if it is in view mode.showDeleted - true if the tool working with ROIs is set to show deleted ROIs;
false if it is not.nAlreadySelected - the number of ROIs already selected. This determines the exact
selection/deselection behaviour.
public static ROICreateDialog getCreateDialog(CanAddROIToFrame listener)
listener - the CanAddROIToFrame to which the ROI will be added when
the Add button of the Dialog is clicked.public boolean contains(ROI roi)
contains in class ROIroi - the ROI to be tested for containment within this ROI.
public boolean equals(java.lang.Object o)
ROI
equals in class ROIo - the Object to be tested for equality to this ROI.
public int hashCode()
hashCode in class ROI
public void set(double x,
double y)
x - the x-location.y - the y-location.
public void set(ROI roi)
throws java.lang.ClassCastException
ROI
set in class ROIjava.lang.ClassCastException - of the sub class of the argument ROI is not the
same as this ROI.public ROI getCopy()
ROI
getCopy in class ROIpublic java.lang.String toString()
ROI
toString in class ROIpublic java.lang.String getDescription()
ROI
getDescription in class ROIpublic static java.lang.String getName()
public static javax.swing.Icon getButtonIcon()
public Marker clone()
ROI
clone in class ROI
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||