public class OpenSplineROI extends SplineROI implements java.lang.Cloneable, StretchableROI, RotatableROI, EditableOutlineROI, LinearROI, RegularROI
closed, sMax, xpts, xSpline, ypts, ySpline
handles, PREFERENCES_NODE_NAME, XTOKEN, YTOKEN
Constructor and Description |
---|
OpenSplineROI(double[] x,
double[] y,
byte userColour,
ROIState state,
boolean checkIntegrity)
Creates a new OpenSplineROI with the specified knot points in mm coordinates.
|
OpenSplineROI(double[] x,
double[] y,
ROIState state)
Creates a new OpenSplineROI with the specified knot points in mm coordinates.
|
OpenSplineROI(SplineROI splineROI)
Creates a new OpenSplineROI with the positions of the knot points taken from
the supplied SplineROI.
|
Modifier and Type | Method and Description |
---|---|
OpenSplineROI |
clone()
Returns a clone of 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 InteractionType |
getCreateInteractionType()
Returns the type of interaction needed to create an OpenSplineROI.
|
java.lang.String |
getDescription()
Return a description of this type of ROI.
|
java.awt.geom.Point2D[] |
getIntensityProfile(java.lang.Object pix,
PixelDataType dataType,
int nCols,
int nRows,
int offset,
float pixelXSize,
float pixelYSize,
ComplexMode complexMode)
Returns an array of Point2D representing the pixel intensities along this
LinearROI.
|
double |
getLength()
Returns the length of this ROI in mm.
|
double |
getLengthPix(float pixelXSize,
float pixelYSize)
Returns the length of this ROI in image pixels.
|
static java.lang.String |
getName()
Returns a descriptive name for this type of ROI.
|
double |
getSquareArea()
Returns zero - an Open Spline has no area.
|
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.
|
CurvedLineROI |
toIrregular()
Creates a new CurvedLineROI that is close to the shape of this OpenSplineROI.
|
java.lang.String |
toString()
Returns a String describing this ROI.
|
alignKnots, alignKnots, approximate, close, contains, deleteVertex, draw, drawInOrthoView, equals, flipHorizontal, flipVertical, getCentre, getCentroid, getCurvature, getCurvature, getFeret, getFollowingVisibleHandle, getKnotPoint, getKnotPoints, getNormal, getNormal, getNPoints, getPerimeter, getPrecedingVisibleHandle, getPrincipalAxisAngle, getTheta, getVertexHandles, hashCode, insertTwoVertices, interpolate, intersect, isClosed, move, move, moveVertex, recalculateSplines, reduce, removeFirstKnotPoint, removeLastKnotPoint, selfIntersects, set, setKnotPoint, setKnotPoints, setKnotPoints, setKnotPoints, setKnotPoints, setTheta
add, add, addMorphological, clearDeletionHistory, dilate, exclusiveOr, getAnnotation, getBoundingRectangle, getBoundingRectangle, getCentroid, getClasses, getColor, getDesignTextFontSize, getDisplayedBounds2D, getDisplayedBounds2D, getDisplayedRoiArea, getFeret, getGroupUid, getGroupUid, getHandles, getHandleUnderPoint, getImageSource, getPixelValue, getROIs, getROIs, getROIs, getSlice, getState, getStats, getStats, getTextColor, getUserColour, group, intersects, isDeleted, isEditable, isGroup, isReloaded, isSameAnnotation, isSameColour, isSelected, join, main, markDeleted, mmPosToPix, moveROIs, pixPosToMm, printStats, selectDeselect, setAnnotation, setCreationHistory, setGroupUid, setSlice, setState, setTextColor, setTextSize, setUserColour, subtract, subtract, ungroup, ungroup, write, write
finalize, getClass, notify, notifyAll, wait, wait, wait
getDisplayedBounds2D, move
getCentre, getTheta, setTheta
deleteVertex, getFollowingVisibleHandle, getPrecedingVisibleHandle, getVertexHandles, insertTwoVertices, moveVertex
public OpenSplineROI(double[] x, double[] y, ROIState state) throws ROIException
x
- an array of x-coordinates for the knot points.y
- an array of y-coordinates for the knot points.state
- the ROIState of the newly-created ROI.ROIException
- if the OpenSplineROI cannot be created as specified.public OpenSplineROI(double[] x, double[] y, byte userColour, ROIState state, boolean checkIntegrity) throws ROIException
x
- an array of x-coordinates for the knot points.y
- an array of y-coordinates for the knot points.userColour
- the colour of this ROI. A value of 0 indicates that the ROI will be
drawn with the default colour for normal ROIs if unselected.state
- the ROIState of the newly-created ROI.checkIntegrity
- whether to check the integrity of the ROI.ROIException
- if the OpenSplineROI cannot be created as specified.public OpenSplineROI(SplineROI splineROI) throws ROIException
splineROI
- the SplineROI from which the knot point positions will be taken.ROIException
- if the OpenSplineROI cannot be created as specified.public double getSquareArea()
getSquareArea
in interface RegularROI
public double getLength()
LinearROI
public double getLengthPix(float pixelXSize, float pixelYSize)
LinearROI
getLengthPix
in interface LinearROI
pixelXSize
- the size of image pixels in the horizontal direction.pixelYSize
- the size of image pixels in the vertical direction.public java.awt.geom.Point2D[] getIntensityProfile(java.lang.Object pix, PixelDataType dataType, int nCols, int nRows, int offset, float pixelXSize, float pixelYSize, ComplexMode complexMode)
LinearROI
getIntensityProfile
in interface LinearROI
pix
- the array of pixel intensities for in which this LinearROI is positioned.dataType
- the PixelDataType of the array of pixel intensities.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.complexMode
- the calculation mode for Complex images. The intensity profile
returned will correspond to the mode: the real part, imaginary part, magnitude or phase.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 ROI
pix
- 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 CurvedLineROI toIrregular()
toIrregular
in class SplineROI
public ROI getCopy()
ROI
public OpenSplineROI clone()
ROI
public java.lang.String toString()
ROI
public java.lang.String getDescription()
ROI
getDescription
in class SplineROI
public static InteractionType getCreateInteractionType()
public static java.lang.String getName()
public static javax.swing.Icon getButtonIcon()
Copyright 2017 Xinapse Systems Limited. All Rights Reserved.